:root {
  color-scheme: light;
  --ink: #141917;
  --muted: #66706b;
  --line: #dfe4e1;
  --surface: #ffffff;
  --canvas: #f4f6f5;
  --dark: #101412;
  --accent: #168363;
  --accent-strong: #0d684e;
  --amber: #d89628;
  --danger: #c23c36;
  --shadow: 0 10px 32px rgba(18, 31, 25, .08);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; min-height: 100%; }
body { font-family: Inter, "Segoe UI", "Microsoft YaHei", sans-serif; color: var(--ink); background: var(--canvas); letter-spacing: 0; }
button, input, select, textarea { font: inherit; letter-spacing: 0; }
button { cursor: pointer; }
svg { width: 20px; height: 20px; stroke-width: 1.8; }

.landing { min-height: 100vh; color: #f7fbff; background: #030814; }
.landing-nav { position: absolute; z-index: 12; top: 0; left: 0; right: 0; height: 72px; padding: 0 max(28px, 6vw); border-bottom: 1px solid rgba(126, 167, 205, .12); display: flex; align-items: center; justify-content: space-between; background: rgba(3, 8, 20, .78); backdrop-filter: blur(16px); }
.landing-brand { display: inline-flex; align-items: center; gap: 10px; color: #f8fbff; text-decoration: none; }
.landing-brand-mark { width: 34px; height: 34px; border: 1px solid rgba(81, 204, 255, .42); border-radius: 7px; display: grid; place-items: center; color: #73dcff; background: #0c2637; box-shadow: 0 0 20px rgba(63, 190, 245, .14); }
.landing-brand-mark svg { width: 17px; height: 17px; }
.landing-brand strong { font-size: 14px; }
.landing-nav-actions { display: flex; align-items: center; gap: 9px; }
.landing-nav-actions button { min-height: 36px; padding: 0 15px; border-radius: 6px; font-size: 12px; font-weight: 700; }
.landing-login { border: 1px solid rgba(137, 165, 194, .28); color: #d7e4ef; background: rgba(10, 20, 38, .56); }
.landing-register { border: 1px solid #58c9ee; color: #03121c; background: #62d3f4; box-shadow: 0 8px 24px rgba(56, 193, 235, .18); }
.landing-hero { position: relative; min-height: calc(100svh - 24px); padding: 124px max(28px, 6vw) 38px; overflow: hidden; display: flex; flex-direction: column; justify-content: space-between; isolation: isolate; }
.particle-canvas { position: absolute; z-index: -2; inset: 0; width: 100%; height: 100%; }
.hero-glow { position: absolute; z-index: -3; inset: 0; background: #030814; }
.hero-content { width: min(900px, 100%); margin: 2vh auto 54px; text-align: center; }
.hero-badge { width: fit-content; min-height: 34px; margin: 0 auto 24px; padding: 0 13px; border: 1px solid rgba(72, 198, 241, .34); border-radius: 18px; display: flex; align-items: center; gap: 7px; color: #8edfff; background: rgba(8, 32, 50, .76); font-size: 11px; font-weight: 700; }
.hero-badge svg { width: 14px; height: 14px; fill: #f0bd4f; color: #f0bd4f; }
.hero-content h1 { margin: 0; color: #f7fbff; font-size: 58px; line-height: 1.12; letter-spacing: 0; }
.hero-content h1 span { color: #6bd8ff; background: linear-gradient(90deg, #58d5ff, #8d7dff); background-clip: text; -webkit-background-clip: text; -webkit-text-fill-color: transparent; }
.hero-copy { margin: 20px auto 0; color: #a8b7c7; font-size: 16px; line-height: 1.8; }
.hero-actions { margin-top: 28px; display: grid; justify-items: center; gap: 13px; }
.hero-primary { min-height: 50px; padding: 0 22px; border: 1px solid #76dcfb; border-radius: 7px; display: inline-flex; align-items: center; justify-content: center; gap: 9px; color: #04151e; background: #5bcef3; box-shadow: 0 12px 34px rgba(45, 188, 234, .22); font-weight: 800; }
.hero-primary:hover { background: #84ddf8; transform: translateY(-1px); }
.hero-primary svg { width: 18px; height: 18px; }
.hero-secondary { min-height: 30px; padding: 0 6px; border: 0; display: inline-flex; align-items: center; gap: 5px; color: #8fa5b9; background: transparent; font-size: 12px; }
.hero-secondary:hover { color: #dceaf5; }
.hero-secondary svg { width: 13px; height: 13px; }
.capability-preview { width: min(1220px, 100%); margin: 0 auto; }
.landing-section-title { text-align: center; }
.landing-section-title > p, .landing-cta > div > p { margin: 0 0 8px; color: #56d1f7; font-size: 10px; font-weight: 800; letter-spacing: .14em; }
.landing-section-title h2 { margin: 0; font-size: 27px; }
.landing-section-title > span { display: block; margin-top: 8px; color: #8194a7; font-size: 12px; }
.capability-grid { margin-top: 22px; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.capability-card { min-width: 0; min-height: 98px; padding: 17px; border: 1px solid rgba(126, 158, 189, .2); border-radius: 8px; display: grid; grid-template-columns: 48px minmax(0, 1fr) 20px; align-items: center; gap: 13px; color: #f4f8fb; background: rgba(12, 23, 42, .82); text-align: left; transition: border-color .18s, background .18s, transform .18s; }
.capability-card:hover { border-color: rgba(91, 205, 243, .58); background: rgba(14, 31, 52, .94); transform: translateY(-2px); }
.capability-card > span:nth-child(2) { min-width: 0; }
.capability-card strong { display: block; font-size: 14px; }
.capability-card small { display: block; margin-top: 6px; overflow: hidden; color: #91a2b3; font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.capability-card > svg { width: 16px; height: 16px; color: #63798e; }
.capability-icon { width: 48px; height: 48px; border-radius: 8px; display: grid; place-items: center; }
.capability-icon svg { width: 22px; height: 22px; }
.capability-icon.is-violet { color: #a590ff; background: #251d4d; }
.capability-icon.is-cyan { color: #55dcf5; background: #073a48; }
.capability-icon.is-pink { color: #f18dc4; background: #451b3a; }
.workflow-band { padding: 96px max(28px, 6vw); color: #121a20; background: #f3f6f7; }
.workflow-inner { width: min(1120px, 100%); margin: 0 auto; }
.landing-section-title.is-dark > p { color: #087e92; }
.landing-section-title.is-dark > span { color: #6b777d; }
.workflow-grid { margin-top: 42px; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); border-top: 1px solid #d5dcdf; }
.workflow-grid article { position: relative; min-height: 230px; padding: 34px 34px 28px; border-right: 1px solid #d5dcdf; }
.workflow-grid article:last-child { border-right: 0; }
.workflow-grid article > span { position: absolute; top: 22px; right: 26px; color: #c2cace; font-size: 34px; font-weight: 800; }
.workflow-grid article > svg { width: 28px; height: 28px; color: #088e9f; }
.workflow-grid h3 { margin: 40px 0 9px; font-size: 18px; }
.workflow-grid p { margin: 0; color: #6b777d; font-size: 13px; line-height: 1.75; }
.landing-cta { min-height: 280px; padding: 60px max(28px, 8vw); display: flex; align-items: center; justify-content: space-between; gap: 30px; background: #0d1518; }
.landing-cta h2 { margin: 0; font-size: 32px; }
.landing-footer { min-height: 76px; padding: 0 max(28px, 8vw); border-top: 1px solid #263136; display: flex; align-items: center; justify-content: space-between; color: #9eacb2; background: #0d1518; }
.landing-footer span { color: #f4f8fa; font-weight: 800; }
.landing-footer small { font-size: 11px; }

.app-shell { min-height: 100vh; display: grid; grid-template-columns: 236px minmax(0, 1fr); }
.sidebar { position: sticky; top: 0; height: 100vh; padding: 24px 16px; background: var(--dark); color: #f6faf8; display: flex; flex-direction: column; }
.brand { display: flex; align-items: center; gap: 12px; padding: 0 8px 28px; }
.brand-mark { width: 38px; height: 38px; flex: 0 0 38px; display: grid; place-items: center; color: #0d3026; background: #8ee1bf; border-radius: 8px; font-size: 13px; font-weight: 800; }
.brand strong { display: block; font-size: 15px; }
.brand span { display: block; margin-top: 3px; color: #8f9994; font-size: 11px; }
.nav-list { display: grid; gap: 6px; }
.nav-item { width: 100%; height: 44px; padding: 0 12px; border: 0; border-radius: 6px; display: flex; align-items: center; gap: 11px; color: #aeb8b3; background: transparent; text-align: left; transition: .18s ease; }
.nav-item:hover { color: #fff; background: #1c231f; }
.nav-item.is-active { color: #f7fffb; background: #25342d; }
.nav-item.is-active svg { color: #77dbb3; }
.sidebar-account { margin-top: auto; padding: 14px 8px; border-top: 1px solid #29312d; display: flex; align-items: center; gap: 8px; }
.sidebar-account[hidden] { display: none; }
.sidebar-account div { min-width: 0; flex: 1; }
.sidebar-account span { display: block; color: #87928c; font-size: 10px; }
.sidebar-account strong { display: block; margin-top: 3px; overflow: hidden; color: #eff8f3; font-size: 12px; text-overflow: ellipsis; }
.sidebar-account .icon-button { width: 34px; height: 34px; flex: 0 0 34px; }
.sidebar-account .icon-button svg { width: 17px; height: 17px; }
.sidebar-foot { padding: 12px 10px 2px; border-top: 1px solid #29312d; color: #a3ada8; display: flex; align-items: center; gap: 8px; font-size: 12px; }
.status-dot { width: 7px; height: 7px; border-radius: 50%; background: #7e8984; }
.status-dot.is-ok { background: #5fd29e; box-shadow: 0 0 0 4px rgba(95, 210, 158, .12); }
.status-dot.is-error { background: #e9655d; }

.workspace { min-width: 0; }
.mobile-header { display: none; }
.view { display: none; min-height: 100vh; padding: 34px clamp(22px, 4vw, 64px) 40px; }
.view.is-active { display: block; }
.view-header { max-width: 1320px; margin: 0 auto 26px; display: flex; align-items: end; justify-content: space-between; gap: 20px; }
.eyebrow { margin: 0 0 6px; color: var(--accent); font-size: 11px; font-weight: 800; letter-spacing: .12em; }
.view-header h1 { margin: 0; font-size: clamp(25px, 3vw, 36px); line-height: 1.15; letter-spacing: 0; }
.view-header p:not(.eyebrow) { margin: 7px 0 0; color: var(--muted); font-size: 14px; }
.compact-select { min-width: 230px; display: grid; gap: 6px; }
.compact-select span { color: var(--muted); font-size: 12px; }

select, input, textarea { width: 100%; border: 1px solid var(--line); border-radius: 6px; background: #fff; color: var(--ink); outline: none; transition: border-color .16s, box-shadow .16s; }
select, input { height: 42px; padding: 0 12px; }
textarea { padding: 12px; resize: vertical; line-height: 1.6; }
select:focus, input:focus, textarea:focus { border-color: #53a58a; box-shadow: 0 0 0 3px rgba(22, 131, 99, .1); }

.chat-layout { max-width: 1080px; height: calc(100vh - 145px); min-height: 560px; margin: 0 auto; position: relative; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; overflow: hidden; box-shadow: var(--shadow); }
.chat-thread { height: 100%; padding: 24px 7% 126px; overflow-y: auto; }
.welcome-message { min-height: 72%; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; }
.welcome-icon { width: 50px; height: 50px; border: 1px solid #b9dccc; border-radius: 50%; display: grid; place-items: center; color: var(--accent); background: #eef8f3; }
.welcome-message h2 { margin: 17px 0 7px; font-size: 24px; }
.welcome-message p { margin: 0; color: var(--muted); }
.suggestions { margin-top: 28px; display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.suggestions button { padding: 8px 12px; border: 1px solid var(--line); border-radius: 6px; color: #44504a; background: #fff; font-size: 13px; }
.suggestions button:hover { border-color: #9ac9b7; color: var(--accent-strong); }
.message { margin: 0 auto 22px; max-width: 760px; display: grid; grid-template-columns: 32px minmax(0, 1fr); gap: 12px; }
.message-avatar { width: 32px; height: 32px; border-radius: 6px; display: grid; place-items: center; background: #e9eeeb; color: #45514b; font-size: 12px; font-weight: 800; }
.message.assistant .message-avatar { color: #0d6249; background: #dff3ea; }
.message-content { min-width: 0; padding-top: 4px; line-height: 1.75; white-space: pre-wrap; word-break: break-word; }
.message-meta { margin-bottom: 4px; font-size: 12px; font-weight: 700; }
.typing::after { content: ""; display: inline-block; width: 6px; height: 15px; margin-left: 3px; vertical-align: -2px; background: var(--accent); animation: blink 1s steps(2) infinite; }
@keyframes blink { 50% { opacity: 0; } }
.composer { position: absolute; left: 6%; right: 6%; bottom: 22px; min-height: 58px; padding: 9px 58px 9px 14px; border: 1px solid #cfd7d3; border-radius: 8px; background: #fff; box-shadow: 0 8px 28px rgba(26, 44, 35, .12); }
.composer textarea { max-height: 160px; min-height: 38px; padding: 7px 0; border: 0; box-shadow: none; resize: none; }
.send-button { position: absolute; right: 10px; bottom: 10px; width: 38px; height: 38px; border: 0; border-radius: 6px; display: grid; place-items: center; color: #fff; background: var(--accent); }
.send-button:disabled { cursor: not-allowed; opacity: .5; }

.creator-layout { max-width: 1320px; margin: 0 auto; display: grid; grid-template-columns: minmax(340px, 430px) minmax(0, 1fr); gap: 22px; align-items: start; }
.control-panel, .result-stage { min-height: 640px; border: 1px solid var(--line); background: var(--surface); }
.control-panel { padding: 22px; border-radius: 8px; display: grid; align-content: start; gap: 17px; }
.result-stage { border-radius: 8px; overflow: hidden; position: sticky; top: 24px; display: grid; place-items: center; background: #e9eeeb; }
.field { display: grid; gap: 8px; }
.field > label, .field > span:first-child { font-size: 13px; font-weight: 700; }
.field-meta { display: flex; justify-content: space-between; color: #87908c; font-size: 11px; }
.model-note { display: none; padding: 10px 12px; border-left: 3px solid var(--amber); background: #fff8ea; color: #6d5a35; font-size: 12px; line-height: 1.55; }
.model-note:not(:empty) { display: block; }
.dynamic-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 12px; }
.dynamic-fields .field.is-wide { grid-column: 1 / -1; }
.segmented { display: grid; grid-template-columns: repeat(auto-fit, minmax(54px, 1fr)); gap: 5px; }
.segment { min-height: 38px; padding: 6px 8px; border: 1px solid var(--line); border-radius: 5px; background: #fff; color: #56615b; font-size: 12px; }
.segment.is-selected { border-color: var(--accent); color: var(--accent-strong); background: #edf8f3; box-shadow: inset 0 0 0 1px var(--accent); }
.toggle-row { min-height: 42px; padding: 0 12px; border: 1px solid var(--line); border-radius: 6px; display: flex; align-items: center; justify-content: space-between; }
.toggle { width: 38px; height: 22px; padding: 2px; border: 0; border-radius: 12px; background: #bdc5c1; }
.toggle::after { content: ""; display: block; width: 18px; height: 18px; border-radius: 50%; background: #fff; transition: transform .16s; }
.toggle.is-on { background: var(--accent); }
.toggle.is-on::after { transform: translateX(16px); }
.upload-sections { display: grid; gap: 14px; }
.upload-block { border: 1px solid var(--line); border-radius: 6px; overflow: hidden; }
.upload-head { padding: 11px 12px; display: flex; justify-content: space-between; align-items: center; background: #f7f9f8; }
.upload-head strong { display: block; font-size: 12px; }
.upload-head div span { display: block; margin-top: 2px; color: var(--muted); font-size: 10px; }
.upload-count { color: var(--accent); font-size: 11px; }
.drop-zone { margin: 10px; min-height: 72px; border: 1px dashed #bdc8c2; border-radius: 5px; display: flex; align-items: center; justify-content: center; gap: 8px; color: #65716b; background: #fbfcfb; font-size: 12px; }
.drop-zone:hover { border-color: var(--accent); color: var(--accent); }
.drop-zone small { color: #909995; }
.file-list { padding: 0 10px 10px; display: grid; gap: 6px; }
.file-item { min-height: 34px; padding: 5px 7px; border: 1px solid #e5e9e7; border-radius: 5px; display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 8px; font-size: 11px; }
.file-item span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-item button { width: 25px; height: 25px; padding: 0; border: 0; background: transparent; color: var(--muted); }
.file-item.is-uploading { color: var(--muted); }
.primary-button { min-height: 46px; padding: 0 16px; border: 0; border-radius: 6px; display: flex; align-items: center; justify-content: center; gap: 9px; color: #fff; background: var(--accent); font-weight: 700; }
.primary-button:hover { background: var(--accent-strong); }
.primary-button:disabled { cursor: progress; opacity: .58; }
.stage-empty { padding: 40px; text-align: center; color: #64706a; }
.stage-empty > svg { width: 40px; height: 40px; color: #7f8d86; }
.stage-empty h2 { margin: 15px 0 7px; color: #3e4843; font-size: 17px; }
.stage-empty p { margin: 0; font-size: 13px; }
.task-state { width: min(450px, 80%); text-align: center; }
.task-state .spinner { width: 42px; height: 42px; margin: 0 auto 18px; border: 3px solid #cad4cf; border-top-color: var(--accent); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.task-state h2 { margin: 0 0 7px; font-size: 18px; }
.task-state p { margin: 0; color: var(--muted); font-size: 13px; }
.media-result { width: 100%; height: 100%; display: grid; place-items: center; background: #111513; }
.media-result img, .media-result video { max-width: 100%; max-height: calc(100vh - 170px); object-fit: contain; }
.result-actions { position: absolute; right: 14px; bottom: 14px; display: flex; gap: 7px; }
.result-actions a { width: 38px; height: 38px; border-radius: 6px; display: grid; place-items: center; color: #fff; background: rgba(10, 14, 12, .82); }

.toast-region { position: fixed; right: 20px; bottom: 20px; z-index: 100; display: grid; gap: 8px; }
.toast { max-width: 360px; padding: 12px 14px; border-radius: 6px; color: #fff; background: #222925; box-shadow: var(--shadow); font-size: 13px; animation: toast-in .2s ease; }
.toast.is-error { background: #852f2b; }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } }
.access-dialog { width: min(410px, calc(100% - 32px)); max-height: calc(100dvh - 32px); padding: 0; border: 0; border-radius: 8px; overflow-y: auto; box-shadow: 0 24px 70px rgba(0, 0, 0, .24); }
.access-dialog::backdrop { background: rgba(9, 12, 11, .65); }
.access-dialog form { padding: 30px; }
.dialog-close { position: absolute; z-index: 2; top: 14px; right: 14px; width: 34px; height: 34px; padding: 0; border: 0; border-radius: 5px; display: grid; place-items: center; color: #7b8781; background: transparent; }
.dialog-close:hover { color: #25312b; background: #f0f3f1; }
.dialog-close svg { width: 18px; height: 18px; }
.access-dialog form[hidden] { display: none; }
.dialog-icon { width: 44px; height: 44px; border-radius: 8px; display: grid; place-items: center; color: var(--accent); background: #e8f5ef; }
.access-dialog h2 { margin: 20px 0 7px; }
.access-dialog p { color: var(--muted); }
.access-dialog .field { margin: 16px 0 0; }
.access-dialog .primary-button { width: 100%; margin-top: 12px; }
.form-error { min-height: 18px; margin: 0; color: var(--danger) !important; font-size: 12px; }
.auth-switch { width: 100%; margin-top: 12px; padding: 8px; border: 0; color: var(--accent-strong); background: transparent; font-size: 13px; }
.auth-switch:hover { text-decoration: underline; }

@media (max-width: 860px) {
  .landing-nav { height: 60px; padding: 0 16px; }
  .landing-brand-mark { width: 31px; height: 31px; }
  .landing-brand strong { font-size: 13px; }
  .landing-nav-actions { gap: 6px; }
  .landing-nav-actions button { min-height: 32px; padding: 0 11px; font-size: 11px; }
  .landing-hero { min-height: calc(100svh - 18px); padding: 92px 16px 25px; }
  .hero-content { margin: 0 auto 34px; }
  .hero-badge { margin-bottom: 17px; }
  .hero-content h1 { font-size: 36px; }
  .hero-copy { max-width: 520px; margin-top: 14px; font-size: 13px; }
  .hero-actions { margin-top: 20px; gap: 8px; }
  .hero-primary { min-height: 45px; }
  .landing-section-title h2 { font-size: 22px; }
  .landing-section-title > span { margin-top: 5px; }
  .capability-grid { margin-top: 16px; display: flex; gap: 10px; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; }
  .capability-grid::-webkit-scrollbar { display: none; }
  .capability-card { flex: 0 0 calc(100vw - 52px); min-height: 88px; scroll-snap-align: center; }
  .workflow-band { padding: 72px 20px; }
  .workflow-grid { grid-template-columns: 1fr; }
  .workflow-grid article { min-height: 178px; border-right: 0; border-bottom: 1px solid #d5dcdf; }
  .workflow-grid article:last-child { border-bottom: 0; }
  .workflow-grid h3 { margin-top: 28px; }
  .landing-cta { min-height: 300px; padding: 55px 24px; align-items: flex-start; flex-direction: column; justify-content: center; }
  .landing-cta h2 { font-size: 27px; }
  .landing-footer { padding: 22px 20px; align-items: flex-start; flex-direction: column; justify-content: center; gap: 7px; }
  .app-shell { display: block; }
  .sidebar { position: fixed; z-index: 30; width: 236px; transform: translateX(-100%); transition: transform .2s ease; }
  .sidebar.is-open { transform: translateX(0); box-shadow: 16px 0 50px rgba(0, 0, 0, .2); }
  .mobile-header { height: 60px; padding: 0 16px; display: flex; align-items: center; gap: 10px; background: var(--dark); color: #fff; }
  .mobile-header .brand-mark { width: 32px; height: 32px; flex-basis: 32px; }
  .mobile-header .icon-button { margin-left: auto; }
  .icon-button { width: 38px; height: 38px; border: 0; border-radius: 5px; display: grid; place-items: center; color: #fff; background: #242c28; }
  .view { min-height: calc(100vh - 60px); padding: 24px 14px; }
  .view-header { align-items: start; flex-direction: column; }
  .compact-select { width: 100%; }
  .chat-layout { height: calc(100vh - 220px); min-height: 500px; }
  .chat-thread { padding-left: 16px; padding-right: 16px; }
  .composer { left: 10px; right: 10px; bottom: 10px; }
  .creator-layout { grid-template-columns: 1fr; }
  .control-panel, .result-stage { min-height: auto; }
  .result-stage { position: relative; top: 0; min-height: 420px; aspect-ratio: 4 / 3; }
}

@media (max-width: 520px) {
  .hero-content h1 { font-size: 34px; }
  .hero-content h1 span { display: block; margin-top: 3px; }
  .hero-copy { max-width: 330px; }
  .hero-badge { font-size: 10px; }
  .capability-preview .landing-section-title > p { display: none; }
  .capability-preview .landing-section-title h2 { font-size: 20px; }
  .view-header h1 { font-size: 27px; }
  .suggestions { display: grid; width: 100%; }
  .dynamic-fields { grid-template-columns: 1fr; }
  .dynamic-fields .field.is-wide { grid-column: auto; }
  .control-panel { padding: 16px; }
  .result-stage { min-height: 360px; aspect-ratio: 3 / 4; }
}
