
    :root {
      color-scheme: light;
      --paper: #f4f3ed;
      --ink: #202b27;
      --forest: #24483d;
      --muted: #66716a;
      --line: #d8dcd2;
      --lime: #d7f16f;
      --white: #fff;
      --soft: #e8eadf;
      --radius: 18px;
      --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
      font-family: Inter, -apple-system, BlinkMacSystemFont, "PingFang TC", "Noto Sans TC", sans-serif;
      color: var(--ink);
      background: var(--paper);
      font-synthesis: none;
      text-rendering: optimizeLegibility;
    }
    * { box-sizing: border-box; }
    body { margin: 0; min-width: 320px; background: var(--paper); line-height: 1.55; }
    button, input { font: inherit; color: inherit; }
    button { cursor: pointer; touch-action: manipulation; }
    button:focus-visible, input:focus-visible, label:focus-within { outline: 3px solid #6a9a34; outline-offset: 3px; }
    button:disabled { cursor: not-allowed; opacity: .48; }
    .shell { width: min(1360px, calc(100% - 64px)); margin: 0 auto; }
    .topbar { display: flex; justify-content: space-between; align-items: center; min-height: 74px; border-bottom: 1px solid var(--line); gap: 20px; }
    .brand { display: inline-flex; align-items: center; gap: 11px; color: var(--ink); text-decoration: none; }
    .brand-mark { width: 28px; height: 28px; border: 1.5px solid var(--ink); border-radius: 50%; position: relative; flex: 0 0 auto; }
    .brand-mark::before { content: ""; position: absolute; left: 8px; top: 8px; width: 10px; height: 10px; background: var(--ink); border-radius: 50%; }
    .brand-mark::after { content: ""; position: absolute; left: -5px; top: 13px; width: 36px; height: 1px; background: var(--ink); transform: rotate(-40deg); }
    .brand-name { font-size: 11px; font-weight: 760; letter-spacing: 1.6px; }
    .brand-note { color: var(--muted); font: 10px var(--mono); letter-spacing: 1px; margin-left: 8px; }
    .local-note { display: flex; align-items: center; gap: 8px; color: var(--muted); font: 10px var(--mono); letter-spacing: .6px; }
    .local-dot { width: 7px; height: 7px; border-radius: 50%; background: #7fa35c; }
    main { padding: 32px 0 64px; }
    .intro { display: flex; justify-content: space-between; align-items: flex-end; gap: 30px; margin: 0 0 26px; }
    .eyebrow, .section-label { color: var(--forest); font: 10px var(--mono); letter-spacing: 1.4px; text-transform: uppercase; }
    .eyebrow { display: flex; align-items: center; gap: 9px; }
    .eyebrow::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: #78a25e; }
    h1 { margin: 10px 0 6px; font-size: clamp(32px, 4vw, 47px); font-weight: 650; line-height: 1.18; letter-spacing: -1.8px; }
    h1 em { position: relative; color: var(--forest); font-style: normal; }
    h1 em::after { content: ""; position: absolute; height: 4px; bottom: -3px; left: 0; right: 0; background: var(--lime); transform: rotate(-1deg); z-index: -1; }
    .intro-copy { max-width: 680px; color: var(--muted); font-size: 13px; }
    .intro-aside { color: var(--muted); font: 11px var(--mono); white-space: nowrap; padding-bottom: 4px; }
    .workspace { display: grid; grid-template-columns: minmax(320px, 378px) minmax(0, 1fr); gap: 20px; align-items: start; }
    .controls, .preview-card { border: 1px solid var(--line); border-radius: 20px; background: var(--white); }
    .controls { padding: 19px; display: grid; gap: 18px; }
    .control-section { border-bottom: 1px solid #edf0e9; padding-bottom: 17px; }
    .control-section:last-child { padding-bottom: 0; border-bottom: 0; }
    .section-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin-bottom: 11px; }
    .section-title { font-size: 14px; font-weight: 650; }
    .section-index { color: var(--muted); font: 10px var(--mono); letter-spacing: .8px; }
    .dropzone { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 13px; border: 1px dashed #b9c2b3; border-radius: 13px; background: #fbfcf8; }
    .dropzone-copy { min-width: 0; }
    .dropzone-copy strong { display: block; font-size: 12px; font-weight: 650; }
    .dropzone-copy span { display: block; margin-top: 3px; color: var(--muted); font-size: 12px; line-height: 1.5; }
    .limit-hint { margin: 7px 0 0; color: #795342; font-size: 10px; }
    .limit-hint[hidden] { display: none; }
    .button { min-height: 42px; display: inline-flex; align-items: center; justify-content: center; gap: 7px; border-radius: 999px; padding: 9px 14px; border: 1px solid var(--line); background: transparent; font-size: 12px; font-weight: 620; text-decoration: none; white-space: nowrap; }
    .button-primary { border-color: var(--forest); background: var(--forest); color: white; }
    .button-primary:hover:not(:disabled) { background: #193a30; }
    .button-soft { background: #eff2e9; border-color: #e0e5d9; }
    .button-text { border-color: transparent; padding-inline: 6px; min-height: 40px; color: var(--muted); font-size: 12px; text-decoration: underline; text-underline-offset: 3px; }
    .layout-options { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
    .layout-choice { min-width: 0; padding: 8px 6px 9px; border: 1px solid var(--line); border-radius: 12px; background: white; text-align: center; }
    .layout-choice[aria-pressed="true"] { border-color: var(--forest); box-shadow: inset 0 0 0 1px var(--forest); background: #f7f9f3; }
    .layout-choice[aria-pressed="true"] .layout-name::after { content: ""; display: inline-block; width: 5px; height: 5px; margin-left: 5px; vertical-align: 2px; border-radius: 50%; background: #86a85d; }
    .layout-icon { width: 50px; height: 38px; margin: 0 auto 6px; display: grid; gap: 3px; }
    .layout-icon i { display: block; border-radius: 2px; background: #cbd5c3; }
    .layout-icon-grid { grid-template-columns: repeat(2, 1fr); grid-template-rows: repeat(2, 1fr); }
    .layout-icon-grid i:first-child { background: var(--forest); }
    .layout-icon-hero { grid-template-columns: 1.25fr .75fr; grid-template-rows: repeat(2, 1fr); }
    .layout-icon-hero i:first-child { grid-row: span 2; background: var(--forest); }
    .layout-icon-strip { grid-template-columns: 1fr; grid-template-rows: 1.2fr 1fr 1fr; }
    .layout-icon-strip i:nth-child(2) { width: 70%; }
    .layout-icon-strip i:nth-child(3) { width: 88%; }
    .layout-name { display: block; font-size: 12px; font-weight: 620; }
    .layout-hint { display: block; color: var(--muted); font-size: 10px; margin-top: 1px; }
    .ratio-options { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
    .ratio-choice { display: flex; align-items: center; gap: 10px; min-height: 51px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 11px; background: white; text-align: left; }
    .ratio-choice[aria-pressed="true"] { border-color: var(--forest); background: #f7f9f3; box-shadow: inset 0 0 0 1px var(--forest); }
    .ratio-shape { width: 22px; height: 22px; border: 1.5px solid #9baa97; border-radius: 3px; flex: 0 0 auto; }
    .ratio-shape.portrait { width: 18px; height: 23px; margin-inline: 2px; }
    .ratio-choice[aria-pressed="true"] .ratio-shape { border-color: var(--forest); background: #dce6d2; }
    .ratio-text strong { display: block; font-size: 12px; }
    .ratio-text small { display: block; color: var(--muted); font: 9px var(--mono); }
    .control-row { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 10px; margin-top: 10px; }
    .control-row:first-of-type { margin-top: 0; }
    .control-label { font-size: 12px; }
    .control-value { color: var(--muted); font: 10px var(--mono); }
    input[type="range"] { width: 100%; accent-color: var(--forest); }
    .range-row { grid-column: 1 / -1; margin-top: -4px; }
    .color-control { display: flex; align-items: center; gap: 8px; }
    input[type="color"] { width: 29px; height: 25px; padding: 2px; border: 1px solid var(--line); border-radius: 7px; background: white; cursor: pointer; }
    #backgroundHex { color: var(--muted); font: 10px var(--mono); text-transform: uppercase; }
    .photo-list-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
    .photo-count { color: var(--muted); font: 10px var(--mono); }
    .photo-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 7px; max-height: 320px; overflow: auto; scrollbar-color: #c7cec2 transparent; }
    .photo-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 5px; border: 1px solid #e8ebe3; background: #fff; border-radius: 10px; padding: 5px; }
    .photo-row[aria-current="true"] { background: #f5f8ef; border-color: #a9ba9e; }
    .photo-row.dragging { opacity: .45; }
    .photo-row.drag-target { outline: 2px dashed #7fa35c; outline-offset: 1px; }
    .photo-pick { min-width: 0; display: flex; align-items: center; gap: 9px; padding: 0; border: 0; background: transparent; text-align: left; }
    .photo-thumb { width: 43px; height: 43px; display: block; flex: 0 0 auto; border-radius: 6px; background: #edf0e9; }
    .photo-name-wrap { min-width: 0; }
    .photo-name { display: block; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; font-weight: 600; }
    .photo-meta { display: block; color: var(--muted); font: 9px var(--mono); margin-top: 1px; }
    .photo-actions { display: flex; gap: 1px; align-items: center; }
    .icon-button { width: 40px; height: 40px; flex: 0 0 40px; padding: 0; border: 0; border-radius: 9px; background: transparent; color: #59675e; font-size: 16px; }
    .icon-button:hover:not(:disabled) { background: #e9eee2; }
    .icon-button.delete { color: #8b554d; font-size: 17px; }
    .empty-list { padding: 12px; border: 1px dashed var(--line); border-radius: 10px; color: var(--muted); text-align: center; font-size: 10px; }
    .crop-empty { color: var(--muted); font-size: 10px; }
    .crop-tools[hidden], .crop-empty[hidden] { display: none; }
    .crop-controls { display: grid; grid-template-columns: 1fr 1fr; column-gap: 14px; row-gap: 6px; }
    .crop-controls .control-row { margin-top: 0; }
    .crop-controls .range-row { margin-top: -5px; }
    .crop-actions { margin-top: 9px; display: flex; justify-content: space-between; align-items: center; gap: 8px; }
    .privacy-note { color: var(--muted); font-size: 11px; line-height: 1.6; }
    .preview-card { padding: 20px; background: #f9faf6; }
    .preview-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; margin-bottom: 17px; }
    .preview-title { font-size: 16px; font-weight: 660; }
    .preview-subtitle { color: var(--muted); font-size: 12px; margin-top: 3px; }
    .preview-head-actions { display: flex; align-items: center; gap: 7px; }
    .export-actions { display: flex; align-items: center; gap: 7px; }
    .stage-shell { display: flex; justify-content: center; padding: 17px; border: 1px solid #e1e5dc; border-radius: 16px; background: #eef0e8; }
    .stage { position: relative; width: min(100%, 650px); align-self: flex-start; overflow: hidden; background: var(--soft); box-shadow: 0 5px 20px #253c2b12; }
    #artboard { display: block; width: 100%; height: auto; }
    #selectionFrame { position: absolute; z-index: 1; display: none; border: 2px solid var(--lime); box-shadow: inset 0 0 0 1px #202b2770; pointer-events: none; }
    #emptyOverlay { position: absolute; inset: 0; display: grid; place-items: center; padding: 24px; text-align: center; }
    #emptyOverlay[hidden] { display: none; }
    .empty-card { max-width: 265px; padding: 21px; border: 1px solid #d8dcd2; border-radius: 15px; background: #ffffffed; }
    .empty-mark { display: grid; place-items: center; width: 43px; height: 43px; margin: 0 auto 10px; border-radius: 50%; background: var(--lime); color: var(--forest); font-size: 21px; }
    .empty-card h3 { margin: 0 0 4px; font-size: 15px; }
    .empty-card p { margin: 0 0 12px; color: var(--muted); font-size: 12px; }
    .canvas-foot { display: flex; justify-content: space-between; gap: 12px; margin-top: 13px; color: var(--muted); font: 9px var(--mono); }
    .density-advice { margin: 12px 0 0; padding: 10px 12px; border-left: 3px solid var(--lime); background: #f1f3ec; color: #4f5e53; font-size: 11px; line-height: 1.65; }
    .density-advice[hidden] { display: none; }
    .export-settings { display: flex; align-items: center; gap: 12px; justify-content: flex-end; padding-top: 12px; }
    .quality-control { width: min(230px, 45%); display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 7px; color: var(--muted); font-size: 12px; }
    .quality-control input { min-width: 50px; }
    .preview-explain { margin-top: 12px; padding-top: 11px; border-top: 1px solid #e5e8df; color: var(--muted); font-size: 12px; }
    .preview-explain strong { color: var(--ink); font-weight: 620; }
    .phone-dialog { width: min(390px, calc(100% - 24px)); max-width: 100%; max-height: min(92dvh, 900px); margin: auto; padding: 0; overflow: auto; border: 1px solid var(--line); border-radius: 22px; background: var(--paper); color: var(--ink); box-shadow: 0 25px 90px #16342545; }
    .phone-dialog::backdrop { background: #162c2870; }
    .phone-dialog-head { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 14px 16px; border-bottom: 1px solid var(--line); }
    .phone-dialog-title { margin: 0; font-size: 16px; font-weight: 650; }
    .phone-dialog-label { margin: 2px 0 0; color: var(--muted); font-size: 11px; }
    .phone-dialog-close { width: 42px; height: 42px; flex: 0 0 42px; padding: 0; border: 1px solid var(--line); border-radius: 50%; background: transparent; font-size: 22px; line-height: 1; }
    .phone-canvas-wrap { width: 100%; background: var(--soft); }
    #phoneArtboard { display: block; width: 100%; height: auto; }
    .phone-dialog-caption { margin: 0; padding: 10px 16px 15px; color: var(--muted); font-size: 11px; line-height: 1.5; }
    .message { margin: 13px 0 0; padding: 10px 12px; border-radius: 10px; color: #384a3c; background: #edf3e6; font-size: 12px; line-height: 1.6; white-space: pre-line; }
    .message[hidden] { display: none; }
    .message.error { color: #79453d; background: #f8eae5; }
    footer { margin-top: 19px; padding-top: 13px; display: flex; justify-content: space-between; gap: 20px; border-top: 1px solid var(--line); color: var(--muted); font-size: 9px; }
    footer span:last-child { font-family: var(--mono); letter-spacing: .4px; }
    .sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
    @media (max-width: 900px) {
      .shell { width: calc(100% - 40px); }
      .workspace { grid-template-columns: minmax(290px, 340px) minmax(0, 1fr); gap: 14px; }
      .controls, .preview-card { padding: 15px; }
      .preview-head { flex-direction: column; }
      .export-actions { align-self: stretch; }
      .export-actions .button { flex: 1; }
      .photo-name { max-width: 110px; }
    }
    @media (max-width: 700px) {
      .shell { width: calc(100% - 32px); }
      .topbar { min-height: 62px; }
      .brand-note { display: none; }
      .local-note { font-size: 8px; }
      main { padding: 23px 0 38px; }
      .intro { display: block; margin-bottom: 17px; }
      h1 { font-size: clamp(31px, 9vw, 39px); letter-spacing: -1.3px; }
      .intro-copy { font-size: 12px; }
      .intro-aside { display: none; }
      .workspace { grid-template-columns: minmax(0, 1fr); gap: 12px; }
      .preview-card { grid-row: 1; padding: 13px; }
      .controls { grid-row: 2; padding: 15px; gap: 16px; }
      .preview-head { flex-direction: column; align-items: stretch; gap: 10px; margin-bottom: 12px; }
      .preview-title { font-size: 14px; }
      .preview-subtitle { font-size: 11px; }
      .preview-head-actions { width: 100%; gap: 6px; }
      .export-actions { flex: 1; align-self: auto; gap: 5px; }
      .preview-head-actions .button { min-height: 44px; padding: 10px 10px; font-size: 11px; }
      .export-actions .button { flex: 1; min-width: 0; }
      .stage-shell { padding: 9px; }
      .stage { width: 100%; }
      .canvas-foot { font-size: 8px; }
      .quality-control { width: min(240px, 65%); }
      .dropzone { padding: 11px; }
      .photo-name { max-width: 100%; }
      .photo-list { max-height: 340px; }
      .icon-button { width: 44px; height: 44px; flex-basis: 44px; }
      .control-section { padding-bottom: 15px; }
      footer { flex-direction: column; gap: 4px; }
    }
    @media (max-width: 370px) {
      .shell { width: calc(100% - 24px); }
      .local-note { letter-spacing: 0; }
      .preview-head-actions { flex-wrap: wrap; }
      .export-actions { flex-basis: 100%; }
      .phone-preview-open { flex: 1; }
      .layout-name { font-size: 11px; }
      .layout-hint { font-size: 9px; }
    }
    @media (max-width: 700px) {
      .phone-dialog { width: 100%; max-width: 100%; height: 100dvh; max-height: 100dvh; margin: 0; border: 0; border-radius: 0; }
      .phone-dialog-head { padding-top: max(12px, env(safe-area-inset-top)); }
      .phone-dialog-caption { padding-bottom: max(15px, env(safe-area-inset-bottom)); }
    }
    @media (prefers-reduced-motion: reduce) { *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important; } }

/* Hosted page: keep source spacing without inline style attributes. */
.privacy-note--spaced { margin-top: 8px; }
.clear-all-action { display: flex; justify-content: flex-end; margin-top: 7px; }
.control-row--wide { grid-column: 1 / -1; }
.hosted-site-nav { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 20px; max-width: 1280px; margin: 0 auto; padding: 12px 24px; font: 600 14px/1.5 system-ui, sans-serif; }
.hosted-site-nav a { min-height: 44px; display: inline-flex; align-items: center; color: #173451; text-underline-offset: 3px; }
.hosted-no-js { max-width: 1280px; margin: 0 auto 16px; padding: 12px 16px; border: 1px solid #b9c8d6; background: #fff; color: #102338; font: 16px/1.6 system-ui, sans-serif; }
.hosted-no-js a { display: inline-block; margin-inline-start: 6px; }
@media (max-width: 319px) { html, body { min-width: 0; width: 100%; } body, #top, main, .app-shell, .preview-card, .workspace { min-width: 0; max-width: 100%; } .hosted-site-nav { padding-inline: 12px; } .layout-options { gap: 4px; } .layout-icon { width: 40px; max-width: 100%; } .quality-control { width: 100%; min-width: 0; grid-template-columns: minmax(0, 1fr) auto; } .quality-control > span { grid-column: 1 / -1; } .quality-control input { min-width: 0; } }
