:root {
    --ink: #14111a;
    --paper: #f7f3f8;
    --paper-deep: #eee7f0;
    --card: rgba(255,255,255,.82);
    --line: rgba(20,17,26,.14);
    --muted: #716978;
    --pink: #ff3f91;
    --cyan: #30d8d0;
    --violet: #6d4aff;
    --night: #0b0a10;
    --radius: 20px;
    --shadow: 0 24px 80px rgba(29,15,41,.1);
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; min-width: 320px; overflow-x: hidden; color: var(--ink); background: var(--paper); font-family: Inter, "PingFang SC", "Microsoft YaHei", system-ui, sans-serif; font-size: 16px; }
button, input, textarea, select { font: inherit; }
button { cursor: pointer; }
.halftone { position: fixed; inset: 0; z-index: -2; pointer-events: none; background: radial-gradient(circle at 82% 8%, rgba(255,63,145,.15), transparent 28%), radial-gradient(circle at 8% 42%, rgba(48,216,208,.15), transparent 26%), radial-gradient(rgba(20,17,26,.13) .7px, transparent .7px); background-size: auto, auto, 7px 7px; mask-image: linear-gradient(to bottom, #000, transparent 72%); }
.site-header { height: 78px; padding: 0 clamp(18px,4vw,68px); display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line); background: rgba(247,243,248,.8); backdrop-filter: blur(18px); position: sticky; top: 0; z-index: 30; }
.brand { display: flex; align-items: center; gap: 12px; color: inherit; text-decoration: none; }
.brand-mark { width: 44px; height: 44px; display: grid; place-items: center; color: #fff; background: var(--night); border: 2px solid var(--ink); border-radius: 12px 4px 12px 4px; font-size: 20px; font-weight: 900; box-shadow: 5px 5px 0 var(--pink); transform: rotate(-2deg); }
.brand-copy { display: flex; flex-direction: column; gap: 4px; line-height: 1; }
.brand-copy strong { font-size: 14px; letter-spacing: .11em; }
.brand-copy small { color: var(--muted); font-size: 12px; letter-spacing: .12em; }
.top-nav { display: flex; gap: 4px; padding: 4px; border: 1px solid var(--line); border-radius: 12px; background: rgba(255,255,255,.62); }
.nav-link { border: 0; border-radius: 8px; padding: 9px 18px; color: var(--muted); background: transparent; font-size: 14px; }
.nav-link.active { color: white; background: var(--night); }
.system-state { display: flex; align-items: center; gap: 9px; color: var(--muted); font-size: 13px; }
.system-state span { width: 8px; height: 8px; border-radius: 50%; background: #e0a333; box-shadow: 0 0 0 5px rgba(224,163,51,.12); }
.system-state.online span { background: var(--cyan); box-shadow: 0 0 0 5px rgba(48,216,208,.14); }
main { width: min(1520px,100%); margin: 0 auto; padding: 0 clamp(18px,4vw,68px) 60px; }
.intro { min-height: 290px; display: grid; grid-template-columns: 1.4fr .6fr; align-items: end; gap: 60px; padding: 56px 0 44px; }
.eyebrow { margin: 0 0 15px; color: var(--violet); font-size: 13px; font-weight: 800; letter-spacing: .15em; }
.intro h1 { margin: 0; font-size: clamp(48px,6vw,92px); line-height: .96; letter-spacing: -.065em; }
.intro h1 em { color: var(--pink); font-family: Georgia, "Noto Serif SC", serif; font-weight: 500; }
.intro-copy { margin: 0; max-width: 460px; color: var(--muted); font-size: 16px; line-height: 1.8; }
.view { display: none; }
.view.active { display: block; }
.workspace-grid { display: grid; grid-template-columns: minmax(0,1.08fr) minmax(390px,.92fr); align-items: start; gap: 18px; }
.control-panel, .output-panel { border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.control-panel { padding: clamp(22px,3vw,38px); background: var(--card); }
.output-panel { position: sticky; top: 96px; background: var(--night); color: white; }
.panel-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; margin-bottom: 28px; }
.panel-heading > div { display: flex; gap: 14px; align-items: flex-start; }
.section-no { display: grid; place-items: center; min-width: 34px; height: 34px; border: 1px solid currentColor; border-radius: 50%; color: var(--pink); font-size: 12px; font-weight: 800; }
.panel-heading h2 { margin: -2px 0 4px; font-size: 25px; letter-spacing: -.035em; }
.panel-heading p { margin: 0; color: var(--muted); font-size: 13px; }
.model-badge, .ai-badge { flex: 0 0 auto; padding: 8px 10px; border: 1px solid rgba(109,74,255,.24); border-radius: 7px; color: var(--violet); background: rgba(109,74,255,.07); font-size: 11px; font-weight: 800; letter-spacing: .06em; }
.field { margin-bottom: 18px; }
.field label, .field-label { display: block; margin-bottom: 8px; font-size: 14px; font-weight: 760; }
.field label span { margin-left: 5px; color: var(--pink); font-size: 12px; }
.field input, .field textarea, .field select { width: 100%; border: 1px solid var(--line); border-radius: 10px; outline: 0; color: var(--ink); background: rgba(255,255,255,.86); padding: 12px 13px; font-size: 15px; line-height: 1.55; transition: border-color .2s, box-shadow .2s, background .2s; }
.field textarea { resize: vertical; min-height: 54px; }
.field input:focus, .field textarea:focus, .field select:focus { border-color: var(--violet); background: #fff; box-shadow: 0 0 0 4px rgba(109,74,255,.1); }
.field-primary textarea { min-height: 170px; padding: 18px; border-width: 2px; border-color: rgba(20,17,26,.2); font-size: 17px; line-height: 1.75; }
.field-hint { display: flex; justify-content: space-between; gap: 20px; margin-top: 8px; color: var(--muted); font-size: 12px; }
.input-note { display: block; margin-top: 7px; color: var(--muted); font-size: 12px; }
.field-row { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 14px; }
.field-row-3 { grid-template-columns: repeat(3,minmax(0,1fr)); }
.quick-ideas { display: flex; flex-wrap: wrap; gap: 8px; margin: -3px 0 24px; }
.quick-ideas button { border: 1px solid var(--line); border-radius: 999px; padding: 8px 12px; color: var(--muted); background: transparent; font-size: 13px; }
.quick-ideas button:hover { color: var(--ink); border-color: var(--pink); background: rgba(255,63,145,.06); }
.key-fields { padding-top: 22px; border-top: 1px solid var(--line); }
.adult-toggle { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin: 2px 0 22px; padding: 14px 16px; border: 1px solid rgba(255,63,145,.2); border-radius: 12px; background: rgba(255,63,145,.045); }
.adult-toggle > div { display: flex; align-items: center; gap: 11px; }
.adult-toggle > div > span { display: grid; place-items: center; width: 38px; height: 28px; color: #fff; background: var(--pink); border-radius: 6px; font-size: 12px; font-weight: 900; }
.adult-toggle p { margin: 0; display: flex; flex-direction: column; gap: 3px; }
.adult-toggle strong { font-size: 14px; }
.adult-toggle small { color: var(--muted); font-size: 12px; }
.toggle-switch { position: relative; flex: 0 0 auto; }
.toggle-switch input { position: absolute; opacity: 0; pointer-events: none; }
.toggle-track { display: block; width: 48px; height: 28px; border-radius: 999px; background: #c9c2cb; padding: 3px; transition: .2s; }
.toggle-track i { display: block; width: 22px; height: 22px; border-radius: 50%; background: white; box-shadow: 0 2px 7px rgba(0,0,0,.2); transition: .2s; }
.toggle-switch input:checked + .toggle-track { background: var(--pink); }
.toggle-switch input:checked + .toggle-track i { transform: translateX(20px); }
.toggle-switch input:focus-visible + .toggle-track { outline: 3px solid rgba(109,74,255,.25); }
.advanced { margin: 0 0 22px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.advanced summary { display: flex; justify-content: space-between; align-items: center; list-style: none; padding: 17px 2px; cursor: pointer; }
.advanced summary::-webkit-details-marker { display: none; }
.advanced summary span { font-size: 15px; font-weight: 800; }
.advanced summary b { margin-right: 10px; color: var(--pink); font-size: 12px; }
.advanced summary small { color: var(--muted); font-size: 12px; }
.advanced summary:after { content: '+'; margin-left: 12px; font-size: 24px; line-height: 1; }
.advanced[open] summary:after { content: '−'; }
.advanced-body { padding: 5px 0 15px; }
.group-title { display: flex; align-items: baseline; gap: 10px; margin: 22px 0 16px; }
.group-title span { color: var(--violet); font-size: 11px; font-weight: 900; letter-spacing: .12em; }
.group-title strong { font-size: 16px; }
.group-title small { margin-left: auto; color: var(--muted); font-size: 12px; }
.locked-title { padding-top: 20px; border-top: 1px dashed var(--line); }
.generate-button { width: 100%; display: flex; align-items: center; justify-content: space-between; border: 0; border-radius: 12px; padding: 17px 20px; color: white; background: var(--night); font-size: 16px; font-weight: 850; box-shadow: 7px 7px 0 var(--pink); transition: transform .2s, box-shadow .2s; }
.generate-button:hover { transform: translate(-2px,-2px); box-shadow: 9px 9px 0 var(--cyan); }
.generate-button:disabled { opacity: .58; cursor: wait; transform: none; box-shadow: 4px 4px 0 #777; }
.button-arrow { font-size: 23px; }
.output-heading { margin: 0; padding: 27px 28px; border-bottom: 1px solid rgba(255,255,255,.1); }
.output-heading p { color: #908b98; }
.ai-badge { color: var(--cyan); border-color: rgba(48,216,208,.28); background: rgba(48,216,208,.08); }
.output-stage { min-height: 620px; padding: 24px; }
.empty-output { min-height: 570px; display: grid; place-content: center; justify-items: center; text-align: center; border: 1px dashed rgba(255,255,255,.15); border-radius: 14px; }
.prompt-glyph { width: 140px; height: 140px; display: grid; place-content: center; border: 1px solid rgba(255,255,255,.14); border-radius: 50%; position: relative; }
.prompt-glyph:after { content: ''; position: absolute; inset: 12px; border: 1px dashed rgba(255,63,145,.55); border-radius: 50%; animation: orbit 15s linear infinite; }
.prompt-glyph span { color: var(--pink); font-family: Georgia,serif; font-size: 44px; line-height: 1; }
.prompt-glyph i { color: #8a8590; font-size: 11px; font-style: normal; }
@keyframes orbit { to { transform: rotate(360deg); } }
.empty-output h3 { margin: 24px 0 8px; font-size: 18px; }
.empty-output p { max-width: 360px; margin: 0; color: #8f8a95; font-size: 14px; line-height: 1.75; }
.hidden { display: none !important; }
.result-output { min-height: 570px; display: flex; flex-direction: column; }
.result-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 15px; margin-bottom: 14px; }
.result-toolbar > span { color: var(--cyan); font-size: 11px; font-weight: 800; letter-spacing: .1em; }
.result-toolbar button { margin-left: 6px; border: 1px solid rgba(255,255,255,.17); border-radius: 7px; padding: 7px 11px; color: #d8d4dc; background: transparent; font-size: 12px; }
#promptResult { flex: 1; width: 100%; min-height: 460px; resize: none; border: 1px solid rgba(255,255,255,.1); border-radius: 12px; outline: 0; padding: 24px; color: #f6f2f7; background: #121018; font-family: Inter, "PingFang SC", "Microsoft YaHei", system-ui, sans-serif; font-size: 16px; line-height: 1.9; letter-spacing: .005em; }
#promptResult:not([readonly]) { border-color: rgba(48,216,208,.5); }
.result-foot { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; padding-top: 14px; color: #8f8a95; font-size: 12px; }
.result-foot span { color: var(--pink); font-weight: 900; }
.result-foot p { margin: 0; text-align: right; }
.content-view { padding: 48px 0 80px; }
.section-header { display: flex; align-items: end; justify-content: space-between; gap: 30px; margin-bottom: 34px; padding-bottom: 22px; border-bottom: 1px solid var(--line); }
.section-header .eyebrow { margin-bottom: 8px; }
.section-header h2 { margin: 0; font-size: clamp(36px,4vw,58px); letter-spacing: -.05em; }
.section-header > p { max-width: 390px; margin: 0; color: var(--muted); line-height: 1.7; }
.template-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 14px; }
.template-card { min-height: 230px; display: flex; flex-direction: column; justify-content: space-between; padding: 24px; border: 1px solid var(--line); border-radius: 16px; background: var(--card); transition: .22s; }
.template-card:hover { transform: translateY(-4px); border-color: var(--pink); box-shadow: var(--shadow); }
.template-card .category { color: var(--violet); font-size: 11px; font-weight: 800; letter-spacing: .11em; }
.template-card h3 { margin: 14px 0 8px; font-size: 23px; }
.template-card p { margin: 0; color: var(--muted); font-size: 14px; line-height: 1.7; }
.template-card button { align-self: flex-start; margin-top: 28px; border: 0; border-radius: 8px; padding: 9px 13px; color: white; background: var(--night); font-size: 13px; font-weight: 760; }
.loading-card, .empty-list { padding: 44px; border: 1px dashed var(--line); border-radius: 15px; color: var(--muted); text-align: center; }
.outline-button { border: 1px solid var(--line); border-radius: 9px; padding: 10px 15px; color: var(--ink); background: transparent; font-size: 13px; }
.history-list { display: grid; gap: 12px; }
.history-item { display: grid; grid-template-columns: 175px minmax(0,1fr) auto; gap: 22px; align-items: start; padding: 22px; border: 1px solid var(--line); border-radius: 15px; background: var(--card); }
.history-meta { color: var(--muted); font-size: 12px; line-height: 1.8; }
.history-meta strong { display: block; color: var(--ink); font-size: 14px; }
.history-content h3 { margin: 0 0 8px; font-size: 15px; }
.history-content p { margin: 0; overflow: hidden; color: var(--muted); font-family: ui-monospace,Consolas,monospace; font-size: 13px; line-height: 1.65; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; }
.history-actions { display: flex; gap: 6px; }
.history-actions button { border: 1px solid var(--line); border-radius: 7px; padding: 8px 9px; color: var(--ink); background: transparent; font-size: 12px; }
footer { max-width: 1520px; margin: 0 auto; padding: 30px clamp(18px,4vw,68px); display: flex; justify-content: space-between; border-top: 1px solid var(--line); color: var(--muted); font-size: 12px; letter-spacing: .05em; }
footer span:first-child { color: var(--ink); font-weight: 900; }
footer p { margin: 0; }
.toast { position: fixed; left: 50%; bottom: 28px; z-index: 60; opacity: 0; pointer-events: none; transform: translate(-50%,18px); padding: 12px 17px; border-radius: 9px; color: white; background: var(--night); box-shadow: 0 14px 40px rgba(0,0,0,.25); font-size: 14px; transition: .24s; }
.toast.show { opacity: 1; transform: translate(-50%,0); }
@media (max-width: 1080px) {
    .workspace-grid { grid-template-columns: 1fr; }
    .output-panel { position: static; }
    .template-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
    .system-state { display: none; }
}
@media (max-width: 760px) {
    .site-header { height: 68px; padding: 0 15px; }
    .brand-copy { display: none; }
    .top-nav { position: fixed; left: 50%; bottom: 13px; z-index: 50; width: calc(100% - 26px); transform: translateX(-50%); background: rgba(11,10,16,.94); border-color: rgba(255,255,255,.12); box-shadow: 0 12px 34px rgba(0,0,0,.3); }
    .nav-link { flex: 1; color: #aaa4ae; padding: 10px 6px; }
    .nav-link.active { color: white; background: var(--pink); }
    main { padding-inline: 14px; }
    .intro { min-height: auto; grid-template-columns: 1fr; gap: 22px; padding: 48px 4px 34px; }
    .intro h1 { font-size: 46px; }
    .control-panel { padding: 21px 16px; }
    .panel-heading { flex-direction: column; }
    .output-heading { padding: 22px 18px; }
    .output-stage { min-height: 520px; padding: 16px; }
    .empty-output, .result-output { min-height: 490px; }
    #promptResult { min-height: 380px; }
    .field-row, .field-row-3 { grid-template-columns: 1fr; gap: 0; }
    .adult-toggle small { max-width: 210px; }
    .group-title { flex-wrap: wrap; }
    .group-title small { width: 100%; margin-left: 0; }
    .template-grid { grid-template-columns: 1fr; }
    .section-header { display: block; }
    .section-header > p { margin-top: 14px; }
    .history-item { grid-template-columns: 1fr; gap: 12px; }
    footer { display: block; padding-bottom: 86px; text-align: center; line-height: 1.8; }
    footer span:last-child { display: none; }
}
@media (prefers-reduced-motion: reduce) { * { scroll-behavior: auto !important; animation: none !important; transition: none !important; } }
