﻿    :root {
      --primary: #1f8fe5;
      --primary-dark: #1277c6;
      --danger: #e45c5c;
      --bg: #ececec;
      --dot: #dddddd;
      --surface: #ffffff;
      --surface-soft: #f7f8fa;
      --surface-raised: rgba(255, 255, 255, 0.92);
      --text: #1f2937;
      --muted: #6b7280;
      --border: #e5e7eb;
      --warning-bg: #fcf8e3;
      --warning-border: #faebcc;
      --warning-text: #8a6d3b;
      --shadow: 0 2px 10px rgba(15, 23, 42, 0.06);
      --shadow-lg: 0 18px 45px rgba(15, 23, 42, 0.12);
      color-scheme: light;
      font-family: "PingFang SC", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
    }

    html.dark {
      --bg: #0b1220;
      --dot: #1b2536;
      --surface: #111827;
      --surface-soft: #1f2937;
      --surface-raised: rgba(17, 24, 39, 0.92);
      --text: #e5e7eb;
      --muted: #94a3b8;
      --border: #334155;
      --warning-bg: rgba(120, 53, 15, 0.22);
      --warning-border: rgba(217, 119, 6, 0.46);
      --warning-text: #fcd34d;
      --shadow: 0 8px 24px rgba(2, 6, 23, 0.35);
      --shadow-lg: 0 20px 55px rgba(0, 0, 0, 0.42);
      color-scheme: dark;
    }

    * {
      box-sizing: border-box;
    }

    html {
      scroll-behavior: smooth;
    }

    body {
      min-height: 100vh;
      margin: 0;
      color: var(--text);
      background-color: var(--bg);
      background-image: radial-gradient(circle, var(--dot) 1.2px, transparent 1.3px);
      background-size: 16px 16px;
      -webkit-font-smoothing: antialiased;
      text-rendering: optimizeLegibility;
    }

    a {
      color: inherit;
      text-decoration: none;
    }

    button,
    input {
      font: inherit;
    }

    button {
      cursor: pointer;
    }

    .shell {
      width: min(100%, 48rem);
      margin-inline: auto;
      padding-inline: 1rem;
    }

    .site-header {
      position: sticky;
      top: 0.75rem;
      z-index: 50;
      padding: 0 1rem;
    }

    .nav-shell {
      width: min(100%, 48rem);
      height: 3.5rem;
      margin: 0 auto;
      padding: 0 1rem;
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 1rem;
      border: 1px solid var(--border);
      border-radius: 999px;
      background: var(--surface-raised);
      box-shadow: var(--shadow);
      backdrop-filter: blur(8px);
    }

    .brand {
      display: inline-flex;
      align-items: center;
      gap: 0.6rem;
      min-width: 0;
      font-weight: 800;
      letter-spacing: 0;
      white-space: nowrap;
    }

    .brand-mark {
      width: 2rem;
      height: 2rem;
      display: grid;
      place-items: center;
      border-radius: 50%;
      color: #fff;
      background:
        radial-gradient(circle at 52% 62%, #ff8c8c 0 16%, transparent 17%),
        linear-gradient(145deg, #ff5757, #d93333);
      box-shadow: inset 0 -5px 9px rgba(74, 0, 0, 0.14);
      font-size: 1.1rem;
    }

    .brand-mark::before {
      content: "";
      width: 0.8rem;
      height: 0.46rem;
      margin-top: -1.1rem;
      border-radius: 999px 999px 0 999px;
      background: #3aa35d;
      transform: rotate(-24deg);
    }

    .nav-links {
      display: flex;
      align-items: center;
      gap: 0.25rem;
    }

    .nav-link {
      padding: 0.5rem 1rem;
      border-radius: 999px;
      color: var(--muted);
      font-size: 0.875rem;
      transition: color 0.16s, background 0.16s;
    }

    .nav-link:hover {
      color: var(--primary);
      background: var(--surface-soft);
    }

    .nav-link.active {
      color: #fff;
      background: var(--primary);
    }

    .mobile-menu-button {
      display: none;
      width: 2.25rem;
      height: 2.25rem;
      align-items: center;
      justify-content: center;
      border: 0;
      border-radius: 999px;
      color: var(--muted);
      background: transparent;
    }

    .mobile-menu-button:hover {
      background: var(--surface-soft);
      color: var(--primary);
    }

    .mobile-menu {
      display: none;
      width: min(calc(100% - 2rem), 48rem);
      margin: 0.5rem auto 0;
      padding: 0.5rem;
      border: 1px solid var(--border);
      border-radius: 1rem;
      background: var(--surface);
      box-shadow: var(--shadow);
    }

    .mobile-menu.open {
      display: block;
    }

    .mobile-menu a {
      display: block;
      padding: 0.65rem 0.75rem;
      border-radius: 0.75rem;
      color: var(--muted);
      font-size: 0.9rem;
    }

    .mobile-menu a.active {
      color: #fff;
      background: var(--primary);
    }

    .hero {
      padding: 2rem 0 1.25rem;
      text-align: center;
    }

    h1,
    h2,
    h3,
    p {
      margin: 0;
    }

    h1 {
      margin: 1rem 0 0.55rem;
      font-size: clamp(1.55rem, 4vw, 2rem);
      line-height: 1.2;
    }

    .subtitle {
      max-width: 42rem;
      margin: 0 auto;
      padding-inline: 1rem;
      color: var(--muted);
      font-size: 0.96rem;
      line-height: 1.65;
    }

    .tool {
      padding: 1.125rem;
      border: 1px solid var(--border);
      border-radius: 1.5rem;
      background: var(--surface);
      box-shadow: var(--shadow);
    }

    .tip {
      margin-bottom: 0.875rem;
      padding: 0.75rem 0.875rem;
      border: 1px solid var(--warning-border);
      border-radius: 0.75rem;
      color: var(--warning-text);
      background: var(--warning-bg);
      font-size: 0.82rem;
      line-height: 1.6;
    }

    .settings {
      margin-bottom: 0.875rem;
      padding: 0.875rem;
      display: grid;
      grid-template-columns: minmax(12rem, 1.2fr) minmax(11rem, 1fr) 6.5rem;
      gap: 0.75rem;
      border: 1px solid var(--border);
      border-radius: 0.9rem;
      background: var(--surface-soft);
    }

    .field {
      display: grid;
      gap: 0.38rem;
      min-width: 0;
    }

    .field span {
      color: var(--muted);
      font-size: 0.78rem;
      font-weight: 650;
    }

    .field select,
    .field input {
      width: 100%;
      min-height: 2.45rem;
      padding: 0 0.7rem;
      border: 1px solid var(--border);
      border-radius: 0.7rem;
      color: var(--text);
      background: var(--surface);
      outline: none;
    }

    .field select:focus,
    .field input:focus {
      border-color: var(--primary);
      box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 18%, transparent);
    }

    .mode-hint {
      grid-column: 1 / -1;
      color: var(--muted);
      font-size: 0.78rem;
      line-height: 1.55;
    }

    .param-error {
      grid-column: 1 / -1;
      min-height: 1.2rem;
      color: var(--danger);
      font-size: 0.78rem;
      font-weight: 650;
      line-height: 1.5;
    }

    .param-error:empty {
      display: none;
    }

    .image-area {
      position: relative;
      margin-bottom: 0.875rem;
    }

    .placeholder {
      min-height: 17.5rem;
      padding: 2rem;
      display: flex;
      flex-direction: column;
      align-items: center;
      justify-content: center;
      gap: 0.8rem;
      border: 1px dashed var(--border);
      border-radius: 0.9rem;
      color: var(--muted);
      background: var(--surface-soft);
      transition: border-color 0.18s, background 0.18s, transform 0.18s;
    }

    .placeholder:hover,
    .placeholder.dragging {
      border-color: var(--primary);
      background: color-mix(in srgb, var(--surface-soft) 88%, var(--primary) 12%);
      transform: translateY(-1px);
    }

    .placeholder-icon {
      width: 3.5rem;
      height: 3.5rem;
      display: grid;
      place-items: center;
      border: 1px solid var(--border);
      border-radius: 50%;
      background: var(--surface);
      color: var(--primary);
    }

    .placeholder strong {
      color: var(--text);
      font-size: 1rem;
    }

    .placeholder small {
      max-width: 26rem;
      color: var(--muted);
      text-align: center;
      line-height: 1.55;
    }

    .image-wrapper {
      border: 1px solid var(--border);
      border-radius: 0.9rem;
      overflow: hidden;
      background: var(--surface-soft);
      line-height: 0;
    }

    .image-wrapper[hidden],
    .placeholder[hidden],
    .loading[hidden],
    .download[hidden] {
      display: none;
    }

    #preview {
      width: 100%;
      max-height: 31.25rem;
      display: block;
      object-fit: contain;
    }

    .loading {
      position: absolute;
      inset: 0;
      display: flex;
      flex-direction: column;
      align-items: center;
      justify-content: center;
      gap: 0.75rem;
      border-radius: 0.9rem;
      color: var(--muted);
      background: color-mix(in srgb, var(--surface) 88%, transparent);
      font-size: 0.875rem;
    }

    .spinner {
      width: 2.25rem;
      height: 2.25rem;
      border: 4px solid var(--border);
      border-left-color: var(--primary);
      border-radius: 50%;
      animation: spin 0.95s linear infinite;
    }

    @keyframes spin {
      to {
        transform: rotate(360deg);
      }
    }

    .controls {
      display: flex;
      flex-wrap: wrap;
      align-items: center;
      gap: 0.625rem;
    }

    .button {
      min-width: 5.2rem;
      height: 2.5rem;
      padding: 0 1.05rem;
      display: inline-flex;
      align-items: center;
      justify-content: center;
      gap: 0.45rem;
      border: 1px solid var(--border);
      border-radius: 0.75rem;
      color: var(--text);
      background: var(--surface);
      font-size: 0.875rem;
      font-weight: 650;
      transition: background 0.16s, border-color 0.16s, color 0.16s, opacity 0.16s, transform 0.16s;
    }

    .button:hover:not(:disabled) {
      border-color: color-mix(in srgb, var(--border) 55%, var(--primary) 45%);
      background: var(--surface-soft);
      transform: translateY(-1px);
    }

    .button:disabled {
      opacity: 0.5;
      cursor: not-allowed;
      transform: none;
    }

    .button.primary {
      margin-left: auto;
      border-color: var(--primary-dark);
      color: #fff;
      background: var(--primary);
    }

    .button.primary:hover {
      background: var(--primary-dark);
    }

    .button.ghost-danger {
      color: var(--danger);
    }

    .meta {
      margin-top: 0.8rem;
      color: var(--muted);
      font-size: 0.78rem;
      line-height: 1.6;
    }

    .section {
      padding: 4rem 0;
    }

    .section h2 {
      margin-bottom: 1rem;
      text-align: center;
      font-size: clamp(1.45rem, 4vw, 1.9rem);
      line-height: 1.25;
    }

    .section-intro {
      max-width: 42rem;
      margin: 0 auto 2rem;
      color: var(--muted);
      text-align: center;
      line-height: 1.7;
    }

    .feature-grid {
      display: grid;
      grid-template-columns: repeat(4, minmax(0, 1fr));
      gap: 1rem;
    }

    .feature {
      min-height: 11rem;
      padding: 1.35rem;
      border: 1px solid var(--border);
      border-radius: 1rem;
      background: var(--surface);
      box-shadow: var(--shadow);
    }

    .feature-icon {
      width: 2.5rem;
      height: 2.5rem;
      margin-bottom: 0.8rem;
      display: grid;
      place-items: center;
      border-radius: 0.8rem;
      color: #fff;
      background: linear-gradient(145deg, var(--primary), #42b983);
      font-weight: 800;
    }

    .feature h3 {
      margin-bottom: 0.45rem;
      font-size: 1rem;
    }

    .feature p {
      color: var(--muted);
      font-size: 0.875rem;
      line-height: 1.65;
    }

    .faq-list {
      display: grid;
      gap: 0.75rem;
    }

    details {
      border: 1px solid var(--border);
      border-radius: 1rem;
      background: var(--surface);
      box-shadow: var(--shadow);
      overflow: hidden;
    }

    summary {
      min-height: 4rem;
      padding: 1rem 1.25rem;
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 1rem;
      cursor: pointer;
      list-style: none;
      font-weight: 600;
    }

    summary::-webkit-details-marker {
      display: none;
    }

    summary:hover {
      background: var(--surface-soft);
    }

    .chevron {
      width: 1.2rem;
      height: 1.2rem;
      flex: 0 0 auto;
      transition: transform 0.16s;
    }

    details[open] .chevron {
      transform: rotate(180deg);
    }

    .answer {
      padding: 1rem 1.25rem 1.25rem;
      border-top: 1px solid var(--border);
      color: var(--muted);
      line-height: 1.75;
    }

    .related-list {
      display: grid;
      gap: 0.75rem;
    }

    .related-card {
      padding: 1rem 1.2rem;
      display: flex;
      align-items: center;
      gap: 1rem;
      border: 1px solid var(--border);
      border-radius: 1rem;
      background: var(--surface);
      box-shadow: var(--shadow);
    }

    .related-thumb {
      width: 4rem;
      height: 4rem;
      flex: 0 0 auto;
      display: grid;
      place-items: center;
      border: 1px solid var(--border);
      border-radius: 0.8rem;
      color: #fff;
      background:
        linear-gradient(90deg, rgba(255,255,255,0.32) 1px, transparent 1px),
        linear-gradient(0deg, rgba(255,255,255,0.24) 1px, transparent 1px),
        linear-gradient(145deg, #ff6464, #1f8fe5);
      background-size: 9px 9px, 9px 9px, auto;
      font-weight: 800;
    }

    .related-card h3 {
      margin-bottom: 0.25rem;
      font-size: 1rem;
    }

    .related-card p {
      color: var(--muted);
      font-size: 0.875rem;
      line-height: 1.55;
    }

    .site-footer {
      margin-top: 4rem;
      border-top: 1px solid var(--border);
      background: var(--surface-soft);
    }

    .footer-grid {
      padding: 3rem 1rem;
      display: grid;
      grid-template-columns: 1.3fr 0.7fr 1fr;
      gap: 2rem;
    }

    .site-footer h3 {
      margin-bottom: 0.75rem;
      font-size: 1rem;
    }

    .site-footer p,
    .site-footer li {
      color: var(--muted);
      font-size: 0.875rem;
      line-height: 1.7;
    }

    .site-footer ul {
      margin: 0;
      padding: 0;
      display: grid;
      gap: 0.45rem;
      list-style: none;
    }

    .copyright {
      padding: 1.2rem 0;
      border-top: 1px solid var(--border);
      color: var(--muted);
      text-align: center;
      font-size: 0.875rem;
    }

    .float-menu {
      position: fixed;
      right: 1rem;
      bottom: 1rem;
      z-index: 40;
      display: flex;
      flex-direction: column;
      gap: 0.5rem;
    }

    .float-button {
      width: 2.5rem;
      height: 2.5rem;
      display: grid;
      place-items: center;
      border: 1px solid var(--border);
      border-radius: 50%;
      color: var(--muted);
      background: var(--surface);
      box-shadow: var(--shadow);
      transition: color 0.16s, transform 0.16s, opacity 0.16s;
    }

    .float-button:hover {
      color: var(--primary);
      transform: scale(1.08);
    }

    #sunIcon[hidden],
    #moonIcon[hidden] {
      display: none;
    }

    #backTop {
      opacity: 0;
      pointer-events: none;
      transform: translateY(0.8rem);
    }

    #backTop.visible {
      opacity: 1;
      pointer-events: auto;
      transform: translateY(0);
    }

    .notice {
      position: fixed;
      right: 0;
      bottom: 0;
      left: 0;
      z-index: 30;
      padding: 0.65rem 1rem;
      border-top: 1px solid var(--border);
      color: var(--muted);
      background: var(--surface-raised);
      text-align: center;
      font-size: 0.82rem;
      backdrop-filter: blur(8px);
    }

    body {
      padding-bottom: 2.75rem;
    }

    .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: 760px) {
      .nav-links {
        display: none;
      }

      .mobile-menu-button {
        display: inline-flex;
      }

      .hero {
        padding-top: 1.45rem;
      }

      .tool {
        padding: 1rem;
      }

      .settings {
        grid-template-columns: 1fr;
      }

      .controls {
        display: grid;
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 0.5rem;
      }

      .button {
        min-width: 0;
        padding-inline: 0.5rem;
        font-size: 0.82rem;
      }

      .button.primary {
        grid-column: span 3;
        margin-left: 0;
      }

      #preview {
        max-height: 22.5rem;
      }

      .feature-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
      }

      .footer-grid {
        grid-template-columns: 1fr;
      }
    }

    @media (max-width: 460px) {
      .shell {
        padding-inline: 0.8rem;
      }

      .brand span:last-child {
        max-width: 9rem;
        overflow: hidden;
        text-overflow: ellipsis;
      }

      .placeholder {
        min-height: 17rem;
        padding: 1.35rem;
      }

      .feature-grid {
        grid-template-columns: 1fr;
      }

      .related-card {
        align-items: flex-start;
      }
    }

