:root {
  color-scheme: light;
  font-family: "DM Sans", "Microsoft YaHei", "PingFang SC", "Noto Sans SC", sans-serif;
  color: #2e2624;
  background: #faf8f5;
  --paper: #fffdfb;
  --line: #eae2db;
  --muted: #756762;
  --rose: #884653;
  --rose-dark: #6d3440;
  --rose-pale: #f6ebe9;
}
*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; -webkit-font-smoothing: antialiased; }
[hidden], .symbols { display: none !important; }
button, input, a { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; }
button:disabled { cursor: default; }
a { text-decoration: none; color: inherit; }
:focus-visible { outline: 2px solid var(--rose); outline-offset: 4px; }
svg { width: 20px; height: 20px; stroke: currentColor; fill: none; stroke-width: 1.65; stroke-linecap: round; stroke-linejoin: round; flex: none; }
p, h1, h2 { margin: 0; }

.topbar { background: #fffdfa; border-bottom: 1px solid var(--line); }
.topbar-inner { width: min(1200px, calc(100% - 96px)); height: 74px; margin: auto; display: flex; align-items: center; justify-content: space-between; }
.brand { display: flex; align-items: center; gap: 12px; font-size: 23px; font-weight: 800; }
.brand > span + span { display: inline-flex; align-items: center; }
.mark { display: grid; place-items: center; width: 39px; height: 39px; border-radius: 12px; background: var(--rose); color: #fff8f3; }
.mark svg { width: 22px; height: 22px; }
.brand-divider { width: 1px; height: 16px; margin: 0 11px 0 13px; background: #ded0c9; }
.brand-en { font-family: "DM Sans", Arial, sans-serif; font-size: 10px; font-weight: 700; letter-spacing: .17em; color: #735953; }
.top-action { display: flex; align-items: center; gap: 8px; padding: 9px 12px; background: none; border: 1px solid var(--line); border-radius: 9px; color: #654943; font-size: 13px; font-weight: 650; }
.top-action svg { width: 16px; height: 16px; }
.top-action .top-arrow { width: 14px; height: 14px; margin-left: 4px; }
.top-action:hover, .download[href]:hover { background: #f7efeb; }

.frame { width: min(1200px, calc(100% - 96px)); margin: 0 auto; padding: 42px 0 52px; }
.intro { margin-bottom: 30px; }
.intro h1 { font-family: "Hedvig Letters Serif", "Noto Serif SC", "Songti SC", SimSun, serif; font-size: clamp(33px, 3.7vw, 53px); font-weight: 700; letter-spacing: -.045em; line-height: 1.15; }
.title-dot { margin-left: 6px; color: #a76570; }
.intro p { color: var(--muted); margin-top: 13px; font-size: 15px; line-height: 1.65; }
.workspace { display: grid; grid-template-columns: minmax(306px, 341px) minmax(0, 1fr); gap: 24px; align-items: start; }
.panel { border: 1px solid var(--line); border-radius: 18px; background: var(--paper); box-shadow: 0 5px 22px #43251d06; }
.upload-panel { padding: 22px; }
.panel-head, .preview-head, .preview-footer { display: flex; justify-content: space-between; align-items: center; gap: 14px; }
h2 { font-size: 19px; line-height: 1.28; font-weight: 750; }
.count { font: 650 11px/1.2 "DM Sans", Arial, sans-serif; color: var(--rose); border-radius: 20px; background: #f5ece8; padding: 6px 10px; white-space: nowrap; }
.asset { margin-top: 22px; }
.asset + .asset { margin-top: 19px; }
.asset-title { display: block; color: #403431; margin-bottom: 8px; font-size: 13px; font-weight: 750; }
.drop { position: relative; min-height: 85px; display: flex; gap: 11px; align-items: center; border: 1px dashed #d9c5bd; border-radius: 12px; padding: 12px; background: #fbf7f4; transition: border-color .16s, background-color .16s; }
.drop:hover, .drop.drag { border-color: var(--rose); background: #f7ece9; }
.drop:focus-within { outline: 2px solid var(--rose); outline-offset: 3px; }
.drop input { cursor: pointer; z-index: 2; position: absolute; inset: 0; padding: 0; width: 100%; height: 100%; opacity: 0; }
.drop-icon { width: 42px; height: 42px; border-radius: 10px; display: grid; place-items: center; color: var(--rose); background: #f0e3de; flex: none; overflow: hidden; }
.drop-icon img { width: 100%; height: 100%; object-fit: cover; }
.drop-text { min-width: 0; flex: 1; }
.drop-text strong, .drop-text small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.drop-text strong { font-size: 12.5px; line-height: 1.6; font-weight: 750; }
.drop-text small { margin-top: 3px; font-size: 11px; line-height: 1.55; color: var(--muted); }
.drop-action { width: 16px; height: 16px; color: var(--rose); }
.file-error { margin-top: 6px; color: #9a3345; font-size: 12px; line-height: 1.5; }
.formats { margin: 13px 0 20px; color: var(--muted); font-size: 11px; }
.formats span { margin: 0 3px; }
.generate { width: 100%; min-height: 47px; border: 0; border-radius: 10px; color: white; background: var(--rose); display: flex; align-items: center; justify-content: center; gap: 9px; font-weight: 700; font-size: 14px; position: relative; }
.generate:hover:not(:disabled), .small-primary:hover:not(:disabled) { background: var(--rose-dark); }
.generate:disabled { background: #ead8d6; color: #6b4650; }
.generate svg { width: 16px; height: 16px; }
.generate .generate-arrow { position: absolute; right: 13px; }
.privacy { display: flex; align-items: flex-start; gap: 6px; margin-top: 13px; font-size: 11px; line-height: 1.65; color: var(--muted); }
.privacy svg { width: 13px; height: 13px; margin-top: 2px; }

.protection { margin-top: 15px; background: #f2eae4; border: 1px solid #eadfd8; border-radius: 14px; }
.protection summary { display: flex; padding: 13px 14px; align-items: center; gap: 11px; cursor: pointer; list-style: none; }
.protection summary::-webkit-details-marker { display: none; }
.shield { display: grid; place-items: center; background: #fff9f4; border: 1px solid #eadbd3; color: var(--rose); width: 36px; height: 36px; border-radius: 10px; flex: none; }
.shield svg { width: 18px; height: 18px; }
.protection strong, .protection small { display: block; }
.protection strong { font-size: 13px; margin-bottom: 4px; }
.protection small { font-size: 11px; color: #6e5a52; }
.chevron { margin-left: auto; margin-right: 3px; width: 7px; height: 7px; border-right: 1.5px solid #886f66; border-bottom: 1.5px solid #886f66; transform: rotate(45deg); }
.protection[open] .chevron { transform: rotate(225deg); }
.protection p { color: #63504a; padding: 0 14px 14px; font-size: 12px; line-height: 1.7; }

.preview-panel { min-width: 0; padding: 19px; }
.preview-head { padding: 0 1px 16px; }
.preview-head p { margin-top: 5px; color: var(--muted); font-size: 12px; line-height: 1.6; }
.view-toggle { display: inline-flex; align-items: center; gap: 2px; background: #f5efea; padding: 3px; border: 1px solid #eee4df; border-radius: 9px; flex: none; }
.view-toggle button { border-radius: 6px; background: transparent; color: #6b5954; padding: 6px 10px; border: 1px solid transparent; font-size: 12px; font-weight: 650; white-space: nowrap; }
.view-toggle button[aria-pressed="true"] { background: #fffdfa; color: var(--rose-dark); border-color: #eaded7; box-shadow: 0 1px 2px #3e231b0c; }
.view-toggle button:disabled { opacity: .5; }
.preview-stage { position: relative; isolation: isolate; width: 100%; border-radius: 12px; background: #f0e9e3; overflow: hidden; aspect-ratio: 1.58; min-height: 240px; --split: 65%; }
.photo-stack, .photo-stack img, .blank { position: absolute; inset: 0; width: 100%; height: 100%; }
.photo-stack img, .editor img { object-fit: contain; }
.demo .photo-stack img { object-fit: cover; object-position: 50% 17%; }
.preview-stage[data-view="compare"] #after { clip-path: inset(0 0 0 var(--split)); }
.blank { display: grid; place-content: center; justify-items: center; gap: 10px; color: #7b655c; font-size: 13px; padding: 10px; text-align: center; }
.blank svg { width: 27px; height: 27px; }
.photo-label { position: absolute; z-index: 2; top: 13px; padding: 7px 11px; border: 1px solid #ffffff85; border-radius: 8px; line-height: 1; background: #fffdfaee; color: #50403a; font-weight: 700; font-size: 11px; pointer-events: none; }
.before-label { left: 13px; }
.after-label { right: 13px; color: white; border-color: #ffffff40; background: #6c3d48eb; }
.compare-line { position: absolute; inset: 0 auto 0 var(--split); background: #fffdfa; width: 2px; transform: translateX(-50%); pointer-events: none; box-shadow: 0 0 4px #1e100d42; z-index: 2; }
.compare-line span { display: grid; place-items: center; position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); width: 39px; height: 39px; border-radius: 50%; color: var(--rose-dark); background: #fffdfa; box-shadow: 0 3px 10px #46262b35; }
.compare-range { cursor: ew-resize; position: absolute; z-index: 3; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; touch-action: pan-y; }
.preview-stage:has(.compare-range:focus-visible) { outline: 2px solid var(--rose); outline-offset: 3px; }
.stage-status { position: absolute; display: flex; align-items: center; gap: 10px; z-index: 4; bottom: 12px; left: 12px; right: 12px; width: max-content; max-width: calc(100% - 24px); margin: auto; border-radius: 9px; padding: 10px 13px; color: #63424a; background: #fffdfa; box-shadow: 0 2px 10px #43241d24; font-size: 12px; }
.spinner { width: 14px; height: 14px; border-radius: 50%; border: 1.5px solid #ecd8d9; border-top-color: var(--rose); animation: spin .85s linear infinite; flex: none; }
@keyframes spin { to { transform: rotate(360deg); } }

.preview-footer { min-height: 56px; padding: 13px 1px 0; }
.preview-meta, .footer-actions { display: flex; align-items: center; gap: 9px; min-width: 0; }
.preview-meta img { width: 37px; height: 37px; object-fit: cover; object-position: center; border: 1px solid #eadad2; border-radius: 7px; }
.preview-meta strong, .preview-meta small { display: block; }
.preview-meta strong { font-size: 12px; }
.preview-meta small, #result-details { color: var(--muted); font-size: 11px; }
.preview-meta small { margin-top: 3px; }
.download, .text-button, .small-primary { display: inline-flex; align-items: center; justify-content: center; gap: 7px; border-radius: 8px; padding: 8px 10px; font-size: 12px; font-weight: 700; white-space: nowrap; }
.download { border: 1px solid #e8d8d1; color: var(--rose-dark); }
.download[aria-disabled="true"] { opacity: .55; }
.download svg, .text-button svg { width: 15px; height: 15px; }
.text-button { color: var(--rose-dark); border: 1px solid transparent; background: transparent; }
.text-button:hover:not(:disabled) { background: var(--rose-pale); }
.text-button:disabled { opacity: .45; }
.small-primary { border: 1px solid var(--rose); background: var(--rose); color: white; }
.small-primary:disabled { background: #ead8d6; color: #68434b; border-color: #ead8d6; }

.editor { position: absolute; inset: 0; z-index: 5; display: grid; place-items: center; background: #eee5df; }
.editor-image { position: relative; height: 100%; max-width: 100%; aspect-ratio: var(--editor-ratio, 1); }
.editor img { display: block; width: 100%; height: 100%; }
.editor canvas { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); touch-action: none; cursor: crosshair; }
.editor-controls { padding: 12px 2px 0; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; }
.editor-tip { display: flex; align-items: center; gap: 10px; }
.editor-tip svg { color: var(--rose); width: 17px; height: 17px; }
.editor-tip strong, .editor-tip span { display: block; }
.editor-tip strong { font-size: 12px; margin-bottom: 4px; }
.editor-tip span { font-size: 11px; color: var(--muted); }
.editor-actions { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.message { margin-top: 16px; border-radius: 10px; padding: 12px 14px; border: 1px solid #e7cfcf; background: #f9eeec; color: #793844; font-size: 13px; line-height: 1.6; }

@media (max-width: 1000px) {
  .topbar-inner, .frame { width: calc(100% - 48px); }
  .workspace { gap: 16px; grid-template-columns: 294px minmax(0, 1fr); }
  .upload-panel, .preview-panel { padding: 16px; }
  .preview-stage { min-height: 290px; }
}
@media (max-width: 740px) {
  .topbar-inner, .frame { width: calc(100% - 32px); }
  .topbar-inner { height: 62px; }
  .frame { padding-top: 27px; }
  .intro { margin-bottom: 20px; }
  .intro p { font-size: 13px; }
  .workspace { grid-template-columns: minmax(0, 1fr); }
  .preview-stage { min-height: 220px; }
  .drop { min-height: 71px; }
  .top-action .top-arrow { display: none; }
}
@media (max-width: 365px) {
  .topbar-inner, .frame { width: calc(100% - 22px); }
  .brand-en, .brand-divider { display: none; }
  .view-toggle button { padding-inline: 7px; }
  .footer-actions { gap: 2px; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: 1ms !important; transition-duration: 1ms !important; } }
