:root {
  --bg: #f4f5f1;
  --panel: #ffffff;
  --ink: #171a17;
  --text: #343832;
  --muted: #8a8f86;
  --line: #e7e9e3;
  --soft: #f7f8f5;
  --accent: #c9f46a;
  --accent-dark: #5e7d23;
  --accent-soft: #f0f9df;
  --sidebar: 218px;
  --radius: 18px;
  --shadow: 0 10px 35px rgba(28, 35, 24, .045);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; color: var(--ink); background: var(--bg); font-family: Inter, "SF Pro Display", "PingFang SC", "Microsoft YaHei", sans-serif; font-size: 14px; -webkit-font-smoothing: antialiased; }
button, input { font: inherit; }
button { color: inherit; cursor: pointer; }
button, a { -webkit-tap-highlight-color: transparent; }
button:focus-visible, a:focus-visible, [tabindex]:focus-visible { outline: 3px solid rgba(148, 196, 59, .35); outline-offset: 2px; }
button { border: 0; background: none; }
a { color: inherit; text-decoration: none; }
img { display: block; width: 100%; }
svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.svg-defs { position: absolute; width: 0; height: 0; overflow: hidden; }
.hidden { display: none !important; }

.app-shell { min-height: 100vh; }
.sidebar { position: fixed; inset: 0 auto 0 0; z-index: 30; width: var(--sidebar); padding: 28px 16px 18px; display: flex; flex-direction: column; background: #fbfcf9; border-right: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 11px; padding: 0 10px; }
.brand-mark { width: 37px; height: 37px; display: grid; place-items: center; background: var(--ink); color: var(--accent); border-radius: 11px; transform: rotate(-3deg); }
.brand-mark svg { width: 22px; height: 22px; stroke-width: 1.6; }
.brand-name { font-size: 20px; font-weight: 800; letter-spacing: 2px; line-height: 1.05; }
.brand-name > span { display: block; margin-top: 5px; color: #7b8077; font-size: 8px; font-weight: 700; letter-spacing: 3.5px; }
.side-nav { margin-top: 43px; }
.nav-caption { margin: 0 12px 12px; color: #a0a59c; font-size: 10px; font-weight: 700; letter-spacing: 1.5px; }
.nav-caption.second { margin-top: 29px; }
.nav-item { width: 100%; height: 44px; padding: 0 13px; margin: 4px 0; display: flex; align-items: center; gap: 12px; border-radius: 11px; color: #666c63; text-align: left; font-size: 13px; font-weight: 500; transition: .2s ease; }
.nav-item svg { width: 18px; height: 18px; }
.nav-item:hover { color: var(--ink); background: #f0f2ec; }
.nav-item.active { color: var(--ink); background: #eaf2dd; font-weight: 700; }
.nav-item.active svg { color: #526f21; }
.nav-item.active i { width: 5px; height: 5px; margin-left: auto; background: #789d36; border-radius: 50%; }
.nav-item em { margin-left: auto; min-width: 23px; padding: 2px 6px; border-radius: 20px; color: #858b81; background: #eceee8; font-size: 10px; font-style: normal; text-align: center; }
.sidebar-bottom { margin-top: auto; }
.pro-card { position: relative; overflow: hidden; margin: 0 2px 19px; padding: 17px 15px 15px; color: #f7faef; background: #20251e; border-radius: 15px; }
.pro-icon { position: relative; z-index: 1; width: 29px; height: 29px; display: grid; place-items: center; margin-bottom: 14px; color: #243011; background: var(--accent); border-radius: 9px; }
.pro-icon svg { width: 15px; height: 15px; fill: currentColor; stroke: none; }
.pro-card strong { position: relative; z-index: 1; font-size: 13px; letter-spacing: .3px; }
.pro-card p { position: relative; z-index: 1; max-width: 145px; margin: 8px 0 13px; color: #aeb6a8; font-size: 10px; line-height: 1.7; }
.pro-card button { position: relative; z-index: 1; display: flex; align-items: center; gap: 6px; padding: 0; color: var(--accent); font-size: 10px; }
.pro-card button svg { width: 13px; height: 13px; }
.pro-orbit { position: absolute; border: 1px solid rgba(201, 244, 106, .11); border-radius: 50%; }
.orbit-one { width: 145px; height: 145px; right: -81px; top: -47px; }
.orbit-two { width: 102px; height: 102px; right: -45px; top: -26px; }
.account { display: flex; align-items: center; gap: 10px; padding: 13px 8px 0; border-top: 1px solid var(--line); }
.avatar { width: 34px; height: 34px; display: grid; place-items: center; flex: 0 0 auto; color: #424a39; background: #e4e9dc; border-radius: 50%; font-size: 12px; font-weight: 700; }
.account strong, .account span { display: block; }
.account strong { font-size: 12px; }
.account span { margin-top: 3px; color: var(--muted); font-size: 9px; }
.account button { margin-left: auto; padding: 5px 0 5px 5px; color: #92978e; letter-spacing: 1px; }

.main-shell { min-height: 100vh; margin-left: var(--sidebar); }
.topbar { height: 66px; padding: 0 30px; display: flex; align-items: center; justify-content: space-between; background: rgba(251, 252, 249, .78); border-bottom: 1px solid var(--line); backdrop-filter: blur(12px); }
.topbar-left { display: flex; align-items: center; gap: 10px; color: #92978e; font-size: 11px; }
.topbar-left b { color: #c4c8c0; font-weight: 400; }
.topbar-left strong { color: #545a50; font-weight: 600; }
.topbar-actions { display: flex; align-items: center; gap: 10px; }
.demo-badge { display: inline-flex; align-items: center; gap: 6px; margin-right: 7px; color: #81877c; font-size: 10px; }
.demo-badge i { width: 5px; height: 5px; background: #8ca959; border-radius: 50%; box-shadow: 0 0 0 3px #eef2e8; }
.points-pill { height: 33px; padding: 0 12px; display: flex; align-items: center; gap: 5px; background: #fff; border: 1px solid var(--line); border-radius: 9px; }
.points-pill svg { width: 14px; height: 14px; margin-right: 2px; color: #739238; fill: #d6efad; stroke: #739238; }
.points-pill strong { font-size: 12px; }
.points-pill span { color: var(--muted); font-size: 10px; }
.recharge-btn { height: 33px; padding: 0 15px; color: #f8faF4; background: var(--ink); border-radius: 9px; font-size: 11px; font-weight: 600; }
.mobile-menu { display: none !important; }
.main-content { max-width: 1570px; margin: 0 auto; padding: 27px 30px 45px; }
.page-heading { display: flex; align-items: flex-end; justify-content: space-between; margin-bottom: 24px; }
.eyebrow { margin-bottom: 7px; color: #8b9185; font-size: 9px; font-weight: 700; letter-spacing: 2.5px; }
.page-heading h1 { margin: 0; font-size: clamp(25px, 2.2vw, 34px); font-weight: 750; letter-spacing: -1.1px; line-height: 1.25; }
.title-dot { color: #8ead52; }
.page-heading p { margin: 8px 0 0; color: #858b81; font-size: 12px; }
.text-button { display: inline-flex; align-items: center; gap: 7px; color: #6f756a; font-size: 11px; }
.text-button svg { width: 16px; height: 16px; }
.guide-button { margin-bottom: 4px; padding: 7px 0 7px 10px; }
.guide-button:hover { color: var(--ink); }

.studio-layout { display: grid; grid-template-columns: minmax(380px, 420px) minmax(460px, 1fr); gap: 18px; align-items: stretch; }
.control-panel, .result-panel { background: var(--panel); border: 1px solid rgba(226, 229, 221, .85); border-radius: var(--radius); box-shadow: var(--shadow); }
.control-panel { min-width: 0; padding: 20px 21px 17px; }
.panel-title, .result-header { display: flex; align-items: center; justify-content: space-between; }
.panel-title { margin-bottom: 19px; }
.panel-title h2, .result-header h2 { margin: 0; font-size: 14px; font-weight: 700; }
.panel-title button { display: flex; align-items: center; gap: 5px; padding: 3px; color: #92988d; font-size: 10px; }
.panel-title button:hover { color: var(--ink); }
.panel-title button svg { width: 12px; height: 12px; }
.form-section { padding-bottom: 17px; margin-bottom: 17px; border-bottom: 1px solid var(--line); }
.section-heading { min-height: 21px; display: flex; align-items: center; justify-content: space-between; margin-bottom: 11px; }
.section-heading > div { display: flex; align-items: center; }
.step-number { margin-right: 8px; color: #9ba18f; font-family: Georgia, serif; font-size: 10px; font-style: italic; }
.section-heading h3 { margin: 0; font-size: 12px; font-weight: 700; }
.required { margin-left: 7px; padding: 2px 5px; color: #8c967c; background: #f3f5ee; border-radius: 4px; font-size: 8px; }
.section-tip { color: #afb3ab; font-size: 8px; letter-spacing: .4px; }
.upload-card { position: relative; min-height: 91px; padding: 9px 34px 9px 9px; display: flex; align-items: center; gap: 13px; background: #f7f8f5; border: 1px solid #e6e9e1; border-radius: 12px; }
.garment-thumb { width: 67px; height: 72px; flex: 0 0 auto; overflow: hidden; background: #eeeee9; border-radius: 8px; }
.garment-thumb img { height: 100%; object-fit: cover; object-position: center 37%; }
.garment-details { min-width: 0; }
.garment-details strong { display: block; overflow: hidden; margin-bottom: 5px; font-size: 11px; font-weight: 650; text-overflow: ellipsis; white-space: nowrap; }
.garment-details > span { display: block; color: #989e94; font-size: 9px; }
.garment-details button { display: flex; align-items: center; gap: 5px; margin-top: 10px; padding: 0; color: #69765a; font-size: 9px; font-weight: 600; }
.garment-details button svg { width: 12px; height: 12px; }
.remove-garment { position: absolute; top: 9px; right: 8px; padding: 5px; color: #a6aba2; border-radius: 6px; }
.remove-garment:hover { color: #5c6357; background: #eceee8; }
.remove-garment svg { width: 13px; height: 13px; display: block; }
.upload-empty { min-height: 106px; display: flex; flex-direction: column; align-items: center; justify-content: center; border: 1px dashed #cfd5c8; border-radius: 12px; background: #fafbf8; transition: .2s; }
.upload-empty:hover, .upload-empty.dragging { background: #f2f8e8; border-color: #9db576; }
.upload-empty > span { color: #7f8c6e; }
.upload-empty svg { width: 21px; height: 21px; }
.upload-empty strong { margin-top: 5px; font-size: 10px; }
.upload-empty p { margin: 4px 0 0; color: var(--muted); font-size: 9px; }
.field-help { display: flex; align-items: center; gap: 5px; margin: 8px 0 0; color: #9ba096; font-size: 9px; }
.field-help > span { width: 12px; height: 12px; display: inline-grid; place-items: center; border: 1px solid #b8bdb3; border-radius: 50%; font-family: serif; font-size: 8px; }
.section-link { display: flex; align-items: center; gap: 2px; padding: 0; color: #92988d; font-size: 9px; }
.section-link svg { width: 12px; height: 12px; }
.filter-chips { display: flex; gap: 6px; margin-bottom: 10px; }
.filter-chips button { padding: 5px 12px; color: #8c9287; background: #f6f7f4; border: 1px solid transparent; border-radius: 7px; font-size: 9px; }
.filter-chips button.active { color: #3f4c31; background: var(--accent-soft); border-color: #dfebcf; font-weight: 650; }
.template-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 9px; }
.template-card { min-width: 0; padding: 0; text-align: left; border-radius: 10px; }
.template-image { position: relative; height: 115px; overflow: hidden; background: #ebece7; border: 2px solid transparent; border-radius: 10px; transition: .2s; }
.template-image::after { content: ""; position: absolute; inset: 55% 0 0; background: linear-gradient(transparent, rgba(20, 24, 18, .12)); pointer-events: none; }
.template-image img { height: 100%; object-fit: cover; object-position: center 24%; transition: transform .35s; }
.template-card:hover img { transform: scale(1.035); }
.template-card.selected .template-image { border-color: #8ba34f; box-shadow: 0 0 0 2px #eef5e2; }
.select-check { position: absolute; z-index: 2; right: 6px; top: 6px; width: 18px; height: 18px; display: none; place-items: center; color: #263214; background: var(--accent); border: 2px solid #fff; border-radius: 50%; }
.select-check svg { width: 10px; height: 10px; stroke-width: 2.5; }
.template-card.selected .select-check { display: grid; }
.template-image > i { position: absolute; z-index: 2; left: 6px; bottom: 6px; padding: 2px 5px; color: #fff; background: rgba(24, 28, 22, .68); border-radius: 4px; font-size: 7px; font-style: normal; backdrop-filter: blur(4px); }
.template-image > i.new { color: #29361a; background: var(--accent); }
.template-card > strong, .template-card > span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.template-card > strong { margin: 7px 0 2px 2px; font-size: 10px; font-weight: 650; }
.template-card > span { margin-left: 2px; color: #999f94; font-size: 8px; }
.template-card.filtered-out { display: none; }
.preference-section { padding-bottom: 14px; margin-bottom: 13px; }
.preference-row { display: grid; grid-template-columns: 1.35fr 1fr; gap: 15px; }
.preference-item > label { display: block; margin-bottom: 7px; color: #90968b; font-size: 9px; }
.ratio-options { display: flex; padding: 3px; background: #f5f6f3; border-radius: 8px; }
.ratio-options button { flex: 1; padding: 5px 8px; color: #8f958a; border-radius: 6px; font-size: 9px; }
.ratio-options button.active { color: #333a2d; background: #fff; box-shadow: 0 1px 5px rgba(30, 38, 25, .08); font-weight: 650; }
.quantity-control { height: 30px; display: flex; align-items: center; justify-content: space-between; padding: 3px; background: #f5f6f3; border-radius: 8px; }
.quantity-control button { width: 25px; height: 24px; display: grid; place-items: center; color: #7e8578; background: #fff; border-radius: 6px; }
.quantity-control button:disabled { opacity: .4; cursor: not-allowed; }
.quantity-control svg { width: 11px; height: 11px; }
.quantity-control strong { font-size: 10px; }
.hd-row { display: flex; align-items: center; justify-content: space-between; margin-top: 12px; }
.hd-row strong, .hd-row span { display: block; }
.hd-row strong { font-size: 10px; font-weight: 600; }
.hd-row span { margin-top: 3px; color: #a0a59b; font-size: 8px; }
.switch { width: 31px; height: 18px; padding: 2px; background: #dfe3db; border-radius: 20px; transition: .2s; }
.switch i { display: block; width: 14px; height: 14px; background: #fff; border-radius: 50%; box-shadow: 0 1px 3px rgba(0,0,0,.12); transition: .2s; }
.switch.on { background: #8ba452; }
.switch.on i { transform: translateX(13px); }
.generate-area { margin-top: auto; }
.cost-line { display: flex; align-items: center; justify-content: space-between; margin-bottom: 9px; color: #969c91; font-size: 9px; }
.cost-line strong { color: #4b5540; font-size: 11px; }
.cost-line i { margin: 0 4px; color: #c3c7bf; font-style: normal; }
.generate-button { width: 100%; height: 43px; padding: 0 12px 0 16px; display: flex; align-items: center; justify-content: center; gap: 8px; color: #f9fbf5; background: #1d211b; border-radius: 11px; box-shadow: 0 6px 15px rgba(28, 34, 24, .12); font-size: 12px; font-weight: 650; transition: transform .18s, background .18s; }
.generate-button:hover { background: #2c3327; transform: translateY(-1px); }
.generate-button:active { transform: translateY(0); }
.generate-button:disabled { cursor: wait; opacity: .72; transform: none; }
.generate-button > svg { width: 16px; height: 16px; color: var(--accent); }
.generate-button > b { min-width: 36px; height: 23px; margin-left: auto; display: flex; align-items: center; justify-content: center; gap: 2px; color: #253015; background: var(--accent); border-radius: 7px; font-size: 10px; }
.generate-button > b svg { width: 11px; height: 11px; fill: currentColor; stroke: none; }
.generate-button > b i { font-style: normal; }
.generate-button > span { margin-left: auto; }
.generate-area > p { margin: 8px 0 0; color: #b0b5ac; font-size: 8px; text-align: center; }
.generate-area > p a { color: #939a8d; }

.result-panel { min-width: 0; padding: 20px; display: flex; flex-direction: column; }
.result-header { margin-bottom: 15px; }
.result-header > div { display: flex; align-items: center; gap: 10px; }
.result-status { display: inline-flex; align-items: center; gap: 5px; padding: 3px 7px; color: #728354; background: #f0f5e7; border-radius: 5px; font-size: 8px; }
.result-status i { width: 4px; height: 4px; background: #819b51; border-radius: 50%; }
.result-status.generating { color: #8a7348; background: #f8f2e6; }
.result-status.generating i { background: #c89d4b; animation: pulse 1s infinite; }
.result-actions { gap: 7px !important; }
.result-actions > button { height: 31px; display: flex; align-items: center; justify-content: center; gap: 6px; color: #656c60; background: #fff; border: 1px solid var(--line); border-radius: 8px; font-size: 9px; }
.result-actions > button:first-child { padding: 0 10px; }
.result-actions svg { width: 13px; height: 13px; }
.icon-button { width: 32px; padding: 0; }
.result-stage { position: relative; min-height: 565px; padding: 38px 20px 67px; display: flex; align-items: center; justify-content: center; flex: 1; overflow: hidden; background: #eff0eb; border-radius: 13px; }
.result-stage::before { content: ""; position: absolute; inset: 0; opacity: .35; background-image: radial-gradient(#c3c7bc .65px, transparent .65px); background-size: 14px 14px; pointer-events: none; }
.stage-top { position: absolute; z-index: 3; top: 14px; left: 16px; right: 16px; display: flex; justify-content: space-between; color: #8a9084; font-size: 8px; font-weight: 650; letter-spacing: 1.5px; }
.stage-top b { font-weight: 650; }
.result-image-frame { position: relative; height: 458px; max-width: 100%; overflow: hidden; background: #e3e1dc; border-radius: 7px; box-shadow: 0 13px 30px rgba(39, 42, 34, .12); transition: width .25s, height .25s; }
.result-image-frame.ratio-34 { aspect-ratio: 3 / 4; }
.result-image-frame.ratio-11 { aspect-ratio: 1 / 1; height: 425px; }
.result-image-frame.ratio-916 { aspect-ratio: 9 / 16; height: 475px; }
.result-image-frame > img { height: 100%; object-fit: cover; object-position: center 43%; }
.result-image-frame.ratio-34 > img { object-position: center 44%; }
.result-image-frame.ratio-11 > img { object-position: center 32%; }
.ai-label { position: absolute; left: 10px; bottom: 10px; display: flex; align-items: center; gap: 4px; padding: 5px 7px; color: #fff; background: rgba(26, 30, 23, .5); border: 1px solid rgba(255,255,255,.24); border-radius: 5px; font-size: 7px; backdrop-filter: blur(8px); }
.ai-label svg { width: 10px; height: 10px; }
.compare-label { position: absolute; left: 10px; top: 10px; padding: 5px 8px; color: #fff; background: rgba(20,25,18,.65); border-radius: 5px; font-size: 8px; }
.stage-bottom { position: absolute; z-index: 3; left: 17px; right: 17px; bottom: 14px; display: flex; align-items: center; justify-content: space-between; }
.stage-bottom strong, .stage-bottom span { display: block; }
.stage-bottom strong { margin-bottom: 4px; font-size: 10px; font-weight: 650; }
.stage-bottom > div > span { color: #8e9488; font-size: 8px; }
.stage-bottom button { display: flex; align-items: center; gap: 5px; padding: 7px 9px; color: #6d7565; background: rgba(255,255,255,.7); border: 1px solid rgba(218,222,212,.9); border-radius: 7px; font-size: 8px; backdrop-filter: blur(6px); }
.stage-bottom button.active { color: #2e3c1d; background: #e6f1d2; border-color: #cbdcaf; }
.stage-bottom svg { width: 12px; height: 12px; }
.result-footnote { display: flex; align-items: center; justify-content: space-between; margin-top: 12px; color: #969c90; font-size: 8px; }
.result-footnote > span:first-child { display: flex; align-items: center; gap: 5px; }
.result-footnote svg { width: 12px; height: 12px; color: #8c9e6b; }
.result-footnote b { font-weight: 500; }
.generating-overlay { position: absolute; inset: 0; z-index: 5; display: grid; place-items: center; overflow: hidden; background: rgba(28, 32, 25, .55); backdrop-filter: blur(5px); }
.scan-line { position: absolute; left: 0; right: 0; height: 1px; top: 15%; background: var(--accent); box-shadow: 0 0 18px 3px rgba(201,244,106,.45); animation: scan 2.4s ease-in-out infinite; }
.generating-card { position: relative; z-index: 2; width: 210px; padding: 22px; color: #fff; background: rgba(25, 29, 23, .87); border: 1px solid rgba(255,255,255,.13); border-radius: 14px; text-align: center; backdrop-filter: blur(15px); }
.loading-mark { width: 38px; height: 38px; margin: 0 auto 12px; display: grid; place-items: center; color: #273217; background: var(--accent); border-radius: 12px; animation: breathe 1.4s ease-in-out infinite; }
.loading-mark svg { width: 20px; height: 20px; }
.generating-card strong { font-size: 11px; }
.generating-card p { margin: 6px 0 15px; color: #aeb5a8; font-size: 8px; }
.progress-track { height: 3px; overflow: hidden; background: #464c41; border-radius: 5px; }
.progress-track i { display: block; width: 0; height: 100%; background: var(--accent); border-radius: 5px; transition: width .2s; }
.generating-card > span:last-child { display: block; margin-top: 7px; color: #d9e2ce; font-size: 8px; text-align: right; }

.recent-section { margin-top: 25px; }
.recent-heading { display: flex; align-items: center; justify-content: space-between; margin-bottom: 13px; }
.recent-heading > div { display: flex; align-items: baseline; gap: 12px; }
.recent-heading h2 { margin: 0; font-size: 14px; }
.recent-heading span { color: #9ba095; font-size: 9px; }
.recent-heading > button { display: flex; align-items: center; gap: 5px; color: #7f8678; font-size: 9px; }
.recent-heading svg { width: 13px; height: 13px; }
.history-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 13px; }
.history-card { position: relative; min-width: 0; padding: 9px; display: grid; grid-template-columns: 54px 1fr 25px; align-items: center; gap: 11px; background: rgba(255,255,255,.72); border: 1px solid var(--line); border-radius: 12px; text-align: left; transition: .2s; }
.history-card:hover { background: #fff; transform: translateY(-2px); box-shadow: var(--shadow); }
.history-image { position: relative; width: 54px; height: 59px; overflow: hidden; border-radius: 7px; }
.history-image img { height: 100%; object-fit: cover; object-position: center 25%; }
.history-image > span { position: absolute; left: 3px; right: 3px; bottom: 3px; overflow: hidden; padding: 2px; color: #fff; background: rgba(25,30,22,.55); border-radius: 3px; font-size: 6px; text-align: center; white-space: nowrap; }
.history-card > div:nth-child(2) { min-width: 0; }
.history-card strong, .history-card > div > span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.history-card strong { font-size: 10px; }
.history-card > div > span { margin-top: 5px; color: #979d92; font-size: 8px; }
.history-card > i { width: 25px; height: 25px; display: grid; place-items: center; color: #939a8e; background: #f2f4ef; border-radius: 7px; }
.history-card > i svg { width: 12px; height: 12px; }

.toast { position: fixed; z-index: 100; left: 50%; bottom: 30px; min-width: 230px; max-width: calc(100vw - 30px); padding: 12px 17px; display: flex; align-items: center; gap: 10px; color: #f7faf2; background: rgba(28, 33, 25, .94); border: 1px solid rgba(255,255,255,.09); border-radius: 11px; box-shadow: 0 12px 35px rgba(0,0,0,.18); opacity: 0; pointer-events: none; transform: translate(-50%, 15px); transition: .25s; backdrop-filter: blur(10px); }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast > span { width: 22px; height: 22px; display: grid; place-items: center; flex: 0 0 auto; color: #283317; background: var(--accent); border-radius: 50%; }
.toast svg { width: 12px; height: 12px; stroke-width: 2.3; }
.toast p { margin: 0; font-size: 11px; }
.modal-backdrop { position: fixed; inset: 0; z-index: 80; padding: 24px; display: grid; place-items: center; background: rgba(17, 21, 15, .65); backdrop-filter: blur(8px); animation: fadeIn .2s; }
.preview-modal { position: relative; max-width: 92vw; max-height: 92vh; overflow: hidden; background: #242921; border-radius: 15px; box-shadow: 0 25px 80px rgba(0,0,0,.35); }
.preview-modal > img { width: auto; max-width: 90vw; height: auto; max-height: 80vh; object-fit: contain; }
.preview-modal > div { padding: 12px 16px; display: flex; align-items: center; justify-content: space-between; color: #dbe1d4; font-size: 10px; }
.preview-modal > div button { display: flex; align-items: center; gap: 6px; color: var(--accent); font-size: 10px; }
.preview-modal > div svg { width: 14px; height: 14px; }
.modal-close { position: absolute; z-index: 4; right: 13px; top: 13px; width: 30px; height: 30px; display: grid; place-items: center; color: #777f70; background: rgba(244,246,240,.9); border-radius: 50%; }
.modal-close svg { width: 15px; height: 15px; }
.dialog { position: relative; width: min(570px, 100%); padding: 33px; background: #fbfcf9; border-radius: 20px; box-shadow: 0 25px 80px rgba(0,0,0,.25); text-align: center; }
.dialog-icon { width: 42px; height: 42px; margin: 0 auto 13px; display: grid; place-items: center; color: #35421f; background: var(--accent); border-radius: 12px; }
.dialog-icon svg { width: 21px; height: 21px; }
.dialog-eyebrow { margin: 0 0 8px; color: #95a083; font-size: 8px; font-weight: 700; letter-spacing: 2px; }
.dialog h2 { margin: 0; font-size: 23px; letter-spacing: -.5px; }
.dialog-desc { margin: 9px 0 23px; color: #8e9587; font-size: 11px; }
.plan-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.plan-card { position: relative; padding: 21px 8px 17px; background: #fff; border: 1px solid var(--line); border-radius: 12px; }
.plan-card.selected { background: #f2f8e7; border-color: #9ab66b; box-shadow: 0 0 0 2px #e7f1d8; }
.plan-card > i { position: absolute; top: -8px; left: 50%; padding: 3px 7px; color: #293619; background: var(--accent); border-radius: 10px; font-size: 7px; font-style: normal; white-space: nowrap; transform: translateX(-50%); }
.plan-card strong, .plan-card span, .plan-card b { display: block; }
.plan-card strong { font-size: 25px; }
.plan-card strong small { margin-left: 3px; color: #7d8574; font-size: 9px; font-weight: 500; }
.plan-card span { margin: 5px 0 14px; color: #939a8d; font-size: 9px; }
.plan-card b { font-size: 12px; }
.dialog-primary { width: 100%; height: 42px; margin-top: 22px; color: #f8faf4; background: var(--ink); border-radius: 10px; font-size: 11px; font-weight: 650; }
.demo-note { margin: 9px 0 -6px; color: #a5aa9f; font-size: 8px; }
.guide-dialog { max-width: 480px; text-align: left; }
.guide-dialog > h2 { text-align: center; }
.guide-dialog > .dialog-eyebrow { text-align: center; }
.guide-list { margin-top: 25px; }
.guide-list > div { display: flex; gap: 15px; padding: 15px 0; border-bottom: 1px solid var(--line); }
.guide-list > div:last-child { border-bottom: 0; }
.guide-list > div > span { width: 30px; height: 30px; display: grid; place-items: center; flex: 0 0 auto; color: #4f6430; background: #ebf3dd; border-radius: 9px; font-family: Georgia, serif; font-size: 11px; font-style: italic; }
.guide-list strong { font-size: 12px; }
.guide-list p { margin: 5px 0 0; color: #8c9386; font-size: 10px; line-height: 1.7; }
.sidebar-scrim { display: none; }

.auth-entry { color: var(--ink); border: 1px solid var(--line); background: #fff; }
.admin-link { position: relative; z-index: 1; display: inline-block; margin-top: 8px; color: #d8ef9b; font-size: 9px; text-decoration: underline; text-underline-offset: 3px; }
.account button { width: 34px; height: 24px; flex: 0 0 auto; color: #899083; background: #f0f2ec; border-radius: 7px; font-size: 8px; }
.account button:hover { color: var(--ink); background: var(--accent); }
.template-loading,
.history-empty { grid-column: 1 / -1; min-height: 96px; display: grid; place-items: center; color: #9aa193; background: #fafbf7; border: 1px dashed #dde1d8; border-radius: 11px; font-size: 10px; }
.history-empty { min-height: 88px; }
button:disabled { cursor: not-allowed; }
.result-actions button:disabled, #compareBtn:disabled { opacity: .42; }
.auth-dialog { max-width: 430px; text-align: left; }
.auth-dialog > .dialog-icon, .auth-dialog > h2, .auth-dialog > .dialog-eyebrow, .auth-dialog > .dialog-desc { text-align: center; }
.auth-dialog > .dialog-icon { margin-left: auto; margin-right: auto; }
.auth-form { margin-top: 22px; }
.auth-form label { display: block; margin-bottom: 13px; color: #4c5447; font-size: 10px; font-weight: 650; }
.auth-form input { width: 100%; height: 43px; margin-top: 7px; padding: 0 13px; color: var(--ink); background: #fff; border: 1px solid #dfe3da; border-radius: 9px; font-size: 12px; outline: none; transition: border-color .2s, box-shadow .2s; }
.auth-form input:focus { border-color: #a7c87c; box-shadow: 0 0 0 3px #eef6df; }
.auth-error { margin: 2px 0 0; padding: 8px 10px; color: #a34545; background: #fff2f0; border: 1px solid #f0d6d2; border-radius: 7px; font-size: 9px; }
.auth-switch { width: 100%; margin-top: 12px; color: #77806e; font-size: 9px; text-align: center; }
.auth-switch:hover { color: var(--ink); }

@keyframes scan { 0%,100% { top: 12%; opacity: .2; } 50% { top: 88%; opacity: 1; } }
@keyframes breathe { 0%,100% { transform: scale(1); } 50% { transform: scale(1.08); } }
@keyframes pulse { 50% { opacity: .3; } }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

@media (min-width: 1500px) {
  :root { --sidebar: 232px; }
  .main-content { padding-left: 36px; padding-right: 36px; }
  .studio-layout { grid-template-columns: 440px 1fr; gap: 22px; }
  .control-panel { padding: 23px; }
  .result-stage { min-height: 590px; }
  .result-image-frame { height: 485px; }
  .template-image { height: 126px; }
}

@media (max-width: 1120px) {
  :root { --sidebar: 190px; }
  .sidebar { padding-left: 12px; padding-right: 12px; }
  .main-content, .topbar { padding-left: 22px; padding-right: 22px; }
  .studio-layout { grid-template-columns: minmax(345px, 390px) minmax(390px, 1fr); }
  .control-panel { padding: 18px; }
  .result-panel { padding: 17px; }
  .result-stage { padding-left: 12px; padding-right: 12px; }
  .pro-card { padding-left: 13px; }
  .history-card { grid-template-columns: 48px 1fr; }
  .history-card > i { display: none; }
  .history-image { width: 48px; }
}

@media (max-width: 930px) {
  :root { --sidebar: 0px; }
  .sidebar { width: 218px; transform: translateX(-100%); transition: transform .25s; }
  .sidebar.open { transform: translateX(0); }
  .sidebar-scrim { position: fixed; inset: 0; z-index: 25; background: rgba(20,25,17,.4); }
  .sidebar-scrim.show { display: block; }
  .mobile-menu { display: grid !important; margin-right: 3px; }
  .studio-layout { grid-template-columns: minmax(340px, 390px) minmax(360px, 1fr); }
}

@media (max-width: 780px) {
  .main-content { padding-top: 22px; }
  .studio-layout { grid-template-columns: 1fr; }
  .control-panel, .result-panel { padding: 20px; }
  .template-image { height: 165px; }
  .result-stage { min-height: 560px; }
  .history-grid { grid-template-columns: 1fr; }
  .history-card { grid-template-columns: 54px 1fr 25px; }
  .history-card > i { display: grid; }
  .history-image { width: 54px; }
  .page-heading { align-items: flex-start; }
  .guide-button { margin-top: 24px; white-space: nowrap; }
}

@media (max-width: 540px) {
  .topbar { height: 60px; padding: 0 15px; }
  .topbar-left > span, .topbar-left > b { display: none; }
  .topbar-left { gap: 4px; }
  .demo-badge { display: none; }
  .topbar-actions { gap: 7px; }
  .points-pill { padding: 0 9px; }
  .recharge-btn { padding: 0 11px; }
  .main-content { padding: 20px 14px 35px; }
  .page-heading { display: block; margin-bottom: 19px; }
  .page-heading h1 { font-size: 27px; }
  .page-heading p { font-size: 11px; line-height: 1.7; }
  .guide-button { margin: 10px 0 0; padding-left: 0; }
  .control-panel, .result-panel { padding: 17px; border-radius: 15px; }
  .template-image { height: 125px; }
  .section-tip { display: none; }
  .preference-row { gap: 10px; }
  .result-panel { margin-top: 1px; }
  .result-actions > button:first-child { width: 31px; padding: 0; }
  .result-actions > button:first-child span { display: none; }
  .result-stage { min-height: 475px; padding: 38px 9px 70px; }
  .result-image-frame { height: 380px; }
  .result-image-frame.ratio-11 { height: auto; width: 88%; }
  .result-image-frame.ratio-916 { height: 395px; }
  .result-footnote > span:first-child { max-width: 190px; }
  .recent-heading > div > span { display: none; }
  .history-card { grid-template-columns: 54px 1fr; }
  .history-card > i { display: none; }
  .dialog { padding: 29px 18px 24px; }
  .dialog h2 { font-size: 20px; }
  .plan-grid { gap: 7px; }
  .plan-card { padding-left: 4px; padding-right: 4px; }
  .modal-backdrop { padding: 14px; }
}

/* ---------------- 智能适配 / 场景选择 ---------------- */
.auto-card {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 9px 11px;
  text-align: left;
  border: 1px solid #e3ebd3;
  border-radius: 11px;
  background: linear-gradient(102deg, #f5fbe8, #fcfdf8 68%);
  transition: border-color .2s, box-shadow .2s, background .2s;
}
.auto-card:hover { border-color: #cfdfb3; }
.auto-card.selected {
  border-color: #8ba34f;
  box-shadow: 0 0 0 2px #eef5e2;
  background: linear-gradient(102deg, #f0f8dd, #fbfdf5 68%);
}
.auto-card .template-image {
  width: 42px;
  height: 42px;
  flex: 0 0 42px;
  border-radius: 10px;
  border: 0;
  background: #e9f2d7;
  overflow: hidden;
}
.auto-card .template-image::after { display: none; }
.auto-visual { display: grid; place-items: center; }
.auto-glow {
  position: absolute;
  inset: -40%;
  background: radial-gradient(circle at 30% 26%, rgba(201, 244, 106, .9), transparent 62%);
}
.auto-icon { position: relative; z-index: 1; display: grid; place-items: center; color: #4c6a1b; }
.auto-icon svg { width: 17px; height: 17px; }
.auto-copy { flex: 1; min-width: 0; }
.auto-copy strong { display: block; color: var(--ink); font-size: 11px; font-weight: 700; }
.auto-copy span {
  display: block;
  margin-top: 2px;
  color: #8b9382;
  font-size: 8.5px;
  letter-spacing: .2px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.auto-card > i {
  position: static;
  padding: 2px 6px;
  color: #4f6d1d;
  background: #e6f5c6;
  border-radius: 999px;
  font-size: 7.5px;
  font-style: normal;
  font-weight: 700;
  letter-spacing: .4px;
}
.auto-card .select-check { right: 50%; top: 50%; transform: translate(50%, -50%); }

.scene-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 9px;
}
.scene-card { min-width: 0; padding: 0; text-align: left; border-radius: 10px; }
.scene-visual {
  position: relative;
  height: 56px;
  overflow: hidden;
  border: 2px solid transparent;
  border-radius: 9px;
  box-shadow: inset 0 0 0 1px rgba(23, 26, 23, .055);
  background:
    radial-gradient(120% 92% at 24% 14%, rgba(255, 255, 255, .55), transparent 64%),
    linear-gradient(150deg, var(--scene-accent, #d9dcd4), var(--scene-deep, #9ba196));
  transition: transform .3s, border-color .2s, box-shadow .2s;
}
.scene-card:hover .scene-visual { transform: translateY(-1px); }
.scene-card.selected .scene-visual { border-color: #8ba34f; box-shadow: 0 0 0 2px #eef5e2; }
.scene-card.selected .select-check { display: grid; }
.scene-card > strong {
  display: block;
  margin: 6px 0 1px 2px;
  font-size: 9.5px;
  font-weight: 650;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.scene-card > span {
  display: block;
  margin-left: 2px;
  color: #9aa094;
  font-size: 7.5px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.auto-scene-card {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 9px 11px;
  border: 1px solid #e3ebd3;
  border-radius: 11px;
  background: linear-gradient(102deg, #f5fbe8, #fcfdf8 68%);
  transition: border-color .2s, box-shadow .2s, background .2s;
}
.auto-scene-card:hover { border-color: #cfdfb3; }
.auto-scene-card.selected {
  border-color: #8ba34f;
  box-shadow: 0 0 0 2px #eef5e2;
  background: linear-gradient(102deg, #f0f8dd, #fbfdf5 68%);
}
.auto-scene-card .scene-visual {
  width: 42px;
  height: 42px;
  flex: 0 0 42px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  background: #e9f2d7;
  border-color: #e2ecd3;
}
.auto-scene-card .auto-copy strong { font-size: 11px; }
.auto-scene-card .select-check { right: 50%; top: 50%; transform: translate(50%, -50%); }
.scene-loading { padding: 16px 2px; color: #a3a89d; font-size: 9px; }

.match-note {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 9px 0 0;
  padding: 7px 9px;
  border: 1px dashed #dfe7cf;
  border-radius: 9px;
  background: #fbfdf6;
  color: #7d8574;
  font-size: 8.5px;
  line-height: 1.4;
}
.match-note > span {
  flex: 0 0 auto;
  padding: 1px 5px;
  color: #4f6d1d;
  background: #e9f6cd;
  border-radius: 999px;
  font-size: 7.5px;
  font-weight: 700;
  letter-spacing: .3px;
}
.match-note > strong { color: #37402f; font-size: 9px; font-weight: 700; }
.match-note > em { font-style: normal; color: #8b9382; }

.quantity-item.locked { opacity: .45; pointer-events: none; }

.result-tabs { display: flex; gap: 8px; padding: 2px 4px 0; }
.result-tab {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 4px 9px 4px 4px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #fff;
  transition: border-color .2s, box-shadow .2s;
}
.result-tab img {
  width: 28px;
  height: 36px;
  object-fit: cover;
  border-radius: 6px;
  background: #eeefe9;
}
.result-tab span { color: #7d8377; font-size: 9px; white-space: nowrap; }
.result-tab.active { border-color: #8ba34f; box-shadow: 0 0 0 2px #eef5e2; }
.result-tab.active span { color: #3f4c31; font-weight: 650; }

@media (max-width: 520px) {
  .scene-row { gap: 7px; }
  .scene-visual { height: 50px; }
  .scene-card > strong { font-size: 9px; }
  .result-tab img { width: 24px; height: 31px; }
}

