
      :root {
        --bg: #f5f8f5;
        --surface: #ffffff;
        --surface-muted: #edf5f1;
        --surface-strong: #dcebe5;
        --ink: #10201b;
        --muted: #5b6c66;
        --line: rgba(16, 32, 27, 0.14);
        --accent: #17b7a2;
        --accent-strong: #0d7368;
        --accent-soft: rgba(23, 183, 162, 0.13);
        --slate: #17372f;
        --shadow: 0 22px 70px rgba(16, 32, 27, 0.12);
        --radius: 18px;
        --radius-sm: 12px;
        --max: 1540px;
      }

      @font-face {
        font-family: "Peace Sans";
        src: local("Peace Sans"), local("PeaceSans");
        font-display: swap;
      }

      * {
        box-sizing: border-box;
      }

      html,
      body {
        max-width: 100%;
        overflow-x: hidden;
      }

      body {
        margin: 0;
        min-height: 100vh;
        background:
          radial-gradient(circle at 8% 8%, rgba(219, 237, 40, 0.2), transparent 24rem),
          radial-gradient(circle at 74% 2%, rgba(63, 208, 198, 0.16), transparent 30rem),
          radial-gradient(circle at 94% 76%, rgba(37, 99, 235, 0.08), transparent 26rem),
          linear-gradient(180deg, #fbfcfa, var(--bg));
        color: var(--ink);
        font-family: "Open Sans", ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
      }

      a {
        color: inherit;
      }

      button,
      input,
      select {
        font: inherit;
      }

      .brand h1,
      .topbar a,
      .panel-header h2,
      .drop-card h2,
      .primary-button,
      .secondary-button,
      .danger-button {
        font-family: "Peace Sans", "Open Sans", ui-sans-serif, system-ui, sans-serif;
        letter-spacing: 0;
        font-weight: 700;
      }

      .app-shell {
        width: min(100% - 32px, var(--max));
        margin: 0 auto;
        padding: 22px 0 42px;
      }

      .topbar {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 18px;
        margin-bottom: 16px;
        padding: 10px 12px;
        border: 1px solid rgba(16, 32, 27, 0.1);
        border-radius: 999px;
        background: rgba(255, 255, 255, 0.72);
        box-shadow: 0 18px 48px rgba(16, 32, 27, 0.08);
        backdrop-filter: blur(18px);
      }

      .brand {
        display: flex;
        align-items: center;
        gap: 12px;
        min-width: 0;
      }

      .brand-mark {
        width: 38px;
        height: 38px;
        border-radius: 12px;
        background: #ffffff url("assets/favicon.png") center / cover no-repeat;
        box-shadow: 0 10px 26px rgba(16, 32, 27, 0.12);
      }

      .brand h1 {
        margin: 0;
        font-size: clamp(1.14rem, 1.7vw, 1.48rem);
        letter-spacing: 0;
        font-weight: 850;
      }

      .brand p {
        margin: 3px 0 0;
        color: var(--muted);
        font-size: 0.9rem;
      }

      .topbar a {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        min-height: 38px;
        padding: 0 14px;
        border: 1px solid var(--line);
        border-radius: 999px;
        background: rgba(255, 255, 255, 0.74);
        color: var(--ink);
        text-decoration: none;
        font-weight: 760;
        font-size: 0.9rem;
      }

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

      .language-switcher {
        display: flex;
        align-items: center;
        gap: 4px;
        padding: 5px;
        border: 1px solid rgba(16, 32, 27, 0.1);
        border-radius: 999px;
        background: rgba(255, 255, 255, 0.62);
        box-shadow: 0 12px 32px rgba(16, 32, 27, 0.08);
      }

      .language-switcher .language-icon {
        display: inline-flex;
        width: 19px;
        height: 19px;
        margin: 0 4px 0 7px;
        align-items: center;
        justify-content: center;
        opacity: 0.82;
        color: #111827;
      }

      .language-switcher .language-icon svg {
        width: 100%;
        height: 100%;
        display: block;
      }

      .language-switcher button {
        min-width: 38px;
        min-height: 32px;
        border: 0;
        border-radius: 999px;
        background: transparent;
        color: var(--ink);
        font-family: "Peace Sans", "Open Sans", ui-sans-serif, system-ui, sans-serif;
        font-size: 0.78rem;
        font-weight: 700;
        cursor: pointer;
      }

      .language-switcher button.is-active {
        background: #1455b7;
        color: #fff;
      }

      .privacy-note {
        display: flex;
        align-items: center;
        gap: 10px;
        margin: 0 0 18px;
        padding: 10px 14px;
        border: 1px solid var(--line);
        border-radius: 999px;
        background: rgba(255, 255, 255, 0.68);
        color: var(--ink);
        line-height: 1.4;
        font-size: 0.92rem;
        font-weight: 680;
      }

      .privacy-note::before {
        content: "\\2713";
        flex: 0 0 auto;
        width: 24px;
        height: 24px;
        display: grid;
        place-items: center;
        border-radius: 999px;
        background: var(--accent);
        color: white;
        font-weight: 900;
      }

      .tool-grid {
        display: grid;
        grid-template-columns: minmax(230px, 0.78fr) minmax(360px, 1.34fr) minmax(280px, 0.92fr);
        gap: 18px;
        align-items: start;
      }

      .panel {
        min-width: 0;
        border: 1px solid var(--line);
        border-radius: 22px;
        background: rgba(255, 255, 255, 0.76);
        box-shadow: 0 18px 54px rgba(16, 32, 27, 0.1);
        backdrop-filter: blur(18px);
        overflow: hidden;
      }

      .panel-header {
        padding: 18px 18px 14px;
        border-bottom: 1px solid var(--line);
        background: rgba(255, 255, 255, 0.48);
      }

      .panel-header h2 {
        margin: 0;
        font-size: 1rem;
        font-weight: 800;
      }

      .panel-header p {
        margin: 7px 0 0;
        color: var(--muted);
        line-height: 1.45;
        font-size: 0.91rem;
      }

      .panel-body {
        padding: 18px;
      }

      .drop-zone {
        min-height: 390px;
        display: grid;
        place-items: center;
        padding: 34px;
        border: 1px solid rgba(16, 32, 27, 0.12);
        border-radius: 20px;
        background:
          radial-gradient(circle at 28% 10%, rgba(219, 237, 40, 0.22), transparent 14rem),
          radial-gradient(circle at 80% 82%, rgba(63, 208, 198, 0.18), transparent 18rem),
          linear-gradient(135deg, rgba(255, 255, 255, 0.82), rgba(237, 245, 241, 0.76)),
          #ffffff;
        text-align: center;
        transition: border-color 180ms ease, transform 180ms ease, background 180ms ease, box-shadow 180ms ease;
      }

      .drop-zone.is-dragging {
        border-color: var(--accent);
        transform: translateY(-2px);
        background: var(--accent-soft);
        box-shadow: inset 0 0 0 1px rgba(23, 183, 162, 0.24);
      }

      .drop-zone input {
        position: absolute;
        opacity: 0;
        pointer-events: none;
      }

      .drop-card {
        max-width: 470px;
        min-width: 0;
      }

      .drop-icon {
        width: 76px;
        height: 76px;
        display: grid;
        place-items: center;
        margin: 0 auto 18px;
        border-radius: 24px;
        border: 1px solid var(--line);
        background: rgba(255, 255, 255, 0.88);
        color: var(--ink);
        font-size: 2rem;
        font-weight: 850;
        box-shadow: 0 18px 42px rgba(16, 32, 27, 0.1);
      }

      .drop-card h2 {
        margin: 0;
        font-size: clamp(1.7rem, 4vw, 3.15rem);
        line-height: 1;
        letter-spacing: 0;
        font-weight: 860;
      }

      .drop-card p {
        margin: 16px auto 22px;
        color: var(--muted);
        line-height: 1.55;
      }

      .secondary-button,
      .primary-button,
      .danger-button {
        min-height: 44px;
        border: 0;
        border-radius: 999px;
        padding: 0 18px;
        cursor: pointer;
        font-weight: 780;
        transition: transform 170ms ease, box-shadow 170ms ease, opacity 170ms ease;
      }

      .secondary-button {
        border: 1px solid var(--line);
        background: #ffffff;
        color: var(--ink);
      }

      .primary-button {
        width: 100%;
        background: linear-gradient(135deg, #dbed28 0%, #3fd0c6 54%, #48a6ff 100%);
        color: #071512;
        box-shadow: 0 16px 36px rgba(23, 183, 162, 0.2);
      }

      .danger-button {
        background: #11241f;
        color: white;
      }

      .secondary-button:hover,
      .primary-button:hover,
      .danger-button:hover {
        transform: translateY(-2px);
      }

      button:disabled {
        cursor: not-allowed;
        opacity: 0.52;
        transform: none !important;
        box-shadow: none;
      }

      .file-status {
        display: grid;
        gap: 12px;
        margin-top: 16px;
      }

      .status-card {
        padding: 15px;
        border-radius: 16px;
        background: rgba(237, 245, 241, 0.62);
        border: 1px solid var(--line);
      }

      .status-card strong {
        display: block;
        margin-bottom: 4px;
      }

      .status-card span {
        color: var(--muted);
      }

      .page-tools {
        display: grid;
        gap: 10px;
        margin-bottom: 14px;
      }

      .range-row {
        display: grid;
        grid-template-columns: 1fr auto;
        gap: 8px;
      }

      .range-row input,
      select,
      .field input[type="text"] {
        width: 100%;
        min-height: 44px;
        border: 1px solid var(--line);
        border-radius: 999px;
        padding: 0 14px;
        background: white;
        color: var(--ink);
        outline: none;
      }

      .quick-actions {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 8px;
      }

      .page-list {
        max-height: 58vh;
        overflow: auto;
        display: grid;
        gap: 8px;
        padding-right: 4px;
      }

      .page-item {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 10px;
        padding: 10px 12px;
        border: 1px solid var(--line);
        border-radius: 12px;
        background: white;
      }

      .page-item label {
        display: flex;
        align-items: center;
        gap: 9px;
        font-weight: 720;
      }

      .page-badge {
        color: var(--muted);
        font-size: 0.83rem;
      }

      .empty-state {
        padding: 18px;
        border-radius: var(--radius-sm);
        background: var(--surface-muted);
        color: var(--muted);
        line-height: 1.45;
      }

      .field {
        display: grid;
        gap: 8px;
        margin-bottom: 16px;
      }

      .field label,
      .field-label {
        color: var(--ink);
        font-weight: 760;
        font-size: 0.92rem;
      }

      .ai-help-box {
        padding: 14px;
        border: 1px solid var(--line);
        border-radius: 16px;
        background: rgba(255, 255, 255, 0.58);
      }

      .ai-help-box p {
        margin: 0 0 12px;
        color: var(--muted);
        font-size: 0.88rem;
        line-height: 1.45;
      }

      .ai-help-grid {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 8px;
      }

      .ai-help-grid label {
        display: flex;
        align-items: center;
        gap: 9px;
        min-height: 40px;
        padding: 8px 10px;
        border: 1px solid var(--line);
        border-radius: 999px;
        background: #ffffff;
        font-size: 0.84rem;
        font-weight: 680;
      }

      .other-help {
        margin-top: 10px;
      }

      .slider-head {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 12px;
      }

      .slider-value {
        min-width: 58px;
        min-height: 34px;
        display: inline-grid;
        place-items: center;
        border-radius: 999px;
        background: var(--accent-soft);
        color: var(--accent-strong);
        font-weight: 820;
      }

      input[type="range"] {
        width: 100%;
        accent-color: var(--accent);
      }

      .setting-grid {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 12px;
      }

      .layer-options {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 10px;
      }

      .layer-option {
        position: relative;
        display: grid;
        min-height: 92px;
        place-items: center;
        gap: 8px;
        border: 1px solid var(--line);
        border-radius: var(--radius-sm);
        padding: 12px;
        background: rgba(255, 255, 255, 0.7);
        color: var(--muted);
        text-align: center;
        transition: border-color 180ms ease, box-shadow 180ms ease, transform 180ms ease;
      }

      .layer-option input {
        position: absolute;
        inset: 0;
        opacity: 0;
      }

      .layer-option span {
        display: grid;
        width: 34px;
        height: 34px;
        place-items: center;
        border-radius: 10px;
        background: var(--surface-muted);
        font-weight: 820;
      }

      .layer-option strong {
        color: inherit;
        font-size: 14px;
        line-height: 1.2;
      }

      .layer-option:has(input:checked) {
        border-color: var(--accent);
        color: var(--accent-strong);
        box-shadow: 0 14px 34px rgba(23, 183, 162, 0.16);
        transform: translateY(-2px);
      }

      .log {
        min-height: 170px;
        max-height: 280px;
        overflow: auto;
        margin: 16px 0;
        padding: 14px;
        border: 1px solid var(--line);
        border-radius: 16px;
        background: rgba(255, 255, 255, 0.62);
        color: var(--ink);
        font-size: 0.88rem;
        line-height: 1.55;
      }

      .log p {
        margin: 0 0 9px;
      }

      .rule-chip {
        display: inline-block;
        margin: 0 6px 6px 0;
        padding: 6px 9px;
        border-radius: 999px;
        border: 1px solid rgba(16, 32, 27, 0.1);
        background: rgba(237, 245, 241, 0.74);
        color: var(--ink);
        font-weight: 650;
      }

      .audit-note {
        margin: 12px 0 0;
        color: var(--muted);
        font-size: 0.9rem;
        line-height: 1.45;
      }

      .field-hint {
        margin: 8px 0 0;
        color: var(--muted);
        font-size: 0.82rem;
        line-height: 1.4;
      }

      @media (max-width: 1080px) {
        .tool-grid {
          grid-template-columns: 1fr;
        }

        .page-list {
          max-height: 340px;
        }
      }

      @media (max-width: 620px) {
        .app-shell {
          width: min(100% - 20px, var(--max));
          padding-top: 12px;
        }

        .topbar {
          align-items: flex-start;
          flex-direction: column;
          border-radius: 22px;
        }

        .topbar-actions {
          align-items: stretch;
          flex-direction: column;
          width: 100%;
        }

        .topbar a {
          width: 100%;
        }

        .language-switcher {
          justify-content: center;
        }

        .privacy-note {
          align-items: flex-start;
          border-radius: 18px;
        }

        .drop-zone {
          min-height: 240px;
          padding: 22px;
        }

        .ai-help-grid,
        .range-row,
        .setting-grid,
        .layer-options,
        .quick-actions {
          grid-template-columns: 1fr;
        }
      }
    