:root {
  font-family: Inter, 'PingFang SC', 'Microsoft YaHei', system-ui, sans-serif;
  color: #171832;
  background: #f6f7fb;
  font-synthesis: none;
  --muted: #626782;
  --accent: #443ad9;
  --border: #e5e6f1;
}

*, *::before, *::after { box-sizing: border-box; }
body, h1, h2, h3, p { margin: 0; }
button, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; }
button:disabled { cursor: default; }
a { color: inherit; text-decoration: none; }
:focus-visible { outline: 3px solid #7a72f5; outline-offset: 3px; }
.shell { max-width: 1160px; width: calc(100% - 80px); margin-inline: auto; }

.site-header { background: #fff; border-bottom: 1px solid var(--border); }
.header-inner { min-height: 72px; display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.brand { display: flex; gap: 11px; align-items: center; font-weight: 800; font-size: 20px; letter-spacing: .05em; }
.brand-mark { width: 34px; height: 34px; border-radius: 10px; background: var(--accent); display: grid; place-items: center; }
.brand-mark i { width: 16px; height: 14px; border: 1.5px solid white; border-radius: 4px; position: relative; transform: rotate(-8deg); }
.brand-mark i::after { content: ''; position: absolute; left: 5px; top: 3px; border: 3px solid transparent; border-left: 5px solid white; }
nav { display: flex; gap: 12px; }
nav button { font-size: 14px; border: 0; border-radius: 9px; padding: 10px 15px; background: transparent; color: var(--muted); }
nav button:hover, nav button.current { background: #f0eeff; color: var(--accent); }

.intro { position: relative; min-height: 312px; margin: 34px 0 24px; display: flex; align-items: center; border-radius: 26px; overflow: hidden; border: 1px solid #e5e1ff; background: linear-gradient(105deg, #f3f0ff 6%, #eee9ff 56%, #dedbff 100%); }
.intro-copy { padding: 38px 56px; position: relative; z-index: 1; }
h1 { font-size: clamp(42px, 5vw, 64px); letter-spacing: -.06em; line-height: 1.1; font-weight: 850; }
h1 em { color: var(--accent); font-style: normal; }
.intro p { color: #565a77; font-size: 16px; line-height: 1.7; margin-top: 18px; }
.illustration { width: clamp(290px, 39vw, 450px); height: 300px; position: absolute; inset: 50% 4% auto auto; transform: translateY(-50%); }
.orbit { border: 1px solid rgb(91 75 207 / 17%); border-radius: 50%; position: absolute; inset: 13% 4%; transform: rotate(-19deg); }
.orbit-inner { inset: 25% 12%; border-style: dashed; }
.film-tile, .picture-tile { position: absolute; width: 49%; height: 48%; border-radius: 21px; display: grid; place-items: center; }
.film-tile { inset: 18% auto auto 16%; transform: rotate(-13deg); color: #fff; border: 1px solid rgb(255 255 255 / 58%); background: linear-gradient(145deg, #9891f9, #4a3de0 75%); box-shadow: 0 20px 38px rgb(68 54 174 / 27%); }
.film-tile span { display: grid; place-items: center; width: 33%; aspect-ratio: 1; border-radius: 50%; background: rgb(255 255 255 / 20%); border: 1px solid rgb(255 255 255 / 55%); }
.film-tile span::after { content: ''; border: 11px solid transparent; border-left: 17px solid white; border-right: 0; margin-left: 4px; }
.picture-tile { inset: auto 11% 18% auto; transform: rotate(13deg); border: 1px solid #fff; background: linear-gradient(150deg, #fff 5%, #ebe8ff); box-shadow: 0 20px 40px rgb(80 59 183 / 19%); }
.picture-tile span { width: 54%; height: 54%; position: relative; overflow: hidden; border-radius: 11px; background: #cfc8ff; }
.picture-tile span::before { content: ''; position: absolute; inset: auto 0 0; height: 70%; background: #897aef; clip-path: polygon(0 81%, 33% 25%, 52% 56%, 72% 10%, 100% 64%, 100% 100%, 0 100%); }
.picture-tile span::after { content: ''; position: absolute; width: 15%; aspect-ratio: 1; top: 15%; right: 18%; border-radius: 50%; background: #fff; }
.spark, .small-spark, .dot { position: absolute; color: #6659de; }
.spark { top: 15%; right: 15%; font-size: 30px; }
.small-spark { bottom: 14%; left: 13%; font-size: 24px; }
.dot { top: 25%; left: 8%; background: #9b90ee; width: 7px; height: 7px; border-radius: 50%; }

.workspace { display: grid; grid-template-columns: minmax(0, 1fr) minmax(270px, 32%); gap: 22px; align-items: start; }
.card { border: 1px solid var(--border); border-radius: 20px; background: #fff; box-shadow: 0 5px 18px rgb(27 29 79 / 3%); min-width: 0; }
.tool { overflow: hidden; }
.switcher { display: flex; align-items: center; gap: 8px; padding: 12px 16px; background: #fdfdff; border-bottom: 1px solid var(--border); }
.switcher button { display: flex; gap: 9px; align-items: center; justify-content: center; color: #585d77; padding: 10px 17px; border: 1px solid transparent; background: transparent; border-radius: 9px; font-size: 14px; font-weight: 650; }
.switcher button:hover { background: #f5f4fa; }
.switcher button[aria-pressed='true'] { background: #efedff; border-color: #e4e0ff; color: #4338cb; }
.icon { display: inline-block; position: relative; width: 16px; height: 14px; border: 1.5px solid currentColor; border-radius: 3px; }
.icon-video::after { content: ''; position: absolute; top: 3px; left: 5px; border: 3px solid transparent; border-left: 4px solid currentColor; }
.icon-picture::before { content: ''; width: 3px; height: 3px; position: absolute; top: 2px; right: 2px; border-radius: 50%; background: currentColor; }
.icon-picture::after { content: ''; position: absolute; width: 8px; height: 5px; left: 2px; bottom: 1px; background: currentColor; clip-path: polygon(0 100%, 38% 10%, 100% 100%); }
.tool-body { padding: 25px 28px 28px; }
.field-title { display: block; font-size: 22px; line-height: 1.3; font-weight: 750; }
.field-help { font-size: 14px; line-height: 1.6; color: var(--muted); margin-top: 6px; }
.link-box { display: flex; position: relative; flex-direction: column; align-items: flex-end; padding: 12px; margin: 16px 0; border: 1px solid #dadced; border-radius: 12px; background: #fafafe; }
.link-box:focus-within { border-color: #776cf0; box-shadow: 0 0 0 2px #ebe8ff; }
textarea { width: 100%; background: transparent; color: inherit; border: 0; outline: none !important; min-height: 82px; padding: 4px; resize: vertical; }
textarea::placeholder { color: #737792; }
.quiet { border: 0; border-radius: 8px; background: #efedfc; color: #4338c4; font-size: 13px; font-weight: 650; padding: 8px 11px; }
.quiet:hover:not(:disabled) { background: #e5e0fb; }
.primary { display: flex; width: 100%; justify-content: center; align-items: center; gap: 14px; min-height: 48px; font-weight: 700; border: 0; border-radius: 10px; padding: 10px 14px; background: var(--accent); color: white; }
.primary:hover:not(:disabled) { background: #342bbc; }
.primary:disabled { background: #e7e5f5; color: #626181; }
.primary span { font-size: 20px; line-height: 1; }
.message { margin: 0 0 12px; border-radius: 8px; padding: 9px 12px; font-size: 14px; background: #fff0f2; color: #9b2345; }

.guide { padding: 24px; }
.guide h2 { font-size: 17px; }
.guide ol { margin: 19px 0 0; padding: 0; list-style: none; display: grid; gap: 16px; }
.guide li { display: flex; gap: 12px; }
.step { width: 27px; flex: 0 0 27px; height: 27px; display: grid; place-items: center; background: #f1edff; border-radius: 8px; color: var(--accent); font: 650 13px system-ui, sans-serif; }
.guide h3 { font-size: 14px; line-height: 1.5; }
.guide p { font-size: 13px; color: var(--muted); line-height: 1.6; margin-top: 2px; }
.site-footer { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 22px 0; margin-top: 32px; border-top: 1px solid var(--border); color: var(--muted); font-size: 13px; }
.site-footer span { flex: 0 0 auto; color: #3c3961; font-weight: 700; }

.upload { display: grid; place-items: center; align-content: center; gap: 9px; width: 100%; height: 160px; border: 1px dashed #a69de7; border-radius: 12px; color: var(--accent); background: #faf8ff; margin: 16px 0; }
.upload:hover, .upload.drag-over { background: #f0ecff; }
.upload-symbol { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 9px; background: #ebe6ff; font-size: 20px; }
.upload span:last-child { color: var(--muted); font-size: 13px; }
.editor { display: flex; justify-content: center; background: #f3f2fa; border: 1px solid var(--border); border-radius: 12px; margin-top: 14px; padding: 10px; }
.selection-area { position: relative; max-width: 100%; overflow: hidden; cursor: crosshair; touch-action: none; }
.selection-area img { display: block; width: auto; height: auto; max-width: 100%; max-height: 58vh; user-select: none; }
.selection { position: absolute; pointer-events: none; border: 2px dashed #fff; outline: 1px solid var(--accent); background: #7062ed55; }
.editor-actions { display: flex; gap: 8px; margin: 10px 0 16px; }
.result { margin-top: 22px; border-top: 1px solid var(--border); padding-top: 17px; }
.result-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.result-heading h2 { font-size: 17px; overflow-wrap: anywhere; }
.result-source { color: var(--muted); display: block; font-size: 12px; margin-bottom: 4px; }
.secondary { flex-shrink: 0; background: #efedff; color: var(--accent); border-radius: 8px; padding: 9px 12px; font-weight: 650; font-size: 13px; }
.secondary:hover { background: #e5e0fb; }
.result video, .result img { display: block; width: 100%; max-height: 60vh; object-fit: contain; border-radius: 10px; background: #f4f3fa; }
.result video { background: #171832; }

@media (max-width: 760px) {
  .shell { width: calc(100% - 36px); }
  .header-inner { min-height: 58px; gap: 8px; }
  nav { gap: 3px; }
  nav button { font-size: 13px; padding: 8px; }
  .brand { font-size: 17px; gap: 7px; }
  .brand-mark { width: 30px; height: 30px; }
  .intro { min-height: 216px; margin: 20px 0 15px; border-radius: 19px; }
  .intro-copy { padding: 24px; }
  h1 { font-size: clamp(31px, 7vw, 49px); letter-spacing: -.05em; }
  .intro p { font-size: 13px; margin-top: 13px; }
  .illustration { width: min(45%, 245px); height: auto; aspect-ratio: 1.3; inset-inline-end: 2%; }
  .film-tile, .picture-tile { border-radius: 12px; }
  .film-tile span::after { border-width: 7px 0 7px 10px; margin-left: 2px; }
  .picture-tile span { border-radius: 5px; }
  .spark { font-size: 18px; }
  .small-spark { font-size: 16px; }
  .dot { width: 4px; height: 4px; }
  .workspace { grid-template-columns: 1fr; gap: 15px; }
  .card { border-radius: 16px; }
  .switcher { padding: 9px; }
  .switcher button { flex: 1; padding: 9px 5px; }
  .tool-body, .guide { padding: 18px; }
  .field-title { font-size: 20px; }
  .site-footer { margin-top: 22px; }
}

@media (max-width: 350px) {
  .shell { width: calc(100% - 24px); }
  .intro-copy { padding-inline: 15px; }
  .tool-body, .guide { padding-inline: 13px; }
}
