    :root {
      --paper: #f4ede1;
      --surface: #fffaf2;
      --surface-deep: #f7ecdc;
      --line: #e3d2bd;
      --line-strong: #c89b67;
      --ink: #33241d;
      --muted: #806d5d;
      --cinnabar: #a6382d;
      --cinnabar-dark: #7c251e;
      --copper: #ae7038;
      --gold: #d6aa69;
      --jade: #347062;
      --teal: #24594f;
      --shadow: 0 12px 30px rgba(92, 59, 31, 0.1);
    }

    * { box-sizing: border-box; }

    html { min-width: 0; }

    body {
      margin: 0;
      min-width: 0;
      min-height: 100vh;
      background: var(--paper);
      color: var(--ink);
      font-family: "Microsoft YaHei", "Noto Sans SC", Arial, sans-serif;
      font-size: 14px;
    }

    button, input, select, textarea { font: inherit; }
    button { cursor: pointer; }
    button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
      outline: 3px solid rgba(52, 112, 98, 0.25);
      outline-offset: 2px;
    }

    .topbar {
      height: 68px;
      display: flex;
      align-items: center;
      justify-content: space-between;
      padding: 0 44px;
      border-bottom: 1px solid rgba(174, 112, 56, 0.24);
      background: rgba(255, 250, 242, 0.92);
      position: sticky;
      top: 0;
      z-index: 30;
    }

    .brand {
      display: flex;
      align-items: center;
      gap: 12px;
      color: var(--ink);
      text-decoration: none;
      font-family: "STKaiti", "KaiTi", serif;
      font-size: 21px;
      font-weight: 700;
    }

    .brand-mark {
      width: 31px;
      height: 31px;
      display: grid;
      place-items: center;
      border: 1px solid var(--copper);
      color: var(--cinnabar);
      background: var(--surface);
      font-family: "STKaiti", "KaiTi", serif;
      font-size: 19px;
      line-height: 1;
    }

    .nav-actions { display: flex; align-items: center; gap: 10px; }

    .button, .icon-button {
      min-height: 38px;
      border: 1px solid transparent;
      border-radius: 6px;
      background: transparent;
      color: var(--ink);
      transition: background 160ms ease, border-color 160ms ease, color 160ms ease, transform 160ms ease;
    }

    .button { padding: 0 15px; }
    .button:hover { transform: translateY(-1px); }
    .button.primary { background: var(--cinnabar); color: #fffaf5; border-color: var(--cinnabar); }
    .button.primary:hover { background: var(--cinnabar-dark); }
    .button.secondary { border-color: var(--line-strong); background: var(--surface); color: var(--cinnabar-dark); }
    .button.secondary:hover { background: #fff2df; }
    .button.quiet { color: var(--muted); }
    .button.quiet:hover { background: rgba(174, 112, 56, 0.1); color: var(--ink); }
    .button.wide { width: 100%; }
    .button.compact { min-height: 32px; padding: 0 10px; font-size: 13px; }
    .button:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }

    .icon-button {
      width: 36px;
      padding: 0;
      display: inline-grid;
      place-items: center;
      font-size: 20px;
      border-color: var(--line);
      background: var(--surface);
    }
    .icon-button:hover { border-color: var(--copper); color: var(--cinnabar); }
    .icon-button:disabled { opacity: 0.42; cursor: default; }

    .app-shell { width: min(1500px, calc(100% - 72px)); margin: 0 auto; padding: 30px 0 48px; }

    .page-heading {
      display: flex;
      align-items: end;
      justify-content: space-between;
      gap: 24px;
      margin-bottom: 24px;
    }

    .eyebrow { color: var(--copper); font-size: 13px; margin: 0 0 8px; }
    h1, h2, h3, p { margin-top: 0; }
    h1 { margin-bottom: 8px; font-family: "STKaiti", "KaiTi", serif; font-size: 34px; font-weight: 700; line-height: 1.15; }
    h2 { margin-bottom: 6px; font-family: "STKaiti", "KaiTi", serif; font-size: 25px; line-height: 1.2; }
    h3 { margin-bottom: 6px; font-size: 15px; }
    .subhead { margin: 0; color: var(--muted); font-size: 14px; }

    .prototype-note {
      display: flex;
      align-items: center;
      gap: 9px;
      padding: 9px 12px;
      border-left: 3px solid var(--teal);
      color: var(--teal);
      background: rgba(52, 112, 98, 0.08);
      white-space: nowrap;
    }
    .prototype-note::before { content: "●"; font-size: 10px; }

    .stepper {
      display: grid;
      grid-template-columns: repeat(4, 1fr);
      min-height: 78px;
      margin-bottom: 22px;
      border-top: 1px solid var(--line);
      border-bottom: 1px solid var(--line);
      background: rgba(255, 250, 242, 0.55);
    }

    .step-item {
      position: relative;
      display: flex;
      align-items: center;
      gap: 12px;
      padding: 14px 18px;
      border: 0;
      border-right: 1px solid var(--line);
      background: transparent;
      color: var(--muted);
      text-align: left;
    }
    .step-item:last-child { border-right: 0; }
    .step-item:hover { background: rgba(174, 112, 56, 0.06); }
    .step-item.active { color: var(--ink); background: var(--surface); }
    .step-item.active::after { content: ""; position: absolute; right: 0; bottom: -1px; left: 0; height: 3px; background: var(--cinnabar); }
    .step-item.complete .step-number { background: var(--jade); border-color: var(--jade); color: #fff; }
    .step-number {
      width: 30px;
      height: 30px;
      display: grid;
      place-items: center;
      flex: 0 0 auto;
      border: 1px solid var(--line-strong);
      border-radius: 50%;
      color: var(--copper);
      background: var(--surface);
      font-family: Georgia, serif;
      font-size: 16px;
    }
    .step-item.active .step-number { border-color: var(--cinnabar); background: var(--cinnabar); color: #fff; }
    .step-text { display: grid; gap: 2px; }
    .step-title { font-size: 16px; font-weight: 700; }
    .step-desc { font-size: 12px; color: var(--muted); }

    .step-view { display: none; animation: fade-in 240ms ease; }
    .step-view.active { display: block; }
    @keyframes fade-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: translateY(0); } }

    .tool-shell {
      border: 1px solid var(--line);
      background: var(--surface);
      box-shadow: var(--shadow);
    }

    .tool-heading {
      min-height: 70px;
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 20px;
      padding: 14px 20px;
      border-bottom: 1px solid var(--line);
    }
    .tool-heading p { margin: 0; color: var(--muted); font-size: 13px; }
    .heading-actions { display: flex; align-items: center; gap: 10px; }

    .lineart-layout { display: grid; grid-template-columns: 310px minmax(0, 1fr); min-height: 642px; }
    .lineart-layout > * + * { border-left: 1px solid var(--line); }

    .upload-zone, .palette-panel, .inspector-panel { padding: 18px; }
    .upload-zone { background: #fff8ee; }
    .side-label { margin: 0 0 12px; color: var(--muted); font-size: 12px; }

    .upload-box {
      min-height: 236px;
      display: grid;
      align-content: center;
      justify-items: center;
      gap: 12px;
      padding: 20px;
      border: 1px dashed var(--copper);
      background: rgba(255, 250, 242, 0.65);
      text-align: center;
    }
    .upload-glyph { color: var(--cinnabar); font-size: 30px; line-height: 1; }
    .upload-box strong { font-size: 15px; }
    .upload-box span { color: var(--muted); font-size: 12px; line-height: 1.5; }
    .upload-box input { display: none; }
    .upload-placeholder { display: grid; justify-items: center; gap: 12px; }
    .upload-preview-state { display: none; width: 100%; height: 100%; grid-template-rows: minmax(0, 1fr) auto; gap: 8px; }
    .upload-preview-state img { width: 100%; height: 182px; object-fit: contain; border: 1px solid var(--line); background: #f3e8d8; }
    .upload-preview-copy { display: flex; justify-content: space-between; align-items: center; color: var(--muted); font-size: 12px; }
    .upload-preview-copy b { color: var(--cinnabar-dark); font-weight: 600; }
    .upload-box.has-preview { align-content: stretch; padding: 9px; }
    .upload-box.has-preview .upload-placeholder { display: none; }
    .upload-box.has-preview .upload-preview-state { display: grid; }
    .upload-box.dragging { border-color: var(--jade); background: rgba(52, 112, 98, 0.08); }
    .upload-trigger { display: inline-flex; align-items: center; justify-content: center; min-height: 34px; padding: 0 12px; border: 1px solid var(--line-strong); background: var(--surface); color: var(--cinnabar-dark); border-radius: 5px; }
    .upload-trigger:hover { background: #fff1dc; }

    .file-chip {
      display: grid;
      grid-template-columns: 38px 1fr;
      gap: 10px;
      align-items: center;
      padding: 10px 0;
      border-bottom: 1px solid var(--line);
    }
    .file-thumb { width: 38px; height: 38px; object-fit: cover; border: 1px solid var(--line); }
    .file-chip strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; }
    .file-chip span { color: var(--muted); font-size: 11px; }

    .status-list { display: grid; gap: 0; margin-top: 18px; }
    .status-row { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 10px 0; border-bottom: 1px solid var(--line); color: var(--muted); font-size: 13px; }
    .status-row b { color: var(--jade); font-weight: 600; }
    .status-row b.pending { color: var(--copper); }

    .generation-history { margin-top: 20px; padding-top: 18px; border-top: 1px solid var(--line); }
    .history-heading { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
    .history-heading h3 { margin: 0; font-family: "STKaiti", "KaiTi", serif; font-size: 18px; }
    .history-heading span { color: var(--muted); font-size: 11px; }
    .generation-list { display: grid; gap: 7px; }
    .generation-record { display: grid; grid-template-columns: 46px minmax(0, 1fr) auto; gap: 9px; align-items: center; width: 100%; min-height: 60px; padding: 6px; border: 1px solid var(--line); border-left: 3px solid transparent; background: var(--surface); color: var(--ink); text-align: left; }
    .generation-record:hover { border-color: var(--line-strong); background: #fff2df; }
    .generation-record.active { border-left-color: var(--cinnabar); background: #fff4e6; }
    .generation-record img { width: 46px; height: 46px; object-fit: cover; border: 1px solid var(--line); }
    .record-copy { min-width: 0; display: grid; gap: 3px; }
    .record-copy strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; }
    .record-copy span { color: var(--muted); font-size: 11px; }
    .record-state { color: var(--jade); font-size: 11px; white-space: nowrap; }

    .canvas-area { display: grid; grid-template-rows: auto minmax(0, 1fr) auto; min-width: 0; background: #f9f2e7; }
    .canvas-toolbar { display: flex; justify-content: space-between; align-items: center; padding: 12px 16px; border-bottom: 1px solid var(--line); }
    .view-tabs { display: inline-flex; gap: 2px; padding: 3px; border: 1px solid var(--line); background: var(--surface); }
    .view-tab { min-height: 30px; padding: 0 12px; border: 0; background: transparent; color: var(--muted); border-radius: 3px; }
    .view-tab.active { background: var(--cinnabar); color: #fff; }
    .canvas-tag { color: var(--muted); font-size: 12px; }

    .artboard { position: relative; min-height: 548px; overflow: hidden; background: #eee3d2; }
    .artboard img { position: absolute; width: 100%; height: 100%; object-fit: contain; transition: opacity 260ms ease; }
    .art-original { opacity: 0; }
    .art-line { opacity: 1; }
    .artboard.show-original .art-original { opacity: 1; }
    .artboard.show-original .art-line { opacity: 0; }
    .canvas-footer { display: flex; justify-content: space-between; align-items: center; padding: 12px 16px; border-top: 1px solid var(--line); }
    .canvas-footer span { color: var(--muted); font-size: 12px; }
    .tip-strip { padding: 10px; border-left: 3px solid var(--copper); color: #715138; background: rgba(214, 170, 105, 0.14); line-height: 1.6; font-size: 12px; }

    .color-layout { display: grid; grid-template-columns: 286px minmax(0, 1fr) 360px; min-height: 740px; }
    .color-layout > * + * { border-left: 1px solid var(--line); }
    .palette-panel { background: #fff8ee; }
    .panel-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 15px; }
    .panel-head h3 { margin: 0; }
    .count-badge { color: var(--teal); font-size: 12px; }
    .mode-tabs { display: grid; grid-template-columns: repeat(2, 1fr); gap: 3px; margin-bottom: 16px; padding-bottom: 12px; border-bottom: 1px solid var(--line); }
    .mode-tab { min-height: 31px; padding: 0 6px; border: 0; background: transparent; color: var(--muted); border-bottom: 2px solid transparent; }
    .mode-tab.active { color: var(--cinnabar-dark); border-bottom-color: var(--cinnabar); font-weight: 700; }
    .palette-section { margin-bottom: 18px; }
    .palette-section > span { display: block; margin-bottom: 9px; color: var(--muted); font-size: 12px; }
    .selected-colors-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 9px; }
    .selected-colors-head > span { color: var(--muted); font-size: 12px; }
    .clear-selected-colors { padding: 2px 0; border: 0; background: transparent; color: var(--cinnabar-dark); font: inherit; font-size: 11px; }
    .clear-selected-colors:hover { color: var(--cinnabar); text-decoration: underline; }
    .clear-selected-colors:disabled { color: var(--muted); cursor: not-allowed; opacity: 0.55; text-decoration: none; }
    .mode-content[hidden] { display: none; }
    .palette-select { width: 100%; height: 36px; padding: 0 30px 0 10px; border: 1px solid var(--line-strong); border-radius: 4px; color: var(--ink); background: var(--surface); font: inherit; }
    .palette-select:disabled { color: var(--muted); background: #f3eadc; cursor: not-allowed; }
    .palette-lock-note { min-height: 18px; margin: 7px 0 12px; color: var(--muted); font-size: 11px; line-height: 1.45; }
    .palette-lock-note.is-locked { color: var(--cinnabar-dark); }
    .color-card-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px; }
    .color-card { display: flex; align-items: center; min-width: 0; gap: 7px; padding: 7px; border: 1px solid var(--line); border-radius: 4px; background: var(--surface); color: var(--ink); text-align: left; }
    .color-card:hover, .color-card.selected { border-color: var(--copper); background: #fff2df; }
    .color-card-dot { flex: 0 0 22px; width: 22px; height: 22px; border: 1px solid rgba(51, 36, 29, 0.18); border-radius: 50%; background: var(--swatch); box-shadow: inset 0 0 0 2px rgba(255,255,255,0.45); }
    .color-card-copy { display: grid; min-width: 0; gap: 2px; }
    .color-card-copy b { overflow: hidden; font-size: 12px; line-height: 1.15; text-overflow: ellipsis; white-space: nowrap; }
    .color-card-copy code { color: var(--muted); font-family: Consolas, monospace; font-size: 10px; }
    .palette-divider { height: 1px; margin: 18px 0; background: var(--line); }
    .selected-color-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px; min-height: 40px; }
    .selected-color-chip { display: grid; grid-template-columns: 16px minmax(0, 1fr) 18px; align-items: center; gap: 5px; min-width: 0; padding: 5px; border: 1px solid var(--line); background: var(--surface); }
    .selected-color-use { grid-column: 1 / 3; display: flex; align-items: center; min-width: 0; gap: 5px; padding: 0; border: 0; background: transparent; color: var(--ink); text-align: left; }
    .selected-color-use span:first-child { flex: 0 0 14px; width: 14px; height: 14px; border: 1px solid rgba(51, 36, 29, 0.18); border-radius: 50%; background: var(--swatch); }
    .selected-color-use code { overflow: hidden; color: var(--ink); font-family: Consolas, monospace; font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
    .selected-color-remove { width: 18px; height: 18px; padding: 0; border: 0; background: transparent; color: var(--muted); font-size: 15px; line-height: 1; }
    .selected-color-remove:hover { color: var(--cinnabar); }
    .color-empty { grid-column: 1 / -1; color: var(--muted); font-size: 12px; line-height: 1.5; }
    .history-list { display: grid; gap: 7px; }
    .history-color { display: grid; grid-template-columns: 20px minmax(0, 1fr) auto; align-items: center; gap: 8px; width: 100%; padding: 7px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); text-align: left; }
    .history-color:hover { border-color: var(--copper); background: #fff2df; }
    .history-color i { width: 20px; height: 20px; border: 1px solid rgba(51, 36, 29, 0.18); border-radius: 50%; background: var(--swatch); }
    .history-color span { overflow: hidden; font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
    .history-color code { color: var(--muted); font-family: Consolas, monospace; font-size: 10px; }
    .history-empty { color: var(--muted); font-size: 12px; line-height: 1.5; }
    .solution-history { margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line); }
    .solution-history-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
    .solution-history-head h3 { margin: 0; font-size: 15px; }
    .solution-history-tabs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px; margin-bottom: 9px; }
    .solution-history-tab { min-height: 30px; padding: 0 5px; border: 1px solid var(--line); border-radius: 3px; background: transparent; color: var(--muted); font-size: 11px; }
    .solution-history-tab.active { border-color: var(--cinnabar); background: #fff1df; color: var(--cinnabar-dark); font-weight: 700; }
    .solution-history-list { display: grid; gap: 7px; max-height: 260px; overflow-y: auto; padding-right: 2px; }
    .solution-history-list[hidden] { display: none; }
    .solution-history-item { display: grid; grid-template-columns: 44px minmax(0, 1fr) 24px; gap: 7px; align-items: center; min-height: 53px; padding: 5px; border: 1px solid var(--line); background: var(--surface); }
    .solution-history-item.selected { border-color: var(--copper); background: #fff2df; }
    .solution-history-select { display: grid; grid-column: 1 / 3; grid-template-columns: 44px minmax(0, 1fr); gap: 7px; align-items: center; min-width: 0; padding: 0; border: 0; background: transparent; color: inherit; text-align: left; cursor: pointer; }
    .solution-history-select img { width: 44px; height: 42px; border: 1px solid rgba(51, 36, 29, 0.16); object-fit: cover; background: #eee3d2; }
    .solution-history-copy { display: grid; min-width: 0; gap: 3px; }
    .solution-history-copy strong, .solution-history-copy span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
    .solution-history-copy strong { color: var(--ink); font-size: 12px; }
    .solution-history-copy span { color: var(--muted); font-size: 10px; }
    .solution-history-delete { width: 24px; height: 24px; padding: 0; border: 0; background: transparent; color: var(--cinnabar-dark); font-size: 17px; line-height: 1; }
    .solution-history-delete[hidden] { display: none; }

    .paint-workspace { display: grid; grid-template-rows: auto minmax(0, 1fr) auto; min-width: 0; background: #f9f2e7; }
    .paint-toolbar { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 11px 14px; border-bottom: 1px solid var(--line); }
    .toolbar-group { display: flex; align-items: center; gap: 8px; }
    .tool-label { color: var(--muted); font-size: 12px; }
    .canvas-view-switch { display: inline-flex; gap: 3px; padding: 3px; border: 1px solid var(--line); background: var(--surface); }
    .canvas-view-tab { min-height: 30px; padding: 0 11px; border: 0; background: transparent; color: var(--muted); font-size: 12px; white-space: nowrap; }
    .canvas-view-tab.active { background: var(--cinnabar); color: #fff; }
    .canvas-view-tab:disabled { color: #b9aa99; cursor: not-allowed; }
    .canvas-view-tab:disabled.active { background: transparent; color: #b9aa99; }
    .canvas-view-tab .stale-mark { display: none; margin-left: 4px; color: var(--copper); font-size: 11px; }
    .canvas-view-tab.is-stale .stale-mark { display: inline; }
    .manual-paint-tools[hidden] { display: none; }
    .paint-stage { position: relative; min-height: 590px; overflow: hidden; background: #eee3d2; }
    .paint-stage::before { content: ""; position: absolute; inset: 0; background-image: linear-gradient(rgba(158, 111, 63, 0.08) 1px, transparent 1px), linear-gradient(90deg, rgba(158, 111, 63, 0.08) 1px, transparent 1px); background-size: 24px 24px; opacity: 0.28; }
    .paint-color-image, .paint-line-image, .ai-history-image { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; transition: opacity 180ms ease; }
    .paint-color-image { z-index: 1; opacity: 0; filter: saturate(1.18) contrast(1.04); mix-blend-mode: multiply; }
    .ai-history-image { z-index: 1; opacity: 0; pointer-events: none; }
    .paint-line-image { z-index: 2; opacity: 0.86; mix-blend-mode: multiply; pointer-events: none; }
    .region-fill { position: absolute; z-index: 1; background: transparent; opacity: 0; mix-blend-mode: multiply; filter: saturate(1.35); transition: opacity 180ms ease, background 180ms ease; pointer-events: none; }
    .region-fill[data-fill-region="outer"] { left: 29%; top: 12%; width: 38%; height: 42%; border-radius: 48% 52% 45% 55%; }
    .region-fill[data-fill-region="core"] { left: 45%; top: 23%; width: 12%; height: 13%; border-radius: 50%; }
    .region-fill[data-fill-region="leaf"] { left: 53%; top: 51%; width: 24%; height: 23%; border-radius: 40%; }
    .paint-stage[data-canvas-view="ai"].ai-preview .paint-color-image { opacity: 0.72; }
    .paint-stage[data-canvas-view="ai"].ai-preview.has-ai-snapshot .paint-color-image { opacity: 0; }
    .paint-stage[data-canvas-view="ai"].ai-preview.has-ai-snapshot .ai-history-image { opacity: 1; }
    .paint-stage[data-canvas-view="ai"].ai-preview.has-ai-snapshot .paint-line-image { opacity: 0; }
    .paint-stage[data-canvas-view="ai"].ai-preview.is-ai-stale::before { z-index: 4; background: rgba(69, 48, 36, 0.42); opacity: 1; }
    .paint-stage[data-canvas-view="ai"].ai-preview.is-ai-stale .paint-line-image, .paint-stage[data-canvas-view="ai"].ai-preview.is-ai-stale .paint-color-image { filter: blur(1px) saturate(0.72); }
    .ai-stale-note { display: none; position: absolute; z-index: 5; top: 18px; left: 50%; max-width: calc(100% - 36px); padding: 10px 13px; transform: translateX(-50%); border: 1px solid var(--copper); background: #fff8ee; color: var(--cinnabar-dark); box-shadow: var(--shadow); font-size: 12px; text-align: center; }
    .paint-stage[data-canvas-view="ai"].ai-preview.is-ai-stale .ai-stale-note { display: block; }
    .region-hit { position: absolute; z-index: 3; border: 1px solid transparent; background: transparent; border-radius: 50%; }
    .paint-stage[data-canvas-view="line"] .region-fill, .paint-stage[data-canvas-view="line"] .region-hit, .paint-stage[data-canvas-view="ai"] .region-fill, .paint-stage[data-canvas-view="ai"] .region-hit { pointer-events: none; visibility: hidden; }
    .paint-stage.is-reference-mode .region-hit { pointer-events: none; cursor: not-allowed; }
    .paint-stage[data-canvas-view="ai"] .paint-line-image { opacity: 0.78; }
    .region-hit:hover { border-color: rgba(166, 56, 45, 0.72); background: rgba(166, 56, 45, 0.08); }
    .region-hit[data-region="大牡丹外瓣"] { left: 30%; top: 16%; width: 15%; height: 21%; }
    .region-hit[data-region="花蕊"] { left: 45%; top: 23%; width: 12%; height: 13%; }
    .region-hit[data-region="叶片"] { left: 53%; top: 51%; width: 24%; height: 23%; border-radius: 40%; }
    .region-hit[data-closed="false"] { left: 77%; top: 65%; width: 17%; height: 11%; border-radius: 24%; }
    .paint-footer { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 12px 14px; border-top: 1px solid var(--line); }
    .paint-footer strong { color: var(--cinnabar-dark); font-size: 13px; }
    .paint-footer span { color: var(--muted); font-size: 12px; }
    .paint-footer-actions { display: flex; align-items: center; gap: 8px; }
    .paint-footer-actions [hidden] { display: none; }
    #completeColoring[aria-busy="true"]::before { content: ""; width: 13px; height: 13px; margin-right: 7px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: completion-spin 0.75s linear infinite; }
    .paint-stage.is-completing .real-fill-canvas { pointer-events: none; cursor: wait; }
    @keyframes completion-spin { to { transform: rotate(360deg); } }
    .paint-action { display: inline-flex; align-items: center; justify-content: center; min-height: 32px; padding: 0 10px; border: 1px solid var(--line-strong); border-radius: 4px; background: var(--surface); color: var(--ink); font-size: 12px; white-space: nowrap; }
    .paint-action:hover { border-color: var(--copper); color: var(--cinnabar-dark); background: #fff2df; }
    .paint-action.is-active { border-color: var(--cinnabar); background: var(--cinnabar); color: #fffaf5; font-weight: 700; }
    .paint-action.danger:hover { border-color: var(--cinnabar); color: var(--cinnabar-dark); }

    .inspector-panel { padding: 18px 22px; background: #fff8ee; }
    .current-color-summary { display: grid; grid-template-columns: 28px minmax(96px, 132px) minmax(94px, 1fr); align-items: center; gap: 10px; margin-bottom: 16px; }
    .current-color-label { color: var(--ink); font-size: 20px; font-weight: 700; line-height: 1.05; writing-mode: vertical-rl; text-orientation: upright; }
    .current-color { width: 100%; height: 68px; border: 1px solid rgba(51,36,29,0.18); background: #c23a35; box-shadow: inset 0 0 0 2px rgba(255,255,255,0.45); }
    .current-color-meta { display: grid; justify-items: start; gap: 9px; min-width: 0; }
    .current-color-meta .count-badge { color: var(--jade); font-size: 15px; font-weight: 700; white-space: nowrap; }
    .current-color-meta b { color: var(--ink); font-family: Consolas, monospace; font-size: 17px; white-space: nowrap; }
    .picker-space { display: grid; grid-template-columns: minmax(0, 1fr) 16px; gap: 10px; height: 190px; margin-bottom: 12px; }
    .color-field { --picker-hue: 2; --picker-x: 73%; --picker-y: 22%; position: relative; border: 1px solid var(--line-strong); background: linear-gradient(to top, #1b1512, transparent), linear-gradient(to right, #fff, hsl(var(--picker-hue) 78% 51%)); cursor: crosshair; overflow: hidden; touch-action: none; }
    .color-field::after { content: ""; position: absolute; width: 12px; height: 12px; top: var(--picker-y); left: var(--picker-x); border: 2px solid #fff; border-radius: 50%; box-shadow: 0 0 0 1px var(--ink); transform: translate(-50%, -50%); }
    .hue-rail { appearance: none; width: 16px; margin: 0; writing-mode: vertical-lr; direction: rtl; border: 0; border-radius: 0; background: linear-gradient(to top, #ff1f16, #f7e600, #00ce51, #14d8e8, #2247e8, #ba16d6, #ff0a35); }
    .hue-rail::-webkit-slider-thumb { appearance: none; width: 20px; height: 8px; border: 1px solid var(--ink); background: #fff; }
    .picker-actions { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; align-items: stretch; margin-bottom: 16px; }
    .add-selected-color-button { width: 100%; min-width: 0; border-color: var(--cinnabar) !important; background: #fff1df !important; color: var(--cinnabar-dark) !important; font-weight: 700; box-shadow: inset 0 0 0 1px rgba(179, 52, 42, 0.12); }
    .add-selected-color-button:hover { border-color: var(--cinnabar-dark) !important; background: #ffe5cf !important; }
    .eyedropper-split { position: relative; display: grid; grid-template-columns: auto 30px; min-height: 38px; border: 1px solid var(--line-strong); border-radius: 4px; background: var(--surface); overflow: visible; }
    .eyedropper-split button { min-height: 36px; border: 0; background: transparent; color: var(--ink); font: inherit; }
    .eyedropper-primary { padding: 0 11px; color: var(--cinnabar-dark) !important; font-size: 12px !important; font-weight: 700 !important; white-space: nowrap; }
    .eyedropper-menu-toggle { width: 30px; border-left: 1px solid var(--line) !important; color: var(--muted) !important; font-size: 14px !important; }
    .eyedropper-split button:hover:not(:disabled) { background: #fff1df; color: var(--cinnabar-dark) !important; }
    .eyedropper-split button:focus-visible { position: relative; z-index: 1; outline: 2px solid rgba(193, 55, 44, 0.35); outline-offset: -2px; }
    .eyedropper-split button:disabled { color: #b9aa99 !important; background: #f3eadc !important; cursor: not-allowed; }
    .eyedropper-menu { position: absolute; z-index: 14; top: calc(100% + 6px); right: 0; min-width: 144px; padding: 4px; border: 1px solid var(--line-strong); border-radius: 4px; background: var(--surface); box-shadow: 0 10px 20px rgba(77, 55, 37, 0.16); }
    .eyedropper-menu[hidden] { display: none; }
    .eyedropper-menu button { width: 100%; min-height: 34px; padding: 0 9px; text-align: left; color: var(--ink); font-size: 12px; }
    .metric-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
    .metric-group { padding: 9px; border: 1px solid var(--line); background: rgba(255,250,242,0.64); }
    .metric-group > span { display: block; margin-bottom: 7px; color: var(--muted); font-size: 11px; }
    .metric-line { display: grid; grid-template-columns: 16px 1fr; gap: 4px; align-items: center; margin-top: 5px; font-size: 11px; }
    .metric-line b { color: var(--cinnabar-dark); }
    .metric-line input { min-width: 0; height: 25px; padding: 0 5px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); border-radius: 3px; }
    .metric-line input:focus, .hex-entry input:focus { outline: 2px solid rgba(193, 55, 44, 0.2); border-color: var(--cinnabar); }
    .hex-entry { display: grid; grid-template-columns: 34px 1fr; gap: 8px; align-items: center; margin-top: 10px; }
    .hex-entry label { color: var(--cinnabar-dark); font-weight: 700; }
    .hex-entry input { width: 100%; height: 32px; padding: 0 8px; border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink); border-radius: 4px; font-family: Consolas, monospace; }
    .palette-panel.is-reference-locked, .manual-color-controls.is-reference-locked { opacity: 0.48; }
    .palette-panel.is-reference-locked { background: #f6eee1; }
    .manual-color-controls.is-reference-locked { position: relative; }
    .manual-color-controls.is-reference-locked::after { content: "参考图模式下不可选色"; position: absolute; inset: 0; display: grid; place-items: center; padding: 12px; background: rgba(255, 248, 238, 0.5); color: var(--cinnabar-dark); font-size: 12px; font-weight: 700; text-align: center; pointer-events: none; }
    .paint-stage.is-canvas-eyedropper { cursor: crosshair; }
    .canvas-eyedropper-note { display: none; position: absolute; z-index: 8; top: 14px; left: 50%; max-width: calc(100% - 28px); padding: 8px 11px; border: 1px solid var(--cinnabar); border-radius: 4px; background: rgba(255, 248, 238, 0.95); color: var(--cinnabar-dark); font-size: 12px; font-weight: 700; line-height: 1.4; text-align: center; transform: translateX(-50%); pointer-events: none; }
    .paint-stage.is-canvas-eyedropper .canvas-eyedropper-note { display: block; }
    .ai-trigger { width: 100%; margin-top: 18px; }
    .ai-box { display: none; margin-top: 12px; padding-top: 16px; border-top: 1px solid var(--line); }
    .ai-box.is-open { display: block; }
    .ai-box h3 { margin-bottom: 4px; }
    .ai-box > p { margin: 0 0 10px; color: var(--muted); font-size: 12px; line-height: 1.55; }
    .ai-state { display: grid; gap: 7px; margin: 11px 0; padding: 10px; border: 1px solid var(--line); background: rgba(255,250,242,0.66); }
    .ai-state-row { display: grid; grid-template-columns: 58px minmax(0, 1fr); gap: 8px; color: var(--muted); font-size: 11px; line-height: 1.45; }
    .ai-state-row b { color: var(--ink); font-weight: 500; overflow-wrap: anywhere; }
    .ai-mode-switch { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; margin: 12px 0; }
    .ai-mode-option { min-height: 34px; padding: 0 8px; border: 1px solid var(--line); border-radius: 4px; background: var(--surface); color: var(--muted); font-size: 12px; }
    .ai-mode-option.active { border-color: var(--cinnabar); background: #fff1df; color: var(--cinnabar-dark); font-weight: 700; }
    .ai-reference-upload { margin: 0 0 12px; padding: 11px; border: 1px solid var(--line); background: rgba(255, 250, 242, 0.72); }
    .ai-reference-tip { margin: 0 0 9px; color: var(--muted); font-size: 12px; line-height: 1.5; }
    .reference-upload-control { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; align-items: center; min-height: 44px; padding: 8px 10px; border: 1px dashed var(--copper); background: #fffaf2; color: var(--ink); cursor: pointer; }
    .reference-upload-control input { position: absolute; width: 1px; height: 1px; overflow: hidden; opacity: 0; pointer-events: none; }
    .reference-upload-copy { display: grid; gap: 2px; min-width: 0; }
    .reference-upload-copy b { color: var(--cinnabar-dark); font-size: 12px; }
    .reference-upload-copy small { color: var(--muted); font-size: 11px; }
    .reference-upload-action { color: var(--cinnabar-dark); font-size: 12px; white-space: nowrap; }
    .ai-reference-preview { display: grid; grid-template-columns: 48px minmax(0, 1fr); gap: 9px; align-items: center; margin-top: 9px; padding-top: 9px; border-top: 1px solid var(--line); }
    .ai-reference-preview img { width: 48px; height: 48px; object-fit: cover; border: 1px solid var(--line); background: var(--surface); }
    .ai-reference-preview span { color: var(--muted); font-size: 11px; line-height: 1.45; overflow-wrap: anywhere; }
    .scheme-list { display: grid; grid-template-columns: repeat(2, 1fr); gap: 6px; margin-bottom: 10px; }
    .scheme-option { min-height: 31px; padding: 0 7px; border: 1px solid var(--line); background: var(--surface); color: var(--muted); border-radius: 4px; font-size: 12px; }
    .scheme-option.active, .scheme-option:hover { border-color: var(--copper); color: var(--cinnabar-dark); background: #fff2df; }
    .scheme-option:disabled { border-color: var(--line); color: #b9aa99; background: #f3eadc; cursor: not-allowed; }
    .ai-generate-row { display: flex; align-items: center; gap: 9px; }
    .ai-generate-row .button { flex: 1; }
    .reference-fill-toggle { display: inline-flex; align-items: center; flex: 0 0 auto; gap: 5px; color: var(--muted); font-size: 11px; white-space: nowrap; cursor: pointer; }
    .reference-fill-toggle input { accent-color: var(--cinnabar); }
    .reference-fill-toggle:has(input:disabled) { color: #b9aa99; cursor: not-allowed; }
    .ai-generation-progress { margin-top: 10px; padding: 10px; border: 1px solid var(--line); background: rgba(255, 250, 242, 0.76); }
    .ai-generation-progress[hidden] { display: none; }
    .ai-generation-progress-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; margin-bottom: 7px; color: var(--ink); font-size: 12px; line-height: 1.45; }
    .ai-generation-progress-head strong { font-weight: 700; }
    .ai-generation-progress-head span { flex: 0 0 auto; color: var(--muted); font-size: 10px; }
    .ai-progress-track { position: relative; height: 5px; overflow: hidden; background: #eadbc8; }
    .ai-progress-value { position: absolute; inset: 0 auto 0 0; width: 0; background: var(--cinnabar); transition: width 360ms ease; }
    .ai-generation-progress.is-generating .ai-progress-value::after { content: ""; position: absolute; inset: 0; width: 44px; background: linear-gradient(90deg, transparent, rgba(255,255,255,0.7), transparent); animation: ai-progress-shimmer 1.35s infinite; }
    .ai-generation-progress.is-success .ai-progress-value { background: #3d7a68; }
    .ai-generation-progress.is-error .ai-progress-value { background: #a33d34; }
    @keyframes ai-progress-shimmer { from { transform: translateX(-44px); } to { transform: translateX(calc(100% + 240px)); } }

    .form-shell { max-width: 1120px; margin: 0 auto; padding: 28px; border: 1px solid var(--line); background: var(--surface); box-shadow: var(--shadow); }
    .form-intro { display: flex; align-items: end; justify-content: space-between; gap: 20px; padding-bottom: 18px; border-bottom: 1px solid var(--line); }
    .form-intro p { margin: 0; color: var(--muted); }
    .form-columns { display: grid; grid-template-columns: 1fr 1fr; gap: 34px; padding: 22px 0; }
    .form-section + .form-section { border-left: 1px solid var(--line); padding-left: 34px; }
    .form-section h3 { margin-bottom: 16px; font-family: "STKaiti", "KaiTi", serif; font-size: 20px; }
    .field-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
    .field { display: grid; gap: 7px; }
    .field.full { grid-column: 1 / -1; }
    .field label { color: var(--ink); font-size: 13px; }
    .required { color: var(--cinnabar); }
    .field input, .field select, .field textarea { width: 100%; min-height: 38px; padding: 8px 10px; border: 1px solid var(--line); background: #fffdf9; color: var(--ink); border-radius: 4px; }
    .field textarea { min-height: 80px; resize: vertical; }
    .field small { color: var(--muted); font-size: 11px; }
    .contact-switch { display: grid; grid-template-columns: repeat(3, 1fr); gap: 5px; }
    .contact-switch button { min-height: 34px; border: 1px solid var(--line); background: var(--surface); color: var(--muted); border-radius: 4px; }
    .contact-switch button.active { border-color: var(--copper); background: #fff1de; color: var(--cinnabar-dark); font-weight: 700; }
    .submission-attachments { display: grid; gap: 7px; padding: 9px; border: 1px solid var(--line); background: #fffaf2; }
    .submission-attachment { display: grid; grid-template-columns: 36px minmax(0, 1fr) auto; align-items: center; gap: 9px; min-height: 50px; padding: 7px 8px; border: 1px solid #eadbc9; background: #fffdf9; }
    .submission-attachment.has-preview { grid-template-columns: 44px minmax(0, 1fr) auto; }
    .submission-file-type { display: grid; place-items: center; width: 36px; height: 32px; border: 1px solid #d9b691; background: #fff2e2; color: var(--cinnabar-dark); font: 700 10px/1 var(--font-sans); letter-spacing: .3px; }
    .submission-file-preview { display: block; width: 44px; height: 44px; object-fit: cover; border: 1px solid #d9b691; background: var(--paper); }
    .submission-file-copy { min-width: 0; display: grid; gap: 3px; }
    .submission-file-copy strong { overflow: hidden; color: var(--ink); font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
    .submission-file-copy small { color: var(--muted); font-size: 11px; }
    .submission-file-state { color: #3f7567; font-size: 11px; font-weight: 700; white-space: nowrap; }
    .submission-attachments .attachment-empty { margin: 2px; color: var(--muted); font-size: 12px; line-height: 1.55; }
    .submission-submit-state { display: inline-flex; align-items: center; gap: 7px; color: var(--muted); font-size: 12px; }
    .submission-submit-state[hidden] { display: none; }
    .submission-submit-state::before { width: 12px; height: 12px; border: 2px solid #d8baa1; border-top-color: var(--cinnabar); border-radius: 50%; content: ''; animation: submission-spin .75s linear infinite; }
    @keyframes submission-spin { to { transform: rotate(360deg); } }
    .agreement { display: flex; align-items: flex-start; gap: 8px; margin-top: 17px; color: var(--muted); font-size: 12px; line-height: 1.6; }
    .agreement input { margin: 3px 0 0; accent-color: var(--cinnabar); }
    .form-error { display: none; margin-top: 12px; padding: 10px 12px; border-left: 3px solid var(--cinnabar); background: #fff0eb; color: var(--cinnabar-dark); font-size: 13px; }
    .form-error.show { display: block; }
    .form-actions { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding-top: 20px; border-top: 1px solid var(--line); }
    .form-actions p { margin: 0; color: var(--muted); font-size: 12px; }

    .merchant-shell { max-width: 980px; margin: 32px auto 0; padding: 50px 32px 44px; border: 1px solid var(--line); background: var(--surface); text-align: center; }
    .success-seal { width: 64px; height: 64px; display: grid; place-items: center; margin: 0 auto 22px; border: 1px solid var(--jade); border-radius: 50%; color: var(--jade); font-family: Georgia, serif; font-size: 35px; line-height: 1; }
    .merchant-request { margin: 0 0 46px; color: var(--copper); font-family: Georgia, serif; font-size: 16px; letter-spacing: .05em; }
    .merchant-title { margin-bottom: 20px; font-size: 38px; }
    .merchant-intro { max-width: 780px; margin: 0 auto 40px; color: var(--muted); font-size: 17px; line-height: 1.8; }
    .wechat-card { width: min(100%, 388px); margin: 0 auto 32px; padding: 26px 26px 20px; background: #fff; box-shadow: 0 12px 28px rgba(73, 47, 27, .06); }
    .wechat-qr { display: block; width: 100%; aspect-ratio: 1; object-fit: contain; }
    .wechat-id { margin: 17px 0 0; color: var(--cinnabar-dark); font-size: 21px; line-height: 1.35; }
    .wechat-id strong { font-family: Georgia, serif; font-size: 25px; font-weight: 500; letter-spacing: .02em; }
    .merchant-actions { display: flex; justify-content: center; align-items: center; gap: 28px; }
    .merchant-actions .button.quiet { min-width: 150px; }
    .merchant-actions .button.primary { min-width: 176px; }

    .toast { position: fixed; right: 28px; bottom: 28px; z-index: 50; display: none; max-width: 360px; padding: 12px 15px; border-left: 3px solid var(--jade); color: var(--ink); background: #fffaf2; box-shadow: var(--shadow); line-height: 1.5; }
    .toast.show { display: block; animation: toast-in 180ms ease; }
    .toast.warn { border-left-color: var(--cinnabar); }
    @keyframes toast-in { from { transform: translateY(10px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }

    @media (max-width: 1240px) {
      .app-shell { width: calc(100% - 44px); }
      .lineart-layout { grid-template-columns: 270px minmax(0, 1fr); }
      .color-layout { grid-template-columns: 230px minmax(0, 1fr) 308px; }
      .inspector-panel { padding: 18px; }
      .current-color-summary { grid-template-columns: 24px minmax(88px, 112px) minmax(84px, 1fr); gap: 8px; }
      .current-color-label { font-size: 19px; }
      .metric-grid { gap: 5px; }
      .metric-group { padding: 6px; }
      .form-shell { max-width: 100%; }
    }
