    /* 插画 / 绘本风界面（牛马发票工具） */

    :root {
      /* 插画 / 绘本配色 */
      --ill-ink: #3d3a5c;
      --ill-ink-light: #5c5678;
      --ill-paper: #fffdf8;
      --ill-cream: #fff5ec;
      --ill-lav: #c4b5fd;
      --ill-lav-deep: #8b7cf7;
      --ill-mint: #a7f3d0;
      --ill-mint-deep: #34d399;
      --ill-peach: #fecdd3;
      --ill-sky: #bae6fd;
      --ill-sun: #fef3c7;
      /* 兼容 merge-fields.css 中的 --orange 系列 */
      --orange: var(--ill-lav-deep);
      --orange-dark: #6d5bd4;
      --orange-soft: #ede9fe;
      --orange-glow: rgba(139, 124, 247, 0.28);
      --text: var(--ill-ink);
      --muted: var(--ill-ink-light);
      --white: #ffffff;
      --glass-highlight: rgba(255, 255, 255, 0.78);
      --safe-top: env(safe-area-inset-top, 0px);
      --safe-bottom: env(safe-area-inset-bottom, 0px);
      --sticker-shadow: 4px 4px 0 rgba(61, 58, 92, 0.92);
      --card-radius: clamp(22px, 5vw, 32px);
    }

    * { box-sizing: border-box; }

    html {
      -webkit-text-size-adjust: 100%;
    }

    body {
      margin: 0;
      min-height: 100vh;
      min-height: 100dvh;
      font-family: "Nunito", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei UI", system-ui, sans-serif;
      color: var(--text);
      line-height: 1.6;
      -webkit-font-smoothing: antialiased;
    }

    .page-root {
      position: relative;
      min-height: 100vh;
      min-height: 100dvh;
      display: flex;
      align-items: center;
      justify-content: center;
      padding: calc(var(--safe-top) + clamp(2.25rem, 7vw, 3.5rem))
        max(env(safe-area-inset-right, 0px), clamp(1rem, 4vw, 1.5rem))
        calc(var(--safe-bottom) + clamp(1rem, 5vw, 2rem))
        max(env(safe-area-inset-left, 0px), clamp(1rem, 4vw, 1.5rem));
      overflow-x: hidden;
      overflow-y: visible;
      background-color: #dbeafe;
      background-image:
        radial-gradient(ellipse 90% 70% at 8% 18%, rgba(255, 210, 230, 0.75) 0%, transparent 52%),
        radial-gradient(ellipse 80% 60% at 92% 12%, rgba(254, 243, 199, 0.85) 0%, transparent 48%),
        radial-gradient(ellipse 70% 55% at 78% 88%, rgba(167, 243, 208, 0.65) 0%, transparent 50%),
        radial-gradient(ellipse 65% 50% at 12% 82%, rgba(196, 181, 253, 0.55) 0%, transparent 48%),
        radial-gradient(circle at 50% 50%, rgba(255, 255, 255, 0.35) 0%, transparent 55%),
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='56' height='56' viewBox='0 0 56 56'%3E%3Ccircle cx='8' cy='10' r='1.5' fill='%23ffffff' opacity='0.5'/%3E%3Ccircle cx='36' cy='44' r='1.2' fill='%23ffffff' opacity='0.35'/%3E%3C/svg%3E");
      background-size: auto, auto, auto, auto, auto, 56px 56px;
    }

    .blob {
      position: absolute;
      border-radius: 50%;
      filter: blur(72px);
      pointer-events: none;
      opacity: 0.55;
    }
    .blob-a {
      width: min(72vw, 420px);
      height: min(72vw, 420px);
      background: rgba(196, 181, 253, 0.55);
      top: -8%;
      right: -12%;
    }
    .blob-b {
      width: min(65vw, 360px);
      height: min(65vw, 360px);
      background: rgba(167, 243, 208, 0.5);
      bottom: -5%;
      left: -18%;
    }

    @media (prefers-reduced-motion: no-preference) {
      .blob-a, .blob-b {
        animation: blob-drift 18s ease-in-out infinite alternate;
      }
      .blob-b {
        animation-delay: -6s;
        animation-duration: 22s;
      }
    }

    @keyframes blob-drift {
      from { transform: translate(0, 0) scale(1); }
      to { transform: translate(12px, -16px) scale(1.05); }
    }

    .glass-panel {
      position: relative;
      z-index: 1;
      max-width: 100%;
      overflow: visible;
      border-radius: var(--card-radius);
      padding: 5px;
      background: linear-gradient(
        135deg,
        var(--ill-lav) 0%,
        var(--ill-mint) 42%,
        var(--ill-peach) 100%
      );
      box-shadow:
        0 4px 0 rgba(61, 58, 92, 0.12),
        0 20px 50px rgba(91, 76, 180, 0.15);
      backdrop-filter: blur(14px) saturate(130%);
      -webkit-backdrop-filter: blur(14px) saturate(130%);
    }

    .glass-panel::before {
      content: "";
      position: absolute;
      inset: 0;
      border-radius: inherit;
      padding: 5px;
      background: linear-gradient(
        160deg,
        rgba(255, 255, 255, 0.5) 0%,
        transparent 45%,
        rgba(255, 255, 255, 0.25) 100%
      );
      -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
      mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
      -webkit-mask-composite: xor;
      mask-composite: exclude;
      pointer-events: none;
    }

    .content-inner {
      position: relative;
      overflow: visible;
      background: var(--ill-paper);
      border-radius: calc(var(--card-radius) - 6px);
      padding: clamp(2.85rem, 9vw, 4.5rem) clamp(1.25rem, 4.5vw, 2rem) clamp(1.25rem, 4.5vw, 2rem);
      border: 3px solid var(--ill-ink);
      box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.65);
    }

    .brand-logo-wrap {
      display: flex;
      justify-content: center;
      width: 100%;
      margin-top: clamp(-4.75rem, -15vw, -3.25rem);
      margin-bottom: clamp(-4.25rem, -13vw, -3rem);
      position: relative;
      z-index: 3;
      pointer-events: none;
    }

    .brand-logo-wrap .brand-logo-hit {
      pointer-events: auto;
    }

    .brand-logo-hit {
      position: relative;
      width: clamp(5.5rem, 32vw, 8.75rem);
      height: clamp(5.5rem, 32vw, 8.75rem);
      border-radius: 50%;
      overflow: hidden;
      flex-shrink: 0;
      cursor: default;
      border: 4px solid var(--ill-ink);
      box-shadow: var(--sticker-shadow);
      transition:
        box-shadow 0.35s ease,
        transform 0.42s cubic-bezier(0.34, 1.25, 0.64, 1);
    }

    .brand-logo-hit:hover {
      box-shadow: 6px 6px 0 rgba(61, 58, 92, 0.88);
      transform: scale(1.05) rotate(-2deg);
    }

    .brand-logo-layer {
      position: absolute;
      inset: 0;
      width: 100%;
      height: 100%;
      object-fit: cover;
      object-position: center;
      transition:
        opacity 0.4s ease,
        transform 0.42s cubic-bezier(0.34, 1.2, 0.64, 1);
    }

    .brand-logo-layer--hover {
      opacity: 0;
      transform: scale(1.12);
    }

    .brand-logo-hit:hover .brand-logo-layer--default {
      opacity: 0;
      transform: scale(0.88);
    }

    .brand-logo-hit:hover .brand-logo-layer--hover {
      opacity: 1;
      transform: scale(1);
    }

    @media (prefers-reduced-motion: reduce) {
      .brand-logo-hit,
      .brand-logo-layer {
        transition-duration: 0.01ms !important;
      }
      .brand-logo-hit:hover {
        transform: none;
      }
      .brand-logo-hit:hover .brand-logo-layer--default,
      .brand-logo-hit:hover .brand-logo-layer--hover {
        transform: none;
      }
    }

    h1 {
      font-size: clamp(1.2rem, 4.2vw, 1.55rem);
      font-weight: 800;
      margin: 0 0 0.45rem;
      letter-spacing: 0.03em;
      line-height: 1.25;
      color: var(--ill-ink);
      text-shadow:
        3px 3px 0 var(--ill-peach),
        -1px -1px 0 rgba(255, 255, 255, 0.9);
    }

    @media (prefers-reduced-motion: no-preference) {
      h1 {
        animation: title-float 4s ease-in-out infinite;
      }
    }

    @keyframes title-float {
      0%,
      100% {
        transform: translateY(0);
      }
      50% {
        transform: translateY(-3px);
      }
    }

    @media (prefers-reduced-motion: reduce) {
      h1 {
        animation: none;
      }
    }

    .sub {
      color: var(--muted);
      font-size: clamp(0.8125rem, 2.8vw, 0.9rem);
      margin: 0 0 1.35rem;
      max-width: min(48em, 100%);
    }

    .sub strong {
      color: var(--orange-dark);
      font-weight: 600;
    }

    .panel {
      margin: 0;
    }

    /** 主工具卡片 + 识别结果卡片并列 */
    .app-panels {
      position: relative;
      z-index: 1;
      display: flex;
      flex-direction: column;
      align-items: center;
      gap: 1.25rem;
      width: 100%;
      max-width: min(100%, 38rem);
    }
    .app-panels:has(#invoiceArea:not([hidden])) {
      max-width: min(100%, 80rem);
    }
    .glass-panel--main {
      width: min(100%, 38rem);
    }
    .glass-panel--results {
      width: min(100%, 38rem);
    }
    @media (min-width: 900px) {
      .app-panels:has(#invoiceArea:not([hidden])) {
        flex-direction: row;
        align-items: flex-start;
        justify-content: center;
        gap: 1.35rem;
      }
      .app-panels:has(#invoiceArea:not([hidden])) .glass-panel--main {
        flex: 0 1 min(100%, 38rem);
      }
      .glass-panel--results:not([hidden]) {
        flex: 0 0 clamp(320px, 46vw, 640px);
        width: clamp(320px, 46vw, 640px);
        position: sticky;
        top: max(0.75rem, env(safe-area-inset-top, 0px));
        align-self: flex-start;
        max-height: calc(100vh - 2rem);
      }
    }

    .content-inner--results {
      padding: clamp(1.35rem, 4vw, 2rem) clamp(1.1rem, 4vw, 1.75rem) clamp(1.1rem, 4vw, 1.75rem);
      display: flex;
      flex-direction: column;
      min-height: 0;
      max-height: min(calc(100vh - 3rem), 92vh);
    }
    @media (min-width: 900px) {
      .glass-panel--results:not([hidden]) .content-inner--results {
        max-height: calc(100vh - 2.5rem);
      }
    }

    #invoiceArea {
      position: relative;
    }
    #invoiceArea:not([hidden]) .results-card {
      flex: 1;
      min-height: 0;
      display: flex;
      flex-direction: column;
      overflow: hidden;
    }

    .results-card {
      display: flex;
      flex-direction: column;
      gap: 0.65rem;
      min-height: 0;
      flex: 1;
      overflow: hidden;
      padding: 0.85rem 1rem 1rem;
      background: linear-gradient(165deg, #ffffff 0%, var(--ill-paper) 50%, var(--ill-cream) 100%);
      border: 3px dashed rgba(61, 58, 92, 0.28);
      border-radius: 18px;
      box-shadow:
        0 2px 0 rgba(255, 255, 255, 0.85) inset,
        0 10px 28px rgba(91, 76, 180, 0.1);
    }
    .results-card-title {
      margin: 0;
      font-size: clamp(0.85rem, 2.6vw, 0.95rem);
      font-weight: 800;
      color: var(--ill-ink);
      letter-spacing: 0.04em;
      padding-bottom: 0.35rem;
      border-bottom: 2px solid rgba(139, 124, 247, 0.35);
    }

    .sample-preview-lightbox {
      position: fixed;
      inset: 0;
      z-index: 10000;
      display: flex;
      align-items: center;
      justify-content: center;
      padding: max(1rem, env(safe-area-inset-top)) max(1rem, env(safe-area-inset-right))
        max(1rem, env(safe-area-inset-bottom)) max(1rem, env(safe-area-inset-left));
      box-sizing: border-box;
      opacity: 0;
      visibility: hidden;
      transition: opacity 0.2s ease, visibility 0.2s ease;
    }
    .sample-preview-lightbox.is-open {
      opacity: 1;
      visibility: visible;
    }
    .sample-preview-lightbox[hidden] {
      display: none !important;
    }
    .sample-preview-lightbox:not([hidden]) {
      display: flex;
    }
    .sample-preview-lightbox__backdrop {
      position: absolute;
      inset: 0;
      background: rgba(61, 58, 92, 0.45);
      cursor: zoom-out;
    }
    .sample-preview-lightbox__panel {
      position: relative;
      z-index: 1;
      max-width: min(94vw, 720px);
      max-height: 92vh;
    }
    .sample-preview-lightbox__close {
      position: absolute;
      top: -0.35rem;
      right: -0.35rem;
      z-index: 2;
      width: 2.35rem;
      height: 2.35rem;
      padding: 0;
      border: none;
      border-radius: 50%;
      font-size: 1.4rem;
      line-height: 1;
      color: #fff;
      background: rgba(28, 25, 23, 0.75);
      cursor: pointer;
      display: flex;
      align-items: center;
      justify-content: center;
      box-shadow: 0 2px 12px rgba(0, 0, 0, 0.25);
    }
    .sample-preview-lightbox__close:hover {
      background: var(--ill-lav-deep);
    }
    .sample-preview-lightbox__close:focus-visible {
      outline: 2px solid #fff;
      outline-offset: 2px;
    }
    .sample-preview-lightbox__img {
      display: block;
      max-width: 100%;
      max-height: min(88vh, 1000px);
      width: auto;
      height: auto;
      margin: 0 auto;
      border-radius: 10px;
      background: #fff;
      box-shadow: 0 24px 64px rgba(0, 0, 0, 0.38);
    }

    label {
      display: block;
      font-size: clamp(0.75rem, 2.5vw, 0.8125rem);
      font-weight: 500;
      color: var(--muted);
      margin-bottom: 0.4rem;
    }

    .row { margin-bottom: 1.15rem; }

    input[type="url"],
    input[type="text"] {
      width: 100%;
      max-width: 100%;
      box-sizing: border-box;
      padding: 0.65rem 0.85rem;
      font-size: max(16px, 0.875rem);
      color: var(--text);
      background: var(--white);
      border: 2px solid rgba(61, 58, 92, 0.2);
      border-radius: 14px;
      box-shadow: inset 0 2px 0 rgba(255, 255, 255, 0.7);
    }

    label.inline {
      display: flex;
      align-items: center;
      gap: 0.5rem;
      margin-bottom: 0;
      cursor: pointer;
      font-weight: 500;
    }
    label.inline input[type="checkbox"] {
      width: auto;
      accent-color: var(--ill-lav-deep);
    }

    input[type="file"] {
      width: 100%;
      max-width: 100%;
      min-height: 2.75rem;
      padding: 0.65rem 0.85rem;
      font-size: max(16px, 0.875rem);
      color: var(--text);
      background: var(--ill-cream);
      border: 2px dashed rgba(61, 58, 92, 0.35);
      border-radius: 16px;
      cursor: pointer;
      transition: border-color 0.2s, background 0.2s, box-shadow 0.2s;
    }

    input[type="file"]::file-selector-button {
      margin-right: 0.75rem;
      padding: 0.45rem 0.9rem;
      font-size: max(14px, 0.8125rem);
      font-weight: 700;
      color: var(--ill-ink);
      background: var(--ill-mint);
      border: 2px solid var(--ill-ink);
      border-radius: 999px;
      cursor: pointer;
      box-shadow: 2px 2px 0 rgba(61, 58, 92, 0.85);
    }

    input[type="file"]:hover {
      border-color: rgba(61, 58, 92, 0.55);
      background: var(--white);
      box-shadow: inset 0 0 0 1px rgba(139, 124, 247, 0.15);
    }

    .actions {
      display: flex;
      flex-wrap: wrap;
      gap: 0.5rem 0.65rem;
      margin-top: 0.35rem;
      align-items: center;
    }

    .btn {
      appearance: none;
      border: 3px solid var(--ill-ink);
      background: linear-gradient(180deg, var(--ill-mint) 0%, #7ee0bc 100%);
      color: var(--ill-ink);
      font-size: max(15px, 0.9rem);
      font-weight: 800;
      padding: 0.65rem 1.35rem;
      border-radius: 999px;
      cursor: pointer;
      box-shadow: var(--sticker-shadow);
      transition: transform 0.15s ease, box-shadow 0.15s ease, filter 0.15s ease;
    }

    .btn:hover:not(:disabled) {
      filter: brightness(1.03);
      transform: translate(-1px, -1px);
      box-shadow: 5px 5px 0 rgba(61, 58, 92, 0.92);
    }

    .btn:active:not(:disabled) {
      transform: translate(2px, 2px);
      box-shadow: 2px 2px 0 rgba(61, 58, 92, 0.92);
    }

    .btn:disabled {
      opacity: 0.45;
      cursor: not-allowed;
      box-shadow: none;
      transform: none;
    }

    .btn.secondary {
      background: linear-gradient(180deg, var(--ill-paper) 0%, var(--ill-cream) 100%);
      color: var(--ill-ink);
      border: 3px solid var(--ill-ink);
      box-shadow: 3px 3px 0 rgba(61, 58, 92, 0.75);
    }

    .btn.secondary:hover:not(:disabled) {
      background: var(--orange-soft);
      filter: none;
      transform: translate(-1px, -1px);
      box-shadow: 4px 4px 0 rgba(61, 58, 92, 0.8);
    }

    .err {
      color: #b91c5c;
      font-size: 0.85rem;
      margin-top: 0.85rem;
      font-weight: 600;
    }

    .site-beian {
      margin: 1.1rem 0 0;
      padding-top: 0.65rem;
      border-top: 2px dashed rgba(61, 58, 92, 0.15);
      text-align: center;
      font-size: clamp(0.68rem, 2.3vw, 0.76rem);
      color: var(--muted);
    }

    .site-beian a {
      color: inherit;
      text-decoration: none;
    }

    .site-beian a:hover {
      color: var(--orange-dark);
      text-decoration: underline;
    }

    .local-serve-warn {
      margin: 0 0 1rem;
      padding: 0.75rem 0.95rem;
      font-size: clamp(0.78rem, 2.6vw, 0.85rem);
      line-height: 1.55;
      color: var(--ill-ink);
      background: var(--ill-sun);
      border: 3px solid var(--ill-ink);
      border-radius: 16px;
      box-shadow: 3px 3px 0 rgba(61, 58, 92, 0.2);
    }

    .local-serve-warn code {
      font-size: 0.9em;
      padding: 0.08em 0.35em;
      border-radius: 8px;
      background: rgba(255, 255, 255, 0.9);
      border: 1px solid rgba(61, 58, 92, 0.18);
      word-break: break-all;
    }

    /* ── totals bar ── */
    .totals-bar {
      margin-top: 0;
      flex-shrink: 0;
      padding: 0.85rem 1rem;
      background: linear-gradient(135deg, var(--ill-sky) 0%, var(--orange-soft) 100%);
      border: 2px solid rgba(61, 58, 92, 0.2);
      border-radius: 16px;
      display: grid;
      grid-template-columns: auto 1fr;
      gap: 0.15rem 1rem;
      align-items: baseline;
    }
    .totals-bar .tl { font-size: 0.78rem; font-weight: 600; color: var(--muted); }
    .totals-bar .tv {
      font-size: clamp(1.1rem, 4vw, 1.35rem);
      font-weight: 700;
      color: var(--orange-dark);
      font-variant-numeric: tabular-nums;
      letter-spacing: -0.02em;
    }
    .totals-bar .tv--text { color: var(--text); }

    /* 右侧字段表 / 面包屑：merge-fields.css */

    .inv-loading {
      text-align: center;
      padding: 1rem 0;
      color: var(--muted);
      font-size: 0.85rem;
    }
