
    :root {
      --primary: #1d4ed8;
      --primary-hover: #1e40af;
      --primary-soft: rgba(29, 78, 216, 0.12);
      --accent: #0f766e;
      --accent-soft: rgba(15, 118, 110, 0.14);
      --bg: #edf3fb;
      --bg-deep: #081120;
      --card-bg: rgba(255,255,255,0.88);
      --card-solid: #ffffff;
      --border: rgba(148, 163, 184, 0.22);
      --border-strong: rgba(148, 163, 184, 0.32);
      --text: #0f172a;
      --text-secondary: #475569;
      --text-muted: #94a3b8;
      --success: #10b981;
      --warning: #f59e0b;
      --radius: 18px;
      --radius-sm: 12px;
      --radius-lg: 28px;
      --shadow: 0 12px 30px rgba(15, 23, 42, 0.05);
      --shadow-md: 0 18px 44px rgba(15, 23, 42, 0.08);
      --shadow-lg: 0 28px 80px rgba(15, 23, 42, 0.14);
    }

    * { box-sizing: border-box; margin: 0; padding: 0; }

    body {
      font-family: "Plus Jakarta Sans", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
      background:
        radial-gradient(circle at top left, rgba(59,130,246,0.14), transparent 24%),
        radial-gradient(circle at right center, rgba(14,165,233,0.08), transparent 20%),
        linear-gradient(180deg, #f7fbff 0%, #eef4fb 42%, #eaf1f8 100%);
      color: var(--text);
      min-height: 100vh;
      overflow-x: hidden;
      overflow-y: auto;
      letter-spacing: -0.01em;
    }

    .app {
      display: flex;
      flex-direction: column;
      height: 100vh;
    }

    .home-shell {
      position: relative;
      min-height: 100vh;
      overflow: hidden;
      background:
        radial-gradient(circle at 10% 10%, rgba(29, 78, 216, 0.24), transparent 24%),
        radial-gradient(circle at 85% 18%, rgba(14, 165, 233, 0.16), transparent 22%),
        radial-gradient(circle at 88% 82%, rgba(15, 118, 110, 0.12), transparent 18%),
        linear-gradient(180deg, #f8fbff 0%, #eff5fd 38%, #eef3f8 100%);
    }

    .hero-backdrop {
      position: absolute;
      inset: 0;
      background-image:
        linear-gradient(rgba(15, 23, 42, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(15, 23, 42, 0.03) 1px, transparent 1px);
      background-size: 40px 40px;
      mask-image: linear-gradient(180deg, rgba(0,0,0,0.92), rgba(0,0,0,0.58), transparent);
      pointer-events: none;
    }

    .marketing-nav,
    .marketing-main {
      position: relative;
      z-index: 1;
    }

    .marketing-nav {
      max-width: 1240px;
      margin: 0 auto;
      padding: 24px 24px 0;
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 16px;
    }

    .marketing-nav::after {
      content: "";
      position: absolute;
      inset: 12px 24px auto;
      height: 74px;
      border-radius: 26px;
      background: rgba(255,255,255,0.58);
      border: 1px solid rgba(255,255,255,0.58);
      box-shadow: 0 18px 50px rgba(15, 23, 42, 0.06);
      backdrop-filter: blur(22px);
      -webkit-backdrop-filter: blur(22px);
      z-index: -1;
    }

    .marketing-brand {
      display: flex;
      align-items: center;
      gap: 14px;
    }

    .marketing-logo {
      width: 48px;
      height: 48px;
      border-radius: 18px;
      background: linear-gradient(145deg, #091425, #1d4ed8 52%, #0f766e 100%);
      box-shadow: 0 24px 48px rgba(29, 78, 216, 0.2);
      color: #fff;
      display: flex;
      align-items: center;
      justify-content: center;
      font-size: 20px;
      font-weight: 700;
      font-family: "Space Grotesk", "Plus Jakarta Sans", sans-serif;
    }

    .marketing-brand strong {
      display: block;
      font-size: 18px;
      font-family: "Space Grotesk", "Plus Jakarta Sans", sans-serif;
    }

    .marketing-brand span {
      color: var(--text-secondary);
      font-size: 12px;
    }

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

    .ghost-btn,
    .hero-btn {
      border: none;
      cursor: pointer;
      border-radius: 999px;
      padding: 12px 22px;
      font-size: 14px;
      font-weight: 700;
      transition: transform 0.22s, box-shadow 0.22s, background 0.22s, border-color 0.22s;
    }

    .ghost-btn {
      color: #0f172a;
      background: rgba(255,255,255,0.72);
      border: 1px solid rgba(148, 163, 184, 0.22);
      box-shadow: 0 10px 24px rgba(15, 23, 42, 0.04);
    }

    .hero-btn-primary {
      color: #fff;
      background: linear-gradient(135deg, #081120 0%, #1d4ed8 52%, #0891b2 100%);
      box-shadow: 0 22px 40px rgba(29, 78, 216, 0.24);
    }

    .hero-btn-secondary {
      color: #0f172a;
      background: rgba(255,255,255,0.82);
      border: 1px solid rgba(148, 163, 184, 0.18);
      box-shadow: 0 12px 28px rgba(15, 23, 42, 0.04);
    }

    .ghost-btn:hover,
    .hero-btn:hover {
      transform: translateY(-2px);
    }

    .marketing-main {
      max-width: 1240px;
      margin: 0 auto;
      padding: 28px 24px 72px;
    }

    .hero-section {
      display: grid;
      grid-template-columns: minmax(0, 1.05fr) minmax(360px, 0.95fr);
      gap: 34px;
      align-items: center;
      padding: 44px 0 58px;
    }

    .hero-copy h1 {
      font-size: clamp(34px, 5vw, 64px);
      line-height: 0.98;
      letter-spacing: -0.03em;
      color: #0f172a;
      max-width: 11ch;
      margin-bottom: 22px;
      font-family: "Space Grotesk", "Plus Jakarta Sans", sans-serif;
    }

    .hero-copy p {
      font-size: 18px;
      line-height: 1.86;
      color: #334155;
      max-width: 580px;
    }

    .hero-kicker,
    .launch-kicker {
      display: inline-flex;
      align-items: center;
      gap: 8px;
      padding: 9px 14px;
      border-radius: 999px;
      background: rgba(255,255,255,0.78);
      border: 1px solid rgba(148, 163, 184, 0.2);
      color: var(--primary);
      font-size: 12px;
      font-weight: 800;
      letter-spacing: 0.12em;
      text-transform: uppercase;
      margin-bottom: 18px;
      box-shadow: 0 14px 28px rgba(15, 23, 42, 0.04);
    }

    .hero-cta-row {
      display: flex;
      gap: 12px;
      flex-wrap: wrap;
      margin: 28px 0;
    }

    .device-entry-card {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 14px;
      max-width: 700px;
      margin-bottom: 24px;
      padding: 18px 20px;
      border-radius: 24px;
      background: rgba(255,255,255,0.74);
      border: 1px solid rgba(255,255,255,0.68);
      box-shadow: 0 20px 40px rgba(15, 23, 42, 0.05);
      backdrop-filter: blur(18px);
      -webkit-backdrop-filter: blur(18px);
    }

    .device-entry-copy strong {
      display: block;
      color: #0f172a;
      margin-bottom: 4px;
    }

    .device-entry-copy span {
      color: #64748b;
      font-size: 13px;
      line-height: 1.6;
    }

    .device-entry-actions {
      display: flex;
      gap: 10px;
      flex-wrap: wrap;
    }

    .device-entry-btn {
      border: 1px solid rgba(15, 23, 42, 0.08);
      background: #fff;
      color: #0f172a;
      border-radius: 999px;
      padding: 10px 16px;
      cursor: pointer;
      font-size: 13px;
      font-weight: 700;
      box-shadow: 0 10px 22px rgba(15,23,42,0.04);
    }

    .device-entry-btn.mobile {
      background: linear-gradient(135deg, rgba(29, 78, 216, 0.1), rgba(15, 118, 110, 0.1));
      color: var(--primary);
    }

    .hero-stats {
      display: grid;
      grid-template-columns: repeat(3, minmax(0, 1fr));
      gap: 12px;
      max-width: 640px;
    }

    .hero-stat {
      padding: 18px 20px;
      border-radius: 24px;
      background: rgba(255,255,255,0.78);
      border: 1px solid rgba(255,255,255,0.72);
      box-shadow: 0 16px 34px rgba(15, 23, 42, 0.04);
      backdrop-filter: blur(16px);
    }

    .hero-stat strong {
      display: block;
      font-size: 18px;
      color: #0f172a;
      margin-bottom: 6px;
      font-family: "Space Grotesk", "Plus Jakarta Sans", sans-serif;
    }

    .hero-stat span {
      font-size: 13px;
      color: #64748b;
      line-height: 1.6;
    }

    .hero-preview-card {
      padding: 24px;
      border-radius: 34px;
      background:
        linear-gradient(160deg, rgba(7,17,32,0.98), rgba(15,23,42,0.92) 42%, rgba(13,43,87,0.9) 100%);
      color: #e2e8f0;
      box-shadow: 0 36px 90px rgba(8, 17, 32, 0.22);
      overflow: hidden;
      position: relative;
      border: 1px solid rgba(148, 163, 184, 0.14);
    }

    .hero-preview-card::after {
      content: "";
      position: absolute;
      inset: auto -15% -25% auto;
      width: 240px;
      height: 240px;
      border-radius: 999px;
      background: radial-gradient(circle, rgba(52, 211, 153, 0.28), transparent 65%);
    }

    .hero-preview-top {
      display: flex;
      justify-content: space-between;
      align-items: center;
      gap: 10px;
      margin-bottom: 18px;
      font-size: 13px;
      color: #cbd5e1;
    }

    .preview-status {
      padding: 6px 10px;
      border-radius: 999px;
      background: rgba(52, 211, 153, 0.14);
      color: #6ee7b7;
    }

    .hero-preview-body {
      display: grid;
      grid-template-columns: 180px 1fr;
      gap: 20px;
      align-items: center;
      position: relative;
      z-index: 1;
    }

    .preview-phone {
      padding: 12px;
      border-radius: 32px;
      background: linear-gradient(180deg, #1e293b, #020617);
      box-shadow: inset 0 0 0 1px rgba(255,255,255,0.06);
    }

    .preview-phone-screen {
      aspect-ratio: 9/16;
      border-radius: 24px;
      overflow: hidden;
      padding: 18px 16px;
      background:
        linear-gradient(180deg, rgba(255,255,255,0.06), rgba(255,255,255,0.02)),
        linear-gradient(180deg, #3b82f6 0%, #0f172a 100%);
      display: flex;
      flex-direction: column;
      justify-content: flex-end;
    }

    .preview-mini-badge {
      display: inline-flex;
      width: fit-content;
      padding: 5px 10px;
      border-radius: 999px;
      background: rgba(255,255,255,0.16);
      font-size: 11px;
      margin-bottom: auto;
    }

    .preview-mini-title {
      font-size: 24px;
      font-weight: 700;
      line-height: 1.15;
      color: #fff7cc;
      margin-bottom: 14px;
    }

    .preview-mini-lines span {
      display: block;
      height: 10px;
      border-radius: 999px;
      background: rgba(255,255,255,0.24);
      margin-bottom: 8px;
    }

    .preview-mini-lines span:nth-child(1) { width: 92%; }
    .preview-mini-lines span:nth-child(2) { width: 78%; }
    .preview-mini-lines span:nth-child(3) { width: 64%; }

    .preview-mini-footer {
      display: flex;
      gap: 8px;
      margin-top: 16px;
    }

    .preview-mini-footer div {
      height: 36px;
      flex: 1;
      border-radius: 14px;
      background: rgba(255,255,255,0.16);
    }

    .hero-preview-points {
      display: grid;
      gap: 12px;
    }

    .hero-preview-point {
      padding: 14px 16px;
      border-radius: 18px;
      background: rgba(255,255,255,0.05);
      border: 1px solid rgba(255,255,255,0.06);
    }

    .hero-preview-point strong {
      display: block;
      margin-bottom: 6px;
      color: #fff;
    }

    .hero-preview-point span {
      color: #94a3b8;
      font-size: 13px;
      line-height: 1.6;
    }

    .feature-section,
    .launch-section {
      padding-top: 20px;
    }

    .section-heading {
      max-width: 780px;
      margin-bottom: 20px;
    }

    .section-heading span {
      color: #2563eb;
      font-size: 13px;
      font-weight: 700;
      letter-spacing: 0.06em;
      text-transform: uppercase;
    }

    .section-heading h2 {
      margin-top: 10px;
      font-size: clamp(28px, 4vw, 44px);
      line-height: 1.18;
      color: #0f172a;
    }

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

    .feature-card {
      padding: 26px;
      border-radius: 28px;
      background: rgba(255,255,255,0.78);
      border: 1px solid rgba(255,255,255,0.72);
      box-shadow: 0 22px 44px rgba(15, 23, 42, 0.05);
      backdrop-filter: blur(16px);
    }

    .feature-icon {
      width: 44px;
      height: 44px;
      border-radius: 14px;
      display: flex;
      align-items: center;
      justify-content: center;
      margin-bottom: 18px;
      font-size: 13px;
      font-weight: 700;
      color: var(--primary);
      background: linear-gradient(135deg, rgba(29, 78, 216, 0.12), rgba(15, 118, 110, 0.12));
      box-shadow: inset 0 1px 0 rgba(255,255,255,0.8);
    }

    .feature-card h3 {
      font-size: 18px;
      color: #0f172a;
      margin-bottom: 10px;
      font-family: "Space Grotesk", "Plus Jakarta Sans", sans-serif;
    }

    .feature-card p {
      color: #475569;
      font-size: 14px;
      line-height: 1.8;
    }

    .launch-card {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 20px;
      padding: 34px;
      border-radius: 34px;
      background:
        radial-gradient(circle at top right, rgba(56,189,248,0.24), transparent 26%),
        linear-gradient(135deg, #071120, #12356c 58%, #0f766e 100%);
      color: #fff;
      box-shadow: 0 30px 70px rgba(15, 23, 42, 0.18);
      border: 1px solid rgba(148, 163, 184, 0.12);
    }

    .launch-card h2 {
      font-size: clamp(24px, 3vw, 38px);
      line-height: 1.2;
      margin: 10px 0;
      max-width: 14ch;
    }

    .launch-card p {
      max-width: 560px;
      color: rgba(255,255,255,0.82);
      line-height: 1.8;
    }

    .site-footer {
      display: flex;
      justify-content: center;
      align-items: center;
      flex-wrap: wrap;
      gap: 10px 16px;
      color: #64748b;
      font-size: 12px;
      line-height: 1.6;
    }

    .site-footer a {
      color: #475569;
      text-decoration: none;
      font-weight: 700;
    }

    .site-footer a:hover {
      color: var(--primary);
      text-decoration: underline;
    }

    .home-footer {
      padding: 30px 0 0;
    }

    .app-footer {
      flex-shrink: 0;
      padding: 8px 16px;
      border-top: 1px solid rgba(148, 163, 184, 0.14);
      background: rgba(255,255,255,0.72);
      backdrop-filter: blur(12px);
      -webkit-backdrop-filter: blur(12px);
    }

    /* Header */
    .header {
      height: 64px;
      background: linear-gradient(135deg, rgba(255,255,255,0.9), rgba(244,248,252,0.84));
      backdrop-filter: blur(12px);
      -webkit-backdrop-filter: blur(12px);
      border-bottom: 1px solid rgba(148, 163, 184, 0.16);
      display: flex;
      align-items: center;
      padding: 0 28px;
      gap: 14px;
      flex-shrink: 0;
      box-shadow: 0 10px 24px rgba(15,23,42,0.04);
    }

    .logo {
      width: 36px;
      height: 36px;
      background: linear-gradient(145deg, #081120 0%, #1d4ed8 58%, #0f766e 100%);
      border-radius: 12px;
      display: flex;
      align-items: center;
      justify-content: center;
      color: white;
      font-weight: bold;
      font-size: 18px;
      box-shadow: 0 16px 30px rgba(29,78,216,0.18);
    }

    .brand h1 {
      font-size: 18px;
      font-weight: 700;
      font-family: "Space Grotesk", "Plus Jakarta Sans", sans-serif;
    }

    .brand p {
      font-size: 12px;
      color: var(--text-secondary);
    }

    .site-pill {
      padding: 6px 12px;
      border-radius: 999px;
      border: 1px solid rgba(29, 78, 216, 0.18);
      background: linear-gradient(135deg, rgba(29, 78, 216, 0.08), rgba(15, 118, 110, 0.08));
      color: var(--primary);
      font-size: 12px;
      font-weight: 700;
      letter-spacing: 0.02em;
    }

    .device-mode-badge,
    .device-login-chip {
      display: inline-flex;
      align-items: center;
      justify-content: center;
      padding: 6px 12px;
      border-radius: 999px;
      font-size: 12px;
      font-weight: 700;
      background: rgba(255,255,255,0.72);
      color: #334155;
      margin-bottom: 10px;
      border: 1px solid rgba(148,163,184,0.18);
    }

    .device-mode-badge {
      margin-bottom: 0;
    }

    .header-actions {
      margin-left: auto;
      display: flex;
      gap: 12px;
      align-items: center;
    }

    .mode-switch {
      display: flex;
      background: var(--bg);
      border-radius: 8px;
      padding: 4px;
      border: 1px solid var(--border);
    }

    .mode-btn {
      padding: 6px 16px;
      border: none;
      background: transparent;
      color: var(--text-secondary);
      font-size: 13px;
      cursor: pointer;
      border-radius: 6px;
      transition: all 0.2s;
    }

    .mode-btn.active {
      background: white;
      color: var(--primary);
      font-weight: 500;
      box-shadow: 0 1px 2px rgba(0,0,0,0.08);
    }

    .btn {
      padding: 9px 16px;
      border-radius: 12px;
      border: 1px solid rgba(148, 163, 184, 0.2);
      background: rgba(255,255,255,0.94);
      color: var(--text);
      font-size: 14px;
      font-weight: 600;
      cursor: pointer;
      transition: all 0.22s;
      display: inline-flex;
      align-items: center;
      gap: 6px;
      box-shadow: 0 10px 22px rgba(15,23,42,0.04);
    }

    .btn:hover {
      background: #ffffff;
      transform: translateY(-1px);
      box-shadow: 0 14px 28px rgba(15,23,42,0.06);
    }

    .btn-primary {
      background: linear-gradient(135deg, #0b1220 0%, var(--primary) 62%, #0891b2 100%);
      color: white;
      border-color: transparent;
    }

    .btn-primary:hover { background: linear-gradient(135deg, #0b1220 0%, var(--primary-hover) 62%, #0f766e 100%); }

    /* Main Layout */
    .main {
      display: flex;
      flex: 1;
      overflow: hidden;
    }

    .panel {
      border: 1px solid var(--border);
      border-radius: var(--radius);
      padding: 16px;
      background: #fff;
      transition: box-shadow 0.2s;
    }
    .panel:hover { box-shadow: var(--shadow-md); }

    .panel-title {
      font-size: 14px;
      font-weight: 600;
      margin-bottom: 14px;
      display: flex;
      align-items: center;
      gap: 8px;
    }

    .panel-title .icon {
      width: 18px;
      height: 18px;
      display: inline-flex;
      align-items: center;
      justify-content: center;
    }

    .form-group {
      margin-bottom: 14px;
    }

    .form-group label {
      display: block;
      font-size: 13px;
      color: var(--text-secondary);
      margin-bottom: 6px;
    }

    select, input[type="text"], input[type="number"], textarea {
      width: 100%;
      padding: 9px 12px;
      border: 1px solid var(--border);
      border-radius: 8px;
      font-size: 14px;
      outline: none;
      transition: border-color 0.2s;
    }

    select:focus, input:focus, textarea:focus {
      border-color: var(--primary);
    }

    textarea {
      resize: vertical;
      min-height: 80px;
    }

    .upload-zone {
      border: 2px dashed var(--border);
      border-radius: var(--radius);
      padding: 24px 16px;
      text-align: center;
      cursor: pointer;
      transition: all 0.2s;
      background: #fafbfc;
    }

    .upload-zone:hover {
      border-color: var(--primary);
      background: #f0f5ff;
    }

    .upload-zone input { display: none; }

    .upload-icon {
      font-size: 32px;
      margin-bottom: 8px;
    }

    .upload-text {
      font-size: 13px;
      color: var(--text-secondary);
      line-height: 1.5;
    }

    .template-list {
      display: flex;
      flex-direction: column;
      gap: 8px;
    }

    .template-item {
      padding: 12px;
      border: 1px solid var(--border);
      border-radius: 8px;
      cursor: pointer;
      transition: all 0.2s;
      display: flex;
      align-items: center;
      gap: 10px;
    }

    .template-item:hover {
      border-color: var(--primary);
      background: #f0f5ff;
    }

    .template-item.active {
      border-color: var(--primary);
      background: #eff6ff;
    }

    .template-icon {
      width: 32px;
      height: 32px;
      border-radius: 8px;
      background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
      display: flex;
      align-items: center;
      justify-content: center;
      color: white;
      font-size: 16px;
    }

    .template-info {
      flex: 1;
    }

    .template-name {
      font-size: 13px;
      font-weight: 500;
    }

    .template-desc {
      font-size: 11px;
      color: var(--text-secondary);
    }

    .history-list {
      display: flex;
      flex-direction: column;
      gap: 8px;
    }

    .history-item {
      padding: 10px;
      border: 1px solid var(--border);
      border-radius: 8px;
      font-size: 12px;
      cursor: pointer;
      transition: all 0.2s;
    }

    .history-item:hover {
      background: var(--bg);
    }

    /* Content */
    .content {
      flex: 1;
      padding: 14px 16px 24px;
      overflow-y: auto;
      display: flex;
      flex-direction: column;
      gap: 18px;
      min-width: 0;
    }

    .workspace-content {
      background:
        radial-gradient(circle at top left, rgba(29,78,216,0.12), transparent 20%),
        linear-gradient(180deg, #f6faff 0%, #eef4fb 100%);
    }

    .workflow-shell {
      display: flex;
      flex-direction: column;
      gap: 18px;
    }

    .workflow-grid {
      display: grid;
      gap: 18px;
    }

    .workflow-grid-top {
      grid-template-columns: minmax(0, 1fr) minmax(220px, 250px);
      align-items: start;
      gap: 12px;
    }

    .workflow-grid-output {
      grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
    }

    .workflow-left-column {
      display: flex;
      flex-direction: column;
      gap: 18px;
      min-width: 0;
    }

    .workflow-main-left {
      display: flex;
      flex-direction: column;
      gap: 16px;
      min-width: 0;
    }

    .workflow-top-left {
      display: grid;
      grid-template-columns: minmax(230px, 0.86fr) minmax(270px, 1fr) minmax(370px, 1.2fr);
      gap: 12px;
      min-width: 0;
      align-items: stretch;
    }

    .workflow-grid-bottom {
      grid-template-columns: 1fr 1fr;
    }

    .workflow-card,
    .utility-card,
    .preview-stage-card,
    .editor-stage-card,
    .output-card {
      background:
        linear-gradient(180deg, rgba(255,255,255,0.94), rgba(247,250,252,0.9)),
        radial-gradient(circle at top right, rgba(29,78,216,0.08), transparent 36%);
      box-shadow:
        0 24px 54px rgba(15, 23, 42, 0.06),
        inset 0 1px 0 rgba(255,255,255,0.9);
      border: 1px solid rgba(255,255,255,0.74);
      backdrop-filter: blur(18px);
      -webkit-backdrop-filter: blur(18px);
    }

    .scene-card,
    .upload-card,
    .overlay-card {
      min-height: 100%;
    }

    .workflow-card {
      min-width: 0;
      padding: 14px;
      border-radius: 20px;
    }

    .workflow-card .panel-title {
      margin-bottom: 12px;
      font-size: 15px;
    }

    .workflow-card .form-group:last-child {
      margin-bottom: 0;
    }

    .title-action-row,
    .upload-button-row,
    .preview-toolbar,
    .preview-title-row {
      display: flex;
      gap: 8px;
      align-items: center;
      flex-wrap: wrap;
    }

    .upload-card .upload-button-row,
    .overlay-card .upload-button-row {
      gap: 6px;
    }

    .base-upload-group {
      margin-top: 2px;
    }

    .upload-control-stack {
      display: flex;
      flex-direction: column;
      gap: 9px;
      padding: 10px;
      border-radius: 18px;
      background:
        linear-gradient(180deg, rgba(248,251,255,0.92), rgba(241,246,252,0.82)),
        radial-gradient(circle at top right, rgba(37,99,235,0.08), transparent 32%);
      border: 1px solid rgba(148,163,184,0.14);
      box-shadow: inset 0 1px 0 rgba(255,255,255,0.9);
    }

    .upload-control-row {
      display: grid;
      gap: 7px;
      align-items: center;
    }

    .upload-source-row {
      grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .puzzle-mode-row {
      grid-template-columns: auto repeat(3, minmax(0, 1fr));
      padding-top: 8px;
      border-top: 1px solid rgba(148,163,184,0.12);
    }

    .tool-row-label {
      color: #64748b;
      font-size: 12px;
      font-weight: 800;
      white-space: nowrap;
    }

    .upload-control-row .btn {
      justify-content: center;
      min-width: 0;
      padding: 9px 10px;
      border-radius: 13px;
      font-size: 13px;
      white-space: nowrap;
    }

    .upload-primary-btn {
      color: #0f172a;
      background: linear-gradient(180deg, #ffffff, #f8fafc);
      border-color: rgba(37,99,235,0.18);
    }

    .puzzle-mode-btn {
      background: rgba(255,255,255,0.78);
      color: #334155;
      box-shadow: none;
    }

    .puzzle-mode-btn.active {
      color: #fff;
      border-color: transparent;
      background: linear-gradient(135deg, #0f172a 0%, #2563eb 66%, #0ea5e9 100%);
      box-shadow: 0 14px 26px rgba(37,99,235,0.16);
    }

    .subtle-danger-btn {
      color: #b45309;
      background: rgba(255,251,235,0.92);
      border-color: rgba(245,158,11,0.18);
    }

    .mobile-clear-base-btn {
      display: none;
    }

    .title-action-row input {
      flex: 1;
      min-width: 220px;
    }

    .scene-card .title-action-row input {
      min-width: 0;
    }

    .upload-button-row.tight {
      justify-content: flex-start;
      align-items: center;
    }

    .overlay-action-row {
      gap: 6px;
      flex-wrap: nowrap;
    }

    .overlay-action-row .count-tip {
      margin-top: 0;
      margin-right: 2px;
      white-space: nowrap;
    }

    .btn-compact {
      padding: 7px 12px;
      font-size: 13px;
      white-space: nowrap;
    }

    .count-tip,
    .field-tip {
      margin-top: 8px;
      font-size: 12px;
      color: #64748b;
      line-height: 1.7;
    }

    .editor-subtitle {
      margin-bottom: 12px;
      color: #64748b;
      font-size: 13px;
      line-height: 1.7;
    }

    .hero-action-btn {
      background: linear-gradient(135deg, #0f172a 0%, #2563eb 55%, #0ea5e9 100%);
      color: #fff;
      border-color: transparent;
      box-shadow: 0 18px 36px rgba(37, 99, 235, 0.18);
      min-width: 96px;
      justify-content: center;
      white-space: nowrap;
    }

    .title-secondary-actions {
      display: flex;
      gap: 6px;
      flex-wrap: nowrap;
      align-items: center;
      margin-top: 8px;
      min-width: 0;
      overflow-x: auto;
      padding-bottom: 2px;
    }

    .title-secondary-actions .btn {
      flex: 1 1 0;
      min-width: 0;
      justify-content: center;
      padding: 8px 10px;
      font-size: 13px;
      white-space: nowrap;
    }

    .compact-upload {
      padding: 14px 12px;
    }

    .compact-upload .upload-text {
      display: flex;
      flex-direction: column;
      gap: 4px;
    }

    .compact-upload .upload-text span {
      font-size: 12px;
      color: #94a3b8;
    }

    .overlay-gallery {
      margin-top: 10px;
      display: flex;
      gap: 8px;
      flex-wrap: wrap;
      min-height: 36px;
    }

    .preview-stage-card {
      position: sticky;
      top: 12px;
      overflow: hidden;
      padding: 12px;
      border-radius: 24px;
    }

    .preview-stage-card::before {
      content: "";
      position: absolute;
      inset: 0;
      background:
        radial-gradient(circle at top right, rgba(59,130,246,0.14), transparent 28%),
        radial-gradient(circle at bottom left, rgba(16,185,129,0.12), transparent 24%);
      pointer-events: none;
    }

    .preview-stage-card .preview-title {
      margin-bottom: 6px;
    }

    .preview-stage-compact {
      width: 100%;
      max-width: 250px;
      justify-self: stretch;
    }

    .preview-stage-top {
      align-self: start;
    }

    .preview-stage-note {
      margin-bottom: 8px;
      color: #64748b;
      font-size: 11px;
      line-height: 1.6;
    }

    .puzzle-arrange-panel {
      position: relative;
      z-index: 1;
      margin-top: 12px;
      padding: 10px;
      border-radius: 18px;
      background: rgba(255,255,255,0.78);
      border: 1px solid rgba(148,163,184,0.18);
      box-shadow: inset 0 1px 0 rgba(255,255,255,0.92);
    }

    .puzzle-arrange-head {
      display: flex;
      flex-direction: column;
      gap: 2px;
      margin-bottom: 8px;
    }

    .puzzle-arrange-head strong {
      color: #0f172a;
      font-size: 13px;
      font-weight: 800;
    }

    .puzzle-arrange-head span {
      color: #64748b;
      font-size: 11px;
      line-height: 1.45;
    }

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

    .puzzle-arrange-grid .btn {
      justify-content: center;
      padding: 7px 8px;
      font-size: 12px;
      border-radius: 12px;
      white-space: nowrap;
    }

    .editor-stage-card .edit-grid {
      margin-top: 4px;
    }

    .editor-stage-card,
    .output-card {
      border-radius: 24px;
    }

    .result-surface {
      border: 1px solid rgba(148,163,184,0.14);
      border-radius: 20px;
      padding: 18px 20px;
      background: linear-gradient(180deg, rgba(255,255,255,0.98), rgba(246,249,252,0.94));
      min-height: 240px;
      font-size: 15px;
      line-height: 1.9;
      box-shadow: inset 0 1px 0 rgba(255,255,255,0.92);
    }

    .output-card-wide .result-surface {
      min-height: 260px;
    }

    .output-card-wide,
    .output-card-chat {
      min-width: 0;
    }

    .top-cards {
      display: grid;
      grid-template-columns: 1fr 1fr;
      gap: 20px;
    }

    .card {
      background: var(--card-bg);
      border: 1px solid var(--border);
      border-radius: var(--radius);
      box-shadow: var(--shadow);
      overflow: hidden;
    }

    .card-header {
      padding: 14px 16px;
      border-bottom: 1px solid var(--border);
      display: flex;
      align-items: center;
      justify-content: space-between;
    }

    .card-title {
      font-size: 14px;
      font-weight: 600;
      display: flex;
      align-items: center;
      gap: 8px;
    }

    .card-body {
      padding: 16px;
    }

    .badge {
      font-size: 11px;
      padding: 2px 8px;
      border-radius: 10px;
      background: #dbeafe;
      color: var(--primary);
    }

    .prompt-actions {
      display: flex;
      justify-content: space-between;
      align-items: center;
      margin-top: 12px;
    }

    .model-select {
      width: 140px;
    }

    .workspace {
      background: var(--card-bg);
      border: 1px solid var(--border);
      border-radius: var(--radius);
      box-shadow: var(--shadow);
      flex: 1;
      min-height: 400px;
      display: flex;
      flex-direction: column;
    }

    .workspace-tabs {
      display: flex;
      border-bottom: 1px solid var(--border);
      padding: 0 16px;
    }

    .tab {
      padding: 14px 20px;
      font-size: 14px;
      cursor: pointer;
      border-bottom: 2px solid transparent;
      transition: all 0.2s;
    }

    .tab:hover { color: var(--primary); }

    .tab.active {
      color: var(--primary);
      border-bottom-color: var(--primary);
      font-weight: 500;
    }

    .workspace-body {
      flex: 1;
      padding: 24px;
      overflow-y: auto;
    }

    .empty-state {
      height: 100%;
      display: flex;
      flex-direction: column;
      align-items: center;
      justify-content: center;
      color: var(--text-secondary);
      text-align: center;
    }

    .empty-icon {
      font-size: 64px;
      margin-bottom: 16px;
      opacity: 0.6;
    }

    .empty-title {
      font-size: 18px;
      color: var(--text);
      margin-bottom: 8px;
      font-weight: 500;
    }

    .style-tags {
      display: flex;
      gap: 10px;
      margin-top: 16px;
      flex-wrap: wrap;
      justify-content: center;
    }

    .style-tag {
      padding: 6px 14px;
      border-radius: 16px;
      font-size: 13px;
      cursor: pointer;
      transition: all 0.2s;
    }

    .style-tag:hover { background: var(--bg); }

    .phone-wrap .phone-frame,
    .preview-stage-card .phone-frame {
      width: 100% !important;
      margin: 0 !important;
    }
    .phone-wrap .phone-screen,
    .preview-stage-card .phone-screen {
      aspect-ratio: 9/16;
    }

    .preview-card {
      border: 1px solid var(--border);
      border-radius: var(--radius);
      padding: 16px;
      background: linear-gradient(180deg, #fafcff, #f8fafc);
    }

    .preview-title {
      font-size: 13px;
      font-weight: 600;
      margin-bottom: 12px;
      color: var(--text-secondary);
    }

    .mobile-save-tip {
      margin-bottom: 12px;
      padding: 10px 12px;
      border-radius: 12px;
      background: #eff6ff;
      color: #2563eb;
      font-size: 12px;
      line-height: 1.6;
    }

    .mobile-action-grid {
      display: grid;
      grid-template-columns: 1fr 1fr;
      gap: 8px;
    }

    .mobile-helper-text {
      margin-top: 10px;
      font-size: 12px;
      color: #64748b;
      line-height: 1.6;
    }

    .phone-frame {
      width: min(196px, 100%);
      margin: 0 auto;
      background: linear-gradient(180deg, #081120, #0f172a 46%, #05101f 100%);
      border-radius: 30px;
      padding: 10px;
      box-shadow: 0 28px 54px rgba(8,17,32,0.24);
    }

    .phone-screen {
      background: linear-gradient(180deg, #ffffff, #f6f9fc);
      border-radius: 20px;
      overflow: hidden;
      aspect-ratio: 9/16;
      position: relative;
    }

    .phone-screen canvas {
      width: 100%;
      height: 100%;
      display: block;
      border-radius: 18px;
    }

    .site-badge {
      display: inline-flex;
      align-items: center;
      justify-content: center;
      margin: 0 auto 12px;
      padding: 6px 12px;
      border-radius: 999px;
      background: rgba(59, 130, 246, 0.12);
      color: #2563eb;
      font-size: 12px;
      font-weight: 700;
      letter-spacing: 0.04em;
    }

    .login-domain-tip {
      margin-top: 14px;
      text-align: center;
      font-size: 12px;
      color: var(--text-secondary);
    }

    .login-domain-tip a {
      color: var(--primary);
      text-decoration: none;
      font-weight: 600;
    }

    .login-domain-tip a:hover {
      text-decoration: underline;
    }

    .login-footer {
      margin-top: 12px;
      color: rgba(203,213,225,0.74);
    }

    .login-footer a {
      color: rgba(191,219,254,0.9);
    }

    @media (max-width: 960px) {
      .header {
        height: auto;
        padding: 14px;
        flex-wrap: wrap;
      }

      .site-pill {
        order: 3;
      }

      .header-actions {
        width: 100%;
        margin-left: 0;
        justify-content: flex-end;
      }
    }

    .phone-image {
      width: 100%;
      height: 100%;
      object-fit: cover;
      display: block;
    }

    .phone-text {
      padding: 12px;
      font-size: 14px;
      line-height: 1.5;
      color: var(--text);
    }

    .color-picker {
      display: flex;
      gap: 8px;
      align-items: center;
      flex-wrap: wrap;
    }

    .color-option {
      width: 24px;
      height: 24px;
      border-radius: 50%;
      cursor: pointer;
      border: 2px solid rgba(148,163,184,0.28);
      transition: all 0.2s;
      box-shadow:
        inset 0 0 0 1px rgba(255,255,255,0.72),
        0 2px 6px rgba(15,23,42,0.08);
    }

    .color-option[data-color="#ffffff"],
    .color-option[data-color="transparent"],
    .color-option[data-color="none"] {
      background-color: #fff !important;
      background-image:
        linear-gradient(45deg, rgba(148,163,184,0.28) 25%, transparent 25%),
        linear-gradient(-45deg, rgba(148,163,184,0.28) 25%, transparent 25%),
        linear-gradient(45deg, transparent 75%, rgba(148,163,184,0.28) 75%),
        linear-gradient(-45deg, transparent 75%, rgba(148,163,184,0.28) 75%) !important;
      background-size: 8px 8px !important;
      background-position: 0 0, 0 4px, 4px -4px, -4px 0 !important;
      border-color: rgba(100,116,139,0.48);
    }

    .color-option.active {
      border-color: var(--primary);
      transform: scale(1.1);
      box-shadow:
        0 0 0 3px rgba(37,99,235,0.14),
        0 5px 12px rgba(37,99,235,0.18);
    }

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

    .compact-style-grid {
      grid-template-columns: repeat(6, minmax(0, 1fr));
      gap: 10px;
    }

    .toolbar-style-grid {
      display: grid;
      grid-template-columns: minmax(112px, 0.9fr) minmax(82px, 0.62fr) minmax(168px, 1.35fr) minmax(138px, 1fr) minmax(138px, 1fr) minmax(148px, 1fr);
      gap: 6px;
      align-items: stretch;
      padding: 8px;
      border-radius: 18px;
      background:
        linear-gradient(180deg, rgba(248,251,255,0.92), rgba(241,246,252,0.86)),
        radial-gradient(circle at top right, rgba(29,78,216,0.08), transparent 26%);
      border: 1px solid rgba(255,255,255,0.82);
      box-shadow: inset 0 1px 0 rgba(255,255,255,0.94);
    }

    .compact-style-grid .edit-item {
      padding: 8px 9px;
    }

    .compact-style-grid .edit-item label {
      margin-bottom: 5px;
    }

    .compact-style-grid .color-picker {
      gap: 5px;
    }

    .compact-style-grid .color-option {
      width: 20px;
      height: 20px;
    }

    .toolbar-style-grid .edit-item {
      min-height: 66px;
      display: flex;
      flex-direction: column;
      justify-content: flex-start;
      border-radius: 13px;
      background: rgba(255,255,255,0.78);
      border: 1px solid rgba(148,163,184,0.12);
      box-shadow: 0 8px 16px rgba(15,23,42,0.035);
    }

    .toolbar-style-grid .color-picker {
      flex-wrap: nowrap;
      justify-content: flex-start;
      overflow-x: auto;
      padding: 1px 0 2px;
    }

    .toolbar-style-grid .color-option {
      flex: 0 0 auto;
    }

    .toolbar-style-grid select {
      min-height: 34px;
      height: 34px;
      background: rgba(255,255,255,0.9);
    }

    .tag-chip-row {
      display: flex;
      flex-wrap: nowrap;
      gap: 6px;
      align-items: center;
      max-width: 100%;
      overflow-x: auto;
      padding-bottom: 2px;
    }

    .tag-chip {
      flex: 0 0 auto;
      cursor: pointer;
      padding: 4px 10px;
      background: #eff6ff;
      color: #2563eb;
      border-radius: 999px;
      font-size: 13px;
      font-weight: 600;
      line-height: 1.3;
      transition: all 0.2s;
      white-space: nowrap;
    }

    .tag-chip.copied {
      background: #10b981;
      color: white;
    }

    .ai-status-card {
      display: flex;
      align-items: flex-start;
      gap: 10px;
      padding: 12px;
      margin-bottom: 10px;
      border-radius: 16px;
      background: linear-gradient(135deg, rgba(15,23,42,0.04), rgba(37,99,235,0.07));
      border: 1px solid rgba(148,163,184,0.18);
    }

    .ai-status-dot {
      width: 10px;
      height: 10px;
      margin-top: 5px;
      border-radius: 999px;
      background: #f59e0b;
      box-shadow: 0 0 0 5px rgba(245,158,11,0.12);
      flex: 0 0 auto;
    }

    .ai-status-card.ready .ai-status-dot {
      background: #10b981;
      box-shadow: 0 0 0 5px rgba(16,185,129,0.12);
    }

    .ai-status-card.error .ai-status-dot {
      background: #ef4444;
      box-shadow: 0 0 0 5px rgba(239,68,68,0.12);
    }

    .ai-status-card strong {
      display: block;
      font-size: 13px;
      color: #0f172a;
      margin-bottom: 4px;
    }

    .ai-status-card p {
      margin: 0;
      font-size: 12px;
      color: #64748b;
      line-height: 1.55;
    }

    .edit-grid-col2 {
      grid-column: 1 / -1;
    }
    .edit-item {
      min-width: 0;
      padding: 11px 12px;
      border-radius: 16px;
      background: linear-gradient(180deg, rgba(255,255,255,0.98), rgba(248,250,252,0.92));
      border: 1px solid rgba(226,232,240,0.95);
      box-shadow: inset 0 1px 0 rgba(255,255,255,0.9);
    }
    .edit-grid label {
      display: block;
      font-size: 12px;
      color: var(--text-secondary);
      margin-bottom: 8px;
      font-weight: 600;
    }
    .edit-grid select,
    .edit-grid input[type="text"],
    .edit-grid textarea {
      width: 100%;
      padding: 7px 10px;
      border: 1px solid var(--border);
      border-radius: 8px;
      font-size: 13px;
      outline: none;
      transition: border-color 0.2s;
    }
    .edit-grid select:focus,
    .edit-grid input:focus,
    .edit-grid textarea:focus {
      border-color: var(--primary);
    }

    .export-btn {
      background: linear-gradient(135deg, #0f172a 0%, #2563eb 55%, #0ea5e9 100%);
      color: white;
      border: none;
      padding: 8px 16px;
      border-radius: 999px;
      cursor: pointer;
      font-size: 13px;
      transition: all 0.2s;
      box-shadow: 0 12px 24px rgba(37,99,235,0.16);
    }

    .export-btn:hover {
      opacity: 0.9;
      transform: translateY(-1px);
    }

    .comment-preview {
      background: linear-gradient(180deg, #ffffff, #fbfdff);
      border-radius: 16px;
      padding: 16px;
      font-size: 14px;
      line-height: 1.6;
      border: 1px solid var(--border);
      min-height: 240px;
    }

    .comment-item {
      padding: 0;
      border-bottom: none;
      margin-bottom: 14px;
    }

    .comment-item:last-child {
      margin-bottom: 0;
    }

    .comment-author {
      font-weight: 600;
      color: var(--text);
      margin-bottom: 6px;
    }

    .comment-author .btn {
      padding: 4px 10px;
      font-size: 12px;
      border-radius: 6px;
    }

    .comment-text {
      color: var(--text-secondary);
      line-height: 1.6;
      background: #f8fafc;
      border: 1px solid #e2e8f0;
      border-radius: 16px;
      padding: 12px 14px;
    }

    .comment-thread .comment-item:nth-child(odd) .comment-text {
      background: linear-gradient(180deg, #eff6ff, #f8fbff);
      border-color: #cfe0ff;
      border-top-left-radius: 6px;
    }

    .comment-thread .comment-item:nth-child(even) .comment-text {
      background: linear-gradient(180deg, #f8fafc, #ffffff);
      border-color: #e2e8f0;
      border-top-right-radius: 6px;
    }

    .output-card-chat {
      align-self: start;
    }

    .workflow-grid-main .preview-stage-compact {
      display: none;
    }

    .result-grid {
      display: grid;
      grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
      gap: 16px;
    }

    .result-item {
      border: 1px solid var(--border);
      border-radius: var(--radius);
      overflow: hidden;
      cursor: pointer;
      transition: transform 0.2s, border-color 0.2s, box-shadow 0.2s;
    }

    .result-item:hover { transform: translateY(-2px); }
    .result-item.active { border-color: #3b82f6; box-shadow: 0 0 0 2px rgba(59,130,246,0.2), 0 4px 12px rgba(59,130,246,0.1); }

    /* 批量生成面板灰选禁用 */
    .batch-panel-disabled {
      position: relative;
      opacity: 0.45;
      pointer-events: none;
      user-select: none;
    }
    .batch-panel-disabled::after {
      content: '此功能开发中，暂不可用';
      position: absolute;
      top: 50%;
      left: 50%;
      transform: translate(-50%, -50%);
      background: rgba(107,114,128,0.9);
      color: #fff;
      font-size: 16px;
      font-weight: 600;
      padding: 12px 28px;
      border-radius: 8px;
      z-index: 10;
      pointer-events: none;
      white-space: nowrap;
    }

    .result-item img {
      width: 100%;
      aspect-ratio: 9/16;
      object-fit: contain;
      background: #f5f7fa;
    }

    .result-actions {
      padding: 10px;
      display: flex;
      gap: 8px;
      justify-content: center;
    }

    .icon-btn {
      width: 32px;
      height: 32px;
      border: 1px solid var(--border);
      border-radius: 6px;
      background: white;
      cursor: pointer;
      display: inline-flex;
      align-items: center;
      justify-content: center;
      transition: all 0.2s;
    }

    /* ===== 批量结果大图模态框 ===== */
    .modal-overlay {
      position: fixed;
      top: 0; left: 0; right: 0; bottom: 0;
      background: rgba(0,0,0,0.88);
      z-index: 10000;
      display: none;
      align-items: center;
      justify-content: center;
      backdrop-filter: blur(4px);
    }
    .modal-overlay.active { display: flex; }
    .modal-close {
      position: absolute;
      top: 20px; right: 24px;
      width: 40px; height: 40px;
      border-radius: 50%;
      background: rgba(255,255,255,0.15);
      border: none;
      color: #fff;
      font-size: 22px;
      cursor: pointer;
      display: flex;
      align-items: center;
      justify-content: center;
      transition: background 0.2s;
      z-index: 10001;
    }
    .modal-close:hover { background: rgba(255,255,255,0.3); }
    .modal-nav {
      position: absolute;
      top: 50%;
      transform: translateY(-50%);
      width: 48px; height: 48px;
      border-radius: 50%;
      background: rgba(255,255,255,0.12);
      border: none;
      color: #fff;
      font-size: 24px;
      cursor: pointer;
      display: flex;
      align-items: center;
      justify-content: center;
      transition: all 0.2s;
      z-index: 10001;
    }
    .modal-nav:hover { background: rgba(255,255,255,0.3); }
    .modal-nav.prev { left: 20px; }
    .modal-nav.next { right: 20px; }
    .modal-nav:disabled { opacity: 0.25; cursor: default; }
    .modal-image-wrap {
      display: flex;
      align-items: center;
      justify-content: center;
      width: 80vw;
      height: 85vh;
    }
    .modal-image-wrap img {
      max-width: 100%;
      max-height: 100%;
      object-fit: contain;
      border-radius: 4px;
    }
    .modal-counter {
      position: absolute;
      bottom: 24px;
      left: 50%;
      transform: translateX(-50%);
      color: rgba(255,255,255,0.7);
      font-size: 14px;
      background: rgba(0,0,0,0.5);
      padding: 6px 18px;
      border-radius: 20px;
      z-index: 10001;
    }

    .mobile-save-overlay {
      position: fixed;
      inset: 0;
      z-index: 10002;
      display: none;
      align-items: center;
      justify-content: center;
      padding: 18px;
      background: rgba(2,6,23,0.72);
      backdrop-filter: blur(10px);
      -webkit-backdrop-filter: blur(10px);
    }

    .mobile-save-card {
      position: relative;
      width: min(92vw, 360px);
      max-height: 88vh;
      padding: 14px;
      border-radius: 24px;
      background:
        radial-gradient(circle at top right, rgba(14,165,233,0.14), transparent 34%),
        linear-gradient(180deg, #ffffff, #f8fbff);
      border: 1px solid rgba(255,255,255,0.88);
      box-shadow: 0 28px 80px rgba(2,6,23,0.36);
      display: flex;
      flex-direction: column;
      gap: 10px;
    }

    .mobile-save-close {
      position: absolute;
      top: 10px;
      right: 10px;
      width: 32px;
      height: 32px;
      border: 0;
      border-radius: 999px;
      color: #475569;
      background: rgba(15,23,42,0.06);
      cursor: pointer;
    }

    .mobile-save-head {
      padding-right: 34px;
    }

    .mobile-save-head strong {
      display: block;
      color: #0f172a;
      font-size: 16px;
      margin-bottom: 3px;
    }

    .mobile-save-head span {
      color: #64748b;
      font-size: 12px;
      line-height: 1.55;
    }

    .mobile-save-image-wrap {
      max-height: 62vh;
      overflow: auto;
      border-radius: 18px;
      background:
        linear-gradient(45deg, rgba(148,163,184,0.16) 25%, transparent 25%),
        linear-gradient(-45deg, rgba(148,163,184,0.16) 25%, transparent 25%),
        linear-gradient(45deg, transparent 75%, rgba(148,163,184,0.16) 75%),
        linear-gradient(-45deg, transparent 75%, rgba(148,163,184,0.16) 75%);
      background-size: 16px 16px;
      background-position: 0 0, 0 8px, 8px -8px, -8px 0;
      border: 1px solid rgba(148,163,184,0.16);
      display: flex;
      justify-content: center;
    }

    .mobile-save-image-wrap img {
      width: 100%;
      height: auto;
      display: block;
      object-fit: contain;
      -webkit-touch-callout: default;
      user-select: auto;
    }

    .mobile-save-download {
      min-height: 42px;
      border: 0;
      border-radius: 999px;
      color: #fff;
      background: linear-gradient(135deg, #0f172a 0%, #2563eb 58%, #0ea5e9 100%);
      font-size: 14px;
      font-weight: 800;
      cursor: pointer;
    }

    /* ===== 缩略图卡片增强 ===== */
    .result-item-inner {
      position: relative;
    }
    .result-item-image-wrap {
      position: relative;
      overflow: hidden;
    }
    .result-item-image-wrap > img {
      display: block;
      width: 100%;
      aspect-ratio: 9/16;
      object-fit: contain;
      background: #f5f7fa;
    }

    /* 文字叠加层 — 可在图片区内拖动 */
    .result-item-text {
      position: absolute;
      max-width: 90%;
      font-size: 13px;
      font-weight: 700;
      color: #fff;
      text-shadow: 0 1px 4px rgba(0,0,0,0.6);
      background: rgba(0,0,0,0.35);
      padding: 4px 10px;
      border-radius: 4px;
      cursor: grab;
      user-select: none;
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
      transition: box-shadow 0.2s;
      z-index: 3;
      line-height: 1.3;
    }
    .result-item-text:hover {
      box-shadow: 0 0 0 2px #3b82f6;
    }
    .result-item-text.dragging {
      cursor: grabbing;
      box-shadow: 0 0 0 2px #3b82f6, 0 4px 12px rgba(59,130,246,0.4);
      z-index: 4;
    }

    /* 查看大图按钮 - 右下角半透明，悬停显示 */
    .result-view-btn {
      position: absolute;
      bottom: 10px; right: 10px;
      width: 32px; height: 32px;
      border-radius: 50%;
      background: rgba(0,0,0,0.45);
      border: none;
      color: #fff;
      font-size: 14px;
      cursor: pointer;
      display: flex;
      align-items: center;
      justify-content: center;
      transition: all 0.2s;
      z-index: 3;
      opacity: 0;
    }
    .result-item-image-wrap:hover .result-view-btn {
      opacity: 1;
    }
    .result-view-btn:hover {
      background: rgba(0,0,0,0.7);
      transform: scale(1.1);
    }

    /* 底部操作栏 */
    .result-item-footer {
      display: flex;
      align-items: center;
      justify-content: space-between;
      padding: 8px 10px;
      background: #fff;
      border-top: 1px solid #e5e7eb;
    }
    .result-item-serial {
      font-size: 11px;
      color: #6b7280;
      font-weight: 600;
      background: #f3f4f6;
      padding: 2px 8px;
      border-radius: 10px;
    }
    .result-item-actions {
      display: flex;
      gap: 4px;
    }
    .result-item-actions .icon-btn {
      width: 28px; height: 28px;
      font-size: 13px;
    }
    .result-item-actions .icon-btn:hover {
      background: #f3f4f6;
      border-color: #d1d5db;
    }

    /* 拖动排序交互状态 */
    .result-item.dragging {
      opacity: 0.4;
      transform: scale(0.95);
    }
    .result-item.drop-target {
      border: 2px dashed #3b82f6;
      background: #eff6ff;
    }

    .icon-btn:hover { background: var(--bg); }

    .loading {
      display: none;
      flex-direction: column;
      align-items: center;
      justify-content: center;
      height: 100%;
      gap: 16px;
    }

    .spinner {
      width: 48px;
      height: 48px;
      border: 3px solid var(--border);
      border-top-color: var(--primary);
      border-radius: 50%;
      animation: spin 1s linear infinite;
    }

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

    .toast {
      position: fixed;
      bottom: 24px;
      right: 24px;
      padding: 12px 20px;
      background: #1f2937;
      color: white;
      border-radius: 8px;
      font-size: 14px;
      box-shadow: 0 4px 12px rgba(0,0,0,0.15);
      opacity: 0;
      transform: translateY(20px);
      transition: all 0.3s;
      z-index: 1000;
    }

    .toast.show {
      opacity: 1;
      transform: translateY(0);
    }

    @media (max-width: 1200px) {
      .top-cards { grid-template-columns: 1fr; }
      .preview-area { grid-template-columns: 1fr; }
    }

    @media (max-width: 900px) {
      .sidebar { display: none; }
    }

    .mode-image2image .text2image-only,
    .mode-text2image .image2image-only {
      display: none !important;
    }

    .text-workspace {
      display: none;
      flex-direction: column;
      gap: 20px;
      height: 100%;
    }

    .mode-text2image .text-workspace {
      display: flex;
    }

    .mode-text2image .image-workspace {
      display: none;
    }

    .text-output-grid {
      display: grid;
      grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
      gap: 16px;
    }

    .text-output-card {
      background: white;
      border: 1px solid var(--border);
      border-radius: var(--radius);
      padding: 16px;
    }

    .text-output-card h4 {
      font-size: 13px;
      color: var(--text-secondary);
      margin-bottom: 8px;
    }

    .text-output-card p {
      font-size: 14px;
      line-height: 1.6;
      color: var(--text);
      margin-bottom: 12px;
    }

    /* 登录页 */
    .login-overlay {
      position: fixed; top: 0; left: 0; width: 100vw; height: 100vh;
      background:
        radial-gradient(circle at top left, rgba(29,78,216,0.28), transparent 24%),
        radial-gradient(circle at top right, rgba(14,165,233,0.14), transparent 20%),
        radial-gradient(circle at bottom right, rgba(15,118,110,0.14), transparent 22%),
        linear-gradient(135deg, #07101f 0%, #0b1220 38%, #101a2d 100%);
      z-index: 99999; display: flex; align-items: center; justify-content: center;
      font-family: "Plus Jakarta Sans", "PingFang SC", sans-serif;
      overflow: hidden;
    }
    #loginCanvas {
      position: absolute; top: 0; left: 0; width: 100%; height: 100%;
      z-index: 0;
      opacity: 0.6;
    }
    .login-backdrop-glow {
      position: absolute;
      border-radius: 999px;
      filter: blur(80px);
      opacity: 0.4;
      pointer-events: none;
    }
    .login-backdrop-glow-a {
      width: 260px;
      height: 260px;
      top: 12%;
      left: 12%;
      background: rgba(59,130,246,0.45);
    }
    .login-backdrop-glow-b {
      width: 300px;
      height: 300px;
      right: 10%;
      bottom: 8%;
      background: rgba(16,185,129,0.25);
    }
    .login-box {
      position: relative; z-index: 1;
      background:
        linear-gradient(180deg, rgba(255,255,255,0.12), rgba(255,255,255,0.04)),
        rgba(9,16,30,0.52);
      border: 1px solid rgba(255,255,255,0.12);
      border-radius: 34px; padding: 28px; width: 540px; max-width: 92vw;
      backdrop-filter: blur(44px);
      -webkit-backdrop-filter: blur(40px);
      box-shadow: 0 34px 90px rgba(0,0,0,0.46), inset 0 1px 0 rgba(255,255,255,0.08);
      animation: loginFadeIn 0.8s ease-out;
    }
    @keyframes loginFadeIn {
      from { opacity: 0; transform: translateY(30px) scale(0.97); }
      to { opacity: 1; transform: translateY(0) scale(1); }
    }
    .login-hero {
      text-align: center;
      padding: 14px 12px 18px;
    }
    .login-icon {
      width: 64px; height: 64px; margin: 0 auto 20px;
      background: linear-gradient(145deg, #0f172a 0%, #2563eb 56%, #0f766e 100%);
      border-radius: 20px; display: flex; align-items: center; justify-content: center;
      font-size: 28px; box-shadow: 0 18px 42px rgba(59,130,246,0.35);
    }
    .login-box h2 { color: #f8fbff; font-size: 30px; margin: 0 0 6px; font-weight: 800; text-align: center; font-family: "Space Grotesk", "Plus Jakarta Sans", sans-serif; }
    .login-box .sub { color: #94a3b8; font-size: 13px; margin-bottom: 18px; text-align: center; }
    .login-feature-row {
      display: flex;
      justify-content: center;
      gap: 8px;
      flex-wrap: wrap;
      margin-top: 14px;
    }
    .login-feature-row span {
      padding: 7px 12px;
      border-radius: 999px;
      background: rgba(255,255,255,0.06);
      border: 1px solid rgba(255,255,255,0.08);
      color: #cbd5e1;
      font-size: 12px;
    }
    .login-form-card {
      background: rgba(2,6,23,0.34);
      border: 1px solid rgba(255,255,255,0.1);
      border-radius: 24px;
      padding: 20px;
      margin-top: 8px;
    }
    .login-box label { color: #bfd1ea; font-size: 12px; display: block; margin-bottom: 6px; font-weight: 600; letter-spacing: 0.3px; }
    .login-box input {
      width: 100%; padding: 14px 18px; background: rgba(255,255,255,0.07);
      border: 1px solid rgba(255,255,255,0.12); border-radius: 14px; color: #e2e8f0;
      font-size: 15px; margin-bottom: 18px; outline: none; box-sizing: border-box;
      transition: all 0.3s;
    }
    .login-box input:focus { border-color: #3b82f6; background: rgba(59,130,246,0.06); box-shadow: 0 0 0 3px rgba(59,130,246,0.1); }
    .login-box input::placeholder { color: rgba(148,163,184,0.4); }
    .password-field {
      position: relative;
      margin-bottom: 18px;
    }
    .password-field input {
      margin-bottom: 0;
      padding-right: 52px;
    }
    .password-eye {
      position: absolute;
      top: 50%;
      right: 12px;
      transform: translateY(-50%);
      width: 34px;
      height: 34px;
      border: 1px solid rgba(148,163,184,0.18);
      border-radius: 999px;
      background: rgba(15,23,42,0.46);
      color: #dbeafe;
      display: inline-flex;
      align-items: center;
      justify-content: center;
      cursor: pointer;
      font-size: 15px;
      line-height: 1;
      transition: all 0.2s ease;
    }
    .eye-icon {
      position: relative;
      width: 20px;
      height: 13px;
      display: inline-block;
      border: 2px solid currentColor;
      border-radius: 999px / 70%;
    }
    .eye-icon::before {
      content: "";
      position: absolute;
      width: 5.5px;
      height: 5.5px;
      top: 50%;
      left: 50%;
      transform: translate(-50%, -50%);
      border-radius: 999px;
      background: currentColor;
    }
    .password-eye.is-visible .eye-icon::after,
    .admin-password-eye.is-visible .eye-icon::after {
      content: "";
      position: absolute;
      width: 23px;
      height: 2px;
      top: 50%;
      left: 50%;
      border-radius: 999px;
      background: currentColor;
      transform: translate(-50%, -50%) rotate(-36deg);
      box-shadow: 0 0 0 2px rgba(15,23,42,0.88);
    }
    .password-eye:hover,
    .password-eye.is-visible {
      background: rgba(37,99,235,0.24);
      border-color: rgba(96,165,250,0.46);
      color: #fff;
    }
    .login-box .btn-row { display: flex; gap: 12px; margin-top: 10px; }
    .login-box .btn-login {
      flex: 1; padding: 14px; border: none; border-radius: 12px;
      font-size: 15px; font-weight: 600; cursor: pointer;
      transition: all 0.3s; letter-spacing: 0.3px;
    }
    .btn-user {
      background: linear-gradient(135deg, #10233f 0%, #2563eb 64%, #0891b2 100%);
      color: #fff; box-shadow: 0 4px 16px rgba(59,130,246,0.3);
    }
    .btn-user:hover {
      box-shadow: 0 6px 24px rgba(59,130,246,0.4);
      transform: translateY(-1px);
    }
    .btn-admin {
      background: rgba(255,255,255,0.04);
      border: 1px solid rgba(255,255,255,0.12) !important;
      color: #94a3b8;
    }
    .btn-admin:hover {
      background: rgba(255,255,255,0.08);
      color: #e2e8f0;
      border-color: rgba(255,255,255,0.2) !important;
    }
    .login-box .btn-login:active { transform: scale(0.98); }
    .login-err { color: #ef4444; font-size: 12px; margin-top: 10px; min-height: 18px; text-align: center; }
    .login-info { color: #475569; font-size: 11px; margin-top: 16px; text-align: center; }
    .login-back-btn {
      width: 100%;
      margin-top: 12px;
      padding: 10px 14px;
      border-radius: 12px;
      border: 1px solid rgba(255,255,255,0.1);
      background: rgba(255,255,255,0.04);
      color: #cbd5e1;
      cursor: pointer;
      font-size: 13px;
    }
    /* 管理员后台 */
    .admin-panel {
      position: fixed; top: 0; left: 0; width: 100vw; height: 100vh;
      background: #0f172a; z-index: 99998; display: flex; overflow: hidden;
    }
    .admin-sidebar {
      width: 240px; background: rgba(255,255,255,0.03); border-right: 1px solid rgba(255,255,255,0.06);
      padding: 24px 0; display: flex; flex-direction: column;
    }
    .admin-sidebar h3 { color: #e2e8f0; font-size: 16px; padding: 0 20px; margin-bottom: 24px; }
    .admin-menu {
      color: #94a3b8; font-size: 14px; padding: 10px 20px; cursor: pointer;
      border-left: 2px solid transparent; transition: all 0.2s;
    }
    .admin-menu:hover, .admin-menu.active { color: #e2e8f0; background: rgba(59,130,246,0.1); border-left-color: #3b82f6; }
    .admin-content { flex: 1; padding: 32px; overflow-y: auto; }
    .admin-content h4 { color: #e2e8f0; font-size: 18px; margin: 0 0 24px; }
    .admin-table { width: 100%; border-collapse: collapse; }
    .admin-table th {
      text-align: left; color: #64748b; font-size: 11px; font-weight: 600;
      padding: 8px 12px; border-bottom: 1px solid rgba(255,255,255,0.06);
      text-transform: uppercase;
    }
    .admin-table td {
      color: #cbd5e1; font-size: 13px; padding: 10px 12px;
      border-bottom: 1px solid rgba(255,255,255,0.03);
    }
    .admin-table .btn-sm {
      padding: 4px 10px; font-size: 11px; border-radius: 6px; border: none; cursor: pointer;
      color: #fff; margin-right: 4px;
    }
    .btn-edit { background: #3b82f6; }
    .btn-del { background: #ef4444; }
    .btn-add { background: #10b981; }
    .btn-ip { background: #6366f1; }
    .admin-ip-badge {
      display: inline-flex;
      max-width: 190px;
      padding: 4px 9px;
      border-radius: 999px;
      color: #94a3b8;
      background: rgba(148,163,184,0.08);
      border: 1px solid rgba(148,163,184,0.12);
      font-size: 11px;
      line-height: 1.4;
      white-space: normal;
    }
    .admin-ip-badge.limited {
      color: #c7d2fe;
      background: rgba(99,102,241,0.14);
      border-color: rgba(129,140,248,0.24);
    }
    .admin-form { margin-bottom: 20px; display: flex; gap: 8px; align-items: flex-end; }
    .admin-form input {
      padding: 8px 12px; background: rgba(255,255,255,0.06);
      border: 1px solid rgba(255,255,255,0.1); border-radius: 8px;
      color: #e2e8f0; font-size: 13px; outline: none; width: 140px;
    }
    .admin-password-field {
      position: relative;
      width: 160px;
    }
    .admin-password-field input {
      width: 100%;
      padding-right: 40px;
    }
    .admin-password-eye {
      position: absolute;
      top: 50%;
      right: 6px;
      transform: translateY(-50%);
      width: 28px;
      height: 28px;
      border-radius: 999px;
      border: 1px solid rgba(148,163,184,0.16);
      background: rgba(15,23,42,0.38);
      color: #cbd5e1;
      cursor: pointer;
      display: inline-flex;
      align-items: center;
      justify-content: center;
      font-size: 12px;
    }
    .admin-password-eye.is-visible {
      color: #fff;
      background: rgba(59,130,246,0.32);
    }
    .admin-form input:focus { border-color: #3b82f6; }
    .admin-form label { color: #64748b; font-size: 11px; display: block; margin-bottom: 4px; }
    .logout-btn {
      padding: 8px 16px; background: rgba(239,68,68,0.15); color: #ef4444;
      border: 1px solid rgba(239,68,68,0.3); border-radius: 8px;
      font-size: 12px; cursor: pointer; margin-top: auto; margin: 24px 20px 0;
    }
    .record-item {
      padding: 10px 14px; border-bottom: 1px solid rgba(255,255,255,0.03);
      font-size: 13px; color: #94a3b8;
    }
    .record-item .time { color: #475569; font-size: 11px; margin-right: 12px; }
    .record-item .user-tag { color: #3b82f6; font-size: 11px; margin-right: 8px; }

    @media (max-width: 1280px) {
      .workflow-top-left {
        grid-template-columns: repeat(2, minmax(0, 1fr));
      }

      .scene-card {
        grid-column: 1 / -1;
      }

      .workflow-grid-output,
      .workflow-grid-bottom {
        grid-template-columns: 1fr 1fr;
      }

      .compact-style-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
      }

      .compact-style-grid .edit-item:nth-child(-n+6) {
        grid-column: span 1;
      }

      .toolbar-style-grid {
        grid-template-columns: minmax(112px, 0.9fr) minmax(82px, 0.62fr) minmax(168px, 1.35fr) minmax(138px, 1fr) minmax(138px, 1fr) minmax(148px, 1fr);
        overflow-x: visible;
      }
    }

    @media (max-width: 1100px) {
      .hero-section,
      .hero-preview-body,
      .feature-grid,
      .workflow-grid-top,
      .workflow-grid-output,
      .workflow-grid-bottom {
        grid-template-columns: 1fr;
      }

      .workflow-top-left {
        grid-template-columns: 1fr;
      }

      .hero-copy h1,
      .launch-card h2 {
        max-width: none;
      }

      .hero-stats {
        grid-template-columns: 1fr;
      }

      .launch-card {
        align-items: flex-start;
        flex-direction: column;
      }

      .preview-stage-card {
        position: static;
      }

      .preview-stage-compact {
        max-width: none;
        justify-self: auto;
      }

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

      .toolbar-style-grid .edit-item:nth-child(-n+6) {
        grid-column: span 1;
      }

      .toolbar-style-grid .color-picker {
        flex-wrap: wrap;
      }

      .overlay-action-row {
        flex-wrap: wrap;
      }
    }

    @media (max-width: 720px) {
      .home-shell {
        min-height: 100dvh;
      }

      .marketing-nav,
      .marketing-main {
        padding-left: 16px;
        padding-right: 16px;
      }

      .marketing-nav {
        flex-direction: row;
        align-items: center;
        padding-top: 16px;
      }

      .marketing-actions {
        width: auto;
        margin-left: auto;
      }

      .marketing-actions .ghost-btn {
        display: none;
      }

      .marketing-actions button {
        padding: 10px 14px;
        font-size: 12px;
        white-space: nowrap;
      }

      .hero-cta-row button,
      .device-entry-actions button {
        width: 100%;
      }

      .marketing-main {
        padding-top: 8px;
        padding-bottom: 22px;
      }

      .hero-section {
        display: block;
        padding: 22px 0 18px;
      }

      .hero-kicker {
        margin-bottom: 12px;
        padding: 7px 11px;
        font-size: 10px;
        letter-spacing: 0.08em;
      }

      .hero-copy h1 {
        max-width: 12ch;
        margin-bottom: 14px;
        font-size: clamp(34px, 12vw, 44px);
        line-height: 1.02;
      }

      .hero-copy p {
        max-width: 100%;
        font-size: 14px;
        line-height: 1.7;
      }

      .hero-cta-row {
        margin: 20px 0 14px;
        gap: 9px;
      }

      .hero-cta-row .hero-btn-secondary,
      .hero-preview-card,
      .feature-section,
      .launch-section {
        display: none;
      }

      .device-entry-card,
      .device-entry-actions {
        flex-direction: column;
        align-items: stretch;
      }

      .device-entry-card {
        margin-bottom: 14px;
        padding: 14px;
        border-radius: 20px;
      }

      .device-entry-copy span {
        display: none;
      }

      .hero-stats {
        grid-template-columns: 1fr 1fr 1fr;
        gap: 8px;
      }

      .hero-stat {
        padding: 12px 8px;
        border-radius: 16px;
      }

      .hero-stat strong {
        font-size: 13px;
      }

      .hero-stat span {
        font-size: 10px;
        line-height: 1.35;
      }

      .home-footer {
        padding-top: 18px;
      }

      .login-overlay {
        align-items: flex-start;
        padding: 18px 12px;
        overflow-y: auto;
      }

      .login-overlay #loginCanvas,
      .login-backdrop-glow {
        display: none;
      }

      .login-box {
        width: 100%;
        max-width: 430px;
        padding: 18px;
        border-radius: 26px;
      }

      .login-hero {
        padding: 4px 4px 10px;
      }

      .login-icon {
        width: 46px;
        height: 46px;
        margin-bottom: 12px;
        border-radius: 15px;
        font-size: 22px;
      }

      .site-badge {
        margin-bottom: 8px;
        padding: 5px 10px;
        font-size: 10px;
      }

      .login-box h2 {
        font-size: 24px;
      }

      .login-box .sub {
        margin-bottom: 10px;
        font-size: 12px;
      }

      .device-login-chip {
        margin-bottom: 0;
        font-size: 11px;
      }

      .login-feature-row {
        display: none;
      }

      .login-form-card {
        margin-top: 10px;
        padding: 14px;
        border-radius: 18px;
      }

      .login-box input {
        min-height: 42px;
        margin-bottom: 12px;
        padding: 11px 13px;
      }

      .login-box .btn-row {
        gap: 8px;
      }

      .login-box .btn-login {
        padding: 12px 10px;
        font-size: 14px;
      }

      .login-domain-tip {
        margin-top: 10px;
      }

      .login-footer {
        margin-top: 8px;
      }

      .header {
        gap: 10px;
      }

      .device-mode-badge,
      .site-pill {
        width: 100%;
        justify-content: center;
      }

      body.device-mobile .upload-source-row {
        display: none !important;
      }

      body.device-mobile .mobile-clear-base-btn {
        display: inline-flex;
      }

      body.device-mobile .puzzle-mode-row .tool-row-label {
        display: none;
      }

      .content {
        padding: 10px 12px 24px;
      }

      .main {
        flex-direction: column;
      }

      body.device-mobile .workflow-left-column {
        display: contents;
      }

      body.device-mobile .workflow-top-left {
        order: 1;
      }

      body.device-mobile .preview-stage-top {
        order: 2;
      }

      body.device-mobile .workflow-main-left {
        order: 3;
      }

      body.device-mobile .preview-stage-card {
        padding: 12px;
      }

      body.device-mobile .preview-stage-note {
        display: none;
      }

      body.device-mobile .phone-frame {
        max-width: 230px;
        margin: 8px auto 0;
      }

      body.device-mobile .toolbar-style-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 8px;
      }

      .mobile-action-grid {
        grid-template-columns: 1fr;
      }

      .title-action-row,
      .preview-toolbar,
      .preview-title-row,
      .title-secondary-actions,
      .login-feature-row {
        flex-direction: column;
        align-items: stretch;
      }

      .puzzle-mode-row {
        grid-template-columns: repeat(4, minmax(0, 1fr));
      }

      .tool-row-label {
        grid-column: 1 / -1;
      }

      .title-action-row input {
        min-width: 0;
      }

      body.device-mobile .toolbar-style-grid .style-font,
      body.device-mobile .toolbar-style-grid .style-bg {
        grid-column: 1 / -1;
      }

      .admin-panel {
        flex-direction: column;
      }

      .admin-sidebar {
        width: 100%;
        padding: 14px;
      }

      .admin-sidebar h3 {
        padding: 0;
        margin-bottom: 12px;
      }

      .admin-menu {
        display: inline-flex;
        padding: 8px 10px;
        border-left: 0;
        border-radius: 10px;
      }

      .admin-content {
        padding: 16px;
        overflow-x: auto;
      }

      .admin-table {
        min-width: 720px;
      }

      .admin-form {
        flex-wrap: wrap;
      }

      .logout-btn {
        margin: 12px 0 0;
      }
    }

    /* ===== Mobile workstation redesign ===== */
    @media (max-width: 720px) {
      body.device-mobile {
        background: #eef5fb;
      }

      body.device-mobile .main {
        min-height: 100vh;
        background:
          radial-gradient(circle at 18% 0%, rgba(14,165,233,0.18), transparent 28%),
          radial-gradient(circle at 100% 12%, rgba(37,99,235,0.14), transparent 30%),
          linear-gradient(180deg, #f8fbff 0%, #edf5fb 48%, #e9f3f1 100%);
      }

      body.device-mobile .header {
        position: sticky;
        top: 0;
        z-index: 30;
        height: auto;
        min-height: 64px;
        padding: 10px 14px;
        gap: 10px;
        align-items: flex-start;
        background: rgba(248,251,255,0.88);
        border-bottom: 1px solid rgba(148,163,184,0.18);
        box-shadow: 0 14px 34px rgba(15,23,42,0.08);
      }

      body.device-mobile .header .logo {
        width: 34px;
        height: 34px;
        border-radius: 11px;
        flex: 0 0 auto;
      }

      body.device-mobile .brand {
        flex: 1;
        min-width: 0;
      }

      body.device-mobile .brand h1 {
        font-size: 16px;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
      }

      body.device-mobile .brand p {
        font-size: 11px;
      }

      body.device-mobile .header-actions {
        width: auto;
        margin-left: auto;
        display: grid;
        grid-template-columns: auto;
        gap: 8px;
      }

      body.device-mobile .header-actions .btn {
        min-height: 34px;
        justify-content: center;
        padding: 7px 10px;
        font-size: 12px;
        border-radius: 999px;
        box-shadow: none;
      }

      body.device-mobile .header-actions .btn:first-child {
        display: none;
      }

      body.device-mobile .device-mode-badge {
        width: auto;
        margin: 0;
        padding: 7px 12px;
        color: #0f766e;
        background: rgba(240,253,250,0.86);
        border-color: rgba(20,184,166,0.18);
      }

      body.device-mobile .site-pill {
        display: none;
      }

      body.device-mobile .workspace-content {
        padding: 12px 10px 26px;
        gap: 12px;
      }

      body.device-mobile .workflow-shell,
      body.device-mobile .workflow-grid,
      body.device-mobile .workflow-left-column,
      body.device-mobile .workflow-main-left,
      body.device-mobile .workflow-top-left {
        gap: 12px;
      }

      body.device-mobile .workflow-grid-bottom,
      body.device-mobile #batchResultsPanel {
        display: none !important;
      }

      body.device-mobile .workflow-card,
      body.device-mobile .editor-stage-card,
      body.device-mobile .output-card,
      body.device-mobile .preview-stage-card {
        position: relative;
        border-radius: 22px;
        padding: 14px;
        background:
          linear-gradient(180deg, rgba(255,255,255,0.96), rgba(247,250,252,0.92)),
          radial-gradient(circle at top right, rgba(14,165,233,0.12), transparent 38%);
        border: 1px solid rgba(255,255,255,0.88);
        box-shadow:
          0 18px 40px rgba(15,23,42,0.08),
          inset 0 1px 0 rgba(255,255,255,0.95);
      }

      body.device-mobile .panel-title {
        margin-bottom: 10px;
        color: #0f172a;
        font-size: 15px;
        font-weight: 900;
      }

      body.device-mobile .panel-title .icon {
        width: 22px;
        height: 22px;
        border-radius: 8px;
        color: #fff;
        background: linear-gradient(135deg, #0f172a, #2563eb 68%, #0ea5e9);
        font-size: 12px;
        font-weight: 900;
      }

      body.device-mobile .form-group {
        margin-bottom: 10px;
      }

      body.device-mobile label,
      body.device-mobile .form-group label {
        margin-bottom: 5px;
        color: #475569;
        font-size: 12px;
        font-weight: 800;
      }

      body.device-mobile select,
      body.device-mobile input[type="text"],
      body.device-mobile input[type="number"],
      body.device-mobile textarea {
        min-height: 40px;
        border-radius: 14px;
        border-color: rgba(148,163,184,0.18);
        background: rgba(255,255,255,0.92);
        box-shadow: inset 0 1px 0 rgba(255,255,255,0.86);
        font-size: 14px;
      }

      body.device-mobile .mobile-action-grid {
        grid-template-columns: 1fr 1fr;
        gap: 8px;
      }

      body.device-mobile .mobile-action-grid .btn {
        min-height: 42px;
        justify-content: center;
        border-radius: 14px;
        font-size: 13px;
      }

      body.device-mobile .mobile-action-grid .btn-primary {
        background: linear-gradient(135deg, #0f172a 0%, #2563eb 58%, #00a6d6 100%);
      }

      body.device-mobile .mobile-helper-text,
      body.device-mobile .field-tip,
      body.device-mobile .editor-subtitle,
      body.device-mobile .count-tip {
        margin-top: 7px;
        color: #64748b;
        font-size: 11px;
        line-height: 1.55;
      }

      body.device-mobile .upload-control-stack {
        margin-top: 8px;
        padding: 7px;
        border-radius: 17px;
        background: rgba(241,245,249,0.74);
      }

      body.device-mobile .puzzle-mode-row {
        grid-template-columns: repeat(4, minmax(0, 1fr));
        gap: 6px;
        padding-top: 0;
        border-top: 0;
      }

      body.device-mobile .puzzle-mode-row .btn {
        min-height: 38px;
        padding: 7px 5px;
        border-radius: 13px;
        font-size: 12px;
      }

      body.device-mobile .mobile-clear-base-btn {
        color: #b45309;
        background: #fff7ed;
      }

      body.device-mobile .compact-upload {
        min-height: 116px;
        padding: 18px 12px;
        border-radius: 18px;
        background:
          linear-gradient(180deg, rgba(248,250,252,0.9), rgba(241,245,249,0.8)),
          radial-gradient(circle at top, rgba(14,165,233,0.08), transparent 36%);
      }

      body.device-mobile .compact-upload .upload-icon {
        width: 38px;
        height: 38px;
        margin: 0 auto 8px;
        display: grid;
        place-items: center;
        border-radius: 13px;
        color: #fff;
        background: linear-gradient(135deg, #0f172a, #0ea5e9);
        font-size: 20px;
      }

      body.device-mobile .overlay-action-row {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 7px;
        margin-top: 8px;
      }

      body.device-mobile .overlay-action-row .count-tip {
        grid-column: 1 / -1;
      }

      body.device-mobile .overlay-action-row:not(.has-overlays) .btn {
        display: none;
      }

      body.device-mobile .overlay-action-row .btn {
        justify-content: center;
        min-height: 34px;
        padding: 7px 8px;
        border-radius: 12px;
        font-size: 12px;
      }

      body.device-mobile .scene-card .title-secondary-actions {
        display: grid;
        grid-template-columns: 1fr 1fr;
        overflow: visible;
        gap: 7px;
      }

      body.device-mobile .scene-card .title-secondary-actions .hero-action-btn {
        grid-column: 1 / -1;
        min-height: 42px;
        font-size: 14px;
      }

      body.device-mobile .scene-card .title-secondary-actions .btn {
        min-height: 36px;
        border-radius: 13px;
      }

      body.device-mobile .preview-stage-top {
        order: 2;
        padding-bottom: 16px;
      }

      body.device-mobile .preview-stage-card .preview-title-row {
        display: grid;
        grid-template-columns: 1fr;
        gap: 8px;
      }

      body.device-mobile .preview-stage-card .preview-title-row > span {
        color: #0f172a;
        font-size: 15px;
        font-weight: 900;
      }

      body.device-mobile .preview-toolbar {
        display: block;
      }

      body.device-mobile .export-btn {
        width: 100%;
        min-height: 42px;
        border-radius: 999px;
        background: linear-gradient(135deg, #0f172a 0%, #2563eb 55%, #0ea5e9 100%);
        box-shadow: 0 18px 30px rgba(37,99,235,0.16);
      }

      body.device-mobile .mobile-save-tip {
        margin: 8px 0 10px;
        padding: 9px 11px;
        color: #0369a1;
        background: #e0f2fe;
        border: 1px solid rgba(14,165,233,0.16);
        border-radius: 14px;
      }

      body.device-mobile .phone-frame {
        width: min(230px, 78vw) !important;
        max-width: 230px;
        margin: 10px auto 0 !important;
        padding: 8px;
        border-radius: 28px;
        background: linear-gradient(145deg, #0f172a, #111827);
        box-shadow:
          0 24px 44px rgba(15,23,42,0.2),
          0 0 0 8px rgba(15,118,110,0.08);
      }

      body.device-mobile .phone-screen {
        border-radius: 21px;
        overflow: hidden;
      }

      body.device-mobile .puzzle-arrange-panel {
        margin-top: 10px;
        padding: 9px;
        border-radius: 16px;
      }

      body.device-mobile .puzzle-arrange-head strong {
        font-size: 12px;
      }

      body.device-mobile .puzzle-arrange-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
      }

      body.device-mobile .workflow-main-left {
        order: 3;
      }

      body.device-mobile .editor-stage-card .editor-subtitle {
        display: none;
      }

      body.device-mobile .toolbar-style-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 8px;
        padding: 0;
        background: transparent;
        border: 0;
        box-shadow: none;
      }

      body.device-mobile .toolbar-style-grid .edit-item {
        min-height: 72px;
        padding: 10px;
        border-radius: 16px;
        background: rgba(255,255,255,0.82);
      }

      body.device-mobile .toolbar-style-grid .style-font,
      body.device-mobile .toolbar-style-grid .style-bg {
        grid-column: 1 / -1;
      }

      body.device-mobile .toolbar-style-grid select {
        height: 38px;
        min-height: 38px;
        border-radius: 12px;
      }

      body.device-mobile .toolbar-style-grid .color-picker {
        flex-wrap: wrap;
        gap: 7px;
        overflow: visible;
      }

      body.device-mobile .toolbar-style-grid .color-option {
        width: 22px;
        height: 22px;
      }

      body.device-mobile .workflow-grid-output {
        display: grid;
        grid-template-columns: 1fr;
        gap: 12px;
      }

      body.device-mobile .preview-title-row {
        display: grid;
        grid-template-columns: 1fr;
        gap: 8px;
      }

      body.device-mobile .output-card .preview-toolbar {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 7px;
      }

      body.device-mobile .output-card .preview-toolbar .btn {
        justify-content: center;
        min-height: 34px;
        padding: 7px 8px !important;
        border-radius: 12px;
        font-size: 12px !important;
      }

      body.device-mobile .result-surface {
        min-height: 160px;
        padding: 12px;
        border-radius: 16px;
        background: rgba(248,250,252,0.76);
      }

      body.device-mobile .comment-thread {
        margin-top: 8px !important;
      }

      body.device-mobile .comment-item {
        border-radius: 15px;
      }
    }

    /* ===== Final mobile readability pass ===== */
    @media (max-width: 960px) {
      .login-overlay {
        height: 100dvh;
        align-items: flex-start;
        justify-content: center;
        padding: 10px 12px 14px;
        overflow-y: auto;
      }

      .login-overlay #loginCanvas,
      .login-backdrop-glow,
      .login-feature-row {
        display: none !important;
      }

      .login-box {
        width: min(100%, 430px);
        max-width: 430px;
        margin: 0 auto;
        padding: 16px;
        border-radius: 24px;
        background:
          radial-gradient(circle at top left, rgba(37,99,235,0.18), transparent 34%),
          linear-gradient(180deg, rgba(15,23,42,0.94), rgba(8,16,30,0.96));
        border-color: rgba(125,211,252,0.16);
        box-shadow: 0 20px 55px rgba(2,6,23,0.42), inset 0 1px 0 rgba(255,255,255,0.08);
      }

      .login-hero {
        padding: 0 4px 10px;
      }

      .login-icon {
        width: 48px;
        height: 48px;
        margin-bottom: 10px;
        border-radius: 16px;
      }

      .site-badge {
        margin-bottom: 8px;
        color: #93c5fd;
        background: rgba(37,99,235,0.16);
        border: 1px solid rgba(96,165,250,0.18);
      }

      .login-box h2 {
        color: #ffffff;
        font-size: 25px;
        line-height: 1.18;
        text-shadow: 0 8px 24px rgba(59,130,246,0.18);
      }

      .login-box .sub {
        margin-bottom: 10px;
        color: #dbeafe;
        font-size: 12px;
      }

      .device-login-chip {
        color: #dbeafe;
        background: rgba(219,234,254,0.1);
        border-color: rgba(147,197,253,0.2);
      }

      .login-form-card {
        margin-top: 8px;
        padding: 14px;
        border-radius: 20px;
        background: rgba(2,6,23,0.46);
        border-color: rgba(148,163,184,0.16);
      }

      .login-box label {
        color: #e2e8f0;
        font-size: 12px;
      }

      .login-box input,
      body.device-mobile .login-box input,
      body.device-mobile .login-box input[type="text"],
      body.device-mobile .login-box input[type="password"] {
        min-height: 46px;
        margin-bottom: 12px;
        padding: 12px 14px;
        border-radius: 16px;
        border: 1px solid rgba(148,163,184,0.2) !important;
        background: rgba(15,23,42,0.72) !important;
        color: #f8fafc !important;
        caret-color: #38bdf8;
        box-shadow: inset 0 1px 0 rgba(255,255,255,0.05) !important;
        -webkit-text-fill-color: #f8fafc;
      }

      .login-box input::placeholder,
      body.device-mobile .login-box input::placeholder {
        color: rgba(203,213,225,0.62) !important;
        -webkit-text-fill-color: rgba(203,213,225,0.62);
      }

      .login-box input:focus,
      body.device-mobile .login-box input:focus {
        border-color: rgba(56,189,248,0.8) !important;
        background: rgba(8,18,34,0.88) !important;
        box-shadow: 0 0 0 3px rgba(14,165,233,0.16), inset 0 1px 0 rgba(255,255,255,0.06) !important;
      }

      .login-box input:-webkit-autofill,
      .login-box input:-webkit-autofill:hover,
      .login-box input:-webkit-autofill:focus {
        box-shadow: 0 0 0 1000px #111c2f inset !important;
        -webkit-text-fill-color: #f8fafc !important;
        caret-color: #38bdf8;
      }

      .password-field {
        margin-bottom: 12px;
      }

      .password-field input,
      body.device-mobile .password-field input {
        margin-bottom: 0 !important;
        padding-right: 52px !important;
      }

      .password-eye {
        color: #e0f2fe;
        background: rgba(30,41,59,0.96);
        border-color: rgba(125,211,252,0.28);
      }

      .login-box .btn-row {
        gap: 9px;
      }

      .login-box .btn-login {
        min-height: 46px;
        padding: 12px 10px;
        border-radius: 15px;
        font-size: 14px;
      }

      .login-back-btn {
        margin-top: 10px;
        min-height: 42px;
        border-radius: 16px;
        color: #e2e8f0;
        background: rgba(255,255,255,0.06);
      }

      .login-domain-tip,
      .login-footer {
        color: rgba(203,213,225,0.76);
      }

      .login-footer a,
      .login-domain-tip a {
        color: #93c5fd;
      }
    }

    @media (max-width: 720px) {
      body.device-mobile select,
      body.device-mobile input[type="text"],
      body.device-mobile input[type="number"],
      body.device-mobile textarea {
        color: #0f172a;
      }

      body.device-mobile select::placeholder,
      body.device-mobile input::placeholder,
      body.device-mobile textarea::placeholder {
        color: #64748b;
      }

      .login-domain-tip {
        display: none;
      }

      .login-footer {
        margin-top: 10px;
      }
    }

    /* ===== Mobile workstation compact layout pass ===== */
    @media (max-width: 720px) {
      body.device-mobile .workspace-content {
        padding: 8px 8px 18px;
      }

      body.device-mobile .workflow-shell,
      body.device-mobile .workflow-grid,
      body.device-mobile .workflow-left-column,
      body.device-mobile .workflow-main-left,
      body.device-mobile .workflow-top-left {
        gap: 8px;
      }

      body.device-mobile .workflow-card,
      body.device-mobile .editor-stage-card,
      body.device-mobile .output-card,
      body.device-mobile .preview-stage-card {
        padding: 10px;
        border-radius: 18px;
        box-shadow:
          0 12px 28px rgba(15,23,42,0.07),
          inset 0 1px 0 rgba(255,255,255,0.9);
      }

      body.device-mobile .panel-title {
        margin-bottom: 7px;
        font-size: 14px;
      }

      body.device-mobile .panel-title .icon {
        width: 20px;
        height: 20px;
        border-radius: 7px;
        font-size: 11px;
      }

      body.device-mobile .form-group {
        margin-bottom: 8px;
      }

      body.device-mobile label,
      body.device-mobile .form-group label,
      body.device-mobile .edit-grid label {
        margin-bottom: 4px;
        font-size: 11px;
      }

      body.device-mobile select,
      body.device-mobile input[type="text"],
      body.device-mobile input[type="number"],
      body.device-mobile textarea {
        min-height: 36px;
        border-radius: 12px;
        font-size: 13px;
      }

      body.device-mobile .mobile-action-grid .btn,
      body.device-mobile .scene-card .title-secondary-actions .btn,
      body.device-mobile .puzzle-mode-row .btn {
        min-height: 34px;
        padding: 6px 7px;
        border-radius: 12px;
        font-size: 12px;
      }

      body.device-mobile .scene-card .title-secondary-actions .hero-action-btn {
        min-height: 38px;
      }

      body.device-mobile .scene-card .scene-type-group {
        display: grid;
        grid-template-columns: auto minmax(0, 1fr);
        align-items: center;
        gap: 8px;
        padding: 6px 8px;
        border-radius: 14px;
        background: rgba(241,245,249,0.72);
        border: 1px solid rgba(148,163,184,0.14);
      }

      body.device-mobile .scene-card .scene-type-group label {
        margin: 0;
        color: #64748b;
        white-space: nowrap;
      }

      body.device-mobile .scene-card .scene-type-group select {
        min-height: 32px;
        height: 32px;
        padding: 4px 10px;
        border-radius: 999px;
        font-size: 13px;
        font-weight: 800;
        color: #0f172a;
        background: #fff;
      }

      body.device-mobile .mobile-helper-text,
      body.device-mobile .field-tip,
      body.device-mobile .count-tip {
        margin-top: 5px;
        font-size: 10px;
        line-height: 1.45;
      }

      body.device-mobile .upload-control-stack {
        margin-top: 6px;
        padding: 6px;
        border-radius: 15px;
      }

      body.device-mobile .compact-upload {
        min-height: 82px;
        padding: 12px 10px;
        border-radius: 16px;
      }

      body.device-mobile .compact-upload .upload-icon {
        width: 32px;
        height: 32px;
        margin-bottom: 6px;
        border-radius: 11px;
        font-size: 17px;
      }

      body.device-mobile .compact-upload .upload-text {
        font-size: 13px;
      }

      body.device-mobile .compact-upload .upload-text span {
        margin-top: 3px;
        font-size: 10px;
        line-height: 1.35;
      }

      body.device-mobile .preview-stage-top {
        padding-bottom: 10px;
      }

      body.device-mobile .preview-stage-card .preview-title-row {
        grid-template-columns: 1fr;
        gap: 6px;
      }

      body.device-mobile .export-btn {
        min-height: 36px;
      }

      body.device-mobile .mobile-save-tip {
        margin: 6px 0 7px;
        padding: 7px 9px;
        font-size: 10px;
        line-height: 1.45;
      }

      body.device-mobile .phone-frame {
        width: min(160px, 52vw) !important;
        max-width: 160px;
        margin: 8px auto 0 !important;
        padding: 7px;
        border-radius: 24px;
        box-shadow:
          0 18px 34px rgba(15,23,42,0.16),
          0 0 0 6px rgba(15,118,110,0.07);
      }

      body.device-mobile .phone-screen {
        border-radius: 18px;
      }

      body.device-mobile .puzzle-arrange-panel {
        margin-top: 8px;
        padding: 8px;
      }

      body.device-mobile .editor-stage-card {
        padding-bottom: 9px;
      }

      body.device-mobile .toolbar-style-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 6px;
      }

      body.device-mobile .toolbar-style-grid .style-font,
      body.device-mobile .toolbar-style-grid .style-bg {
        grid-column: auto;
      }

      body.device-mobile .toolbar-style-grid .edit-item {
        min-height: 0;
        padding: 6px;
        border-radius: 12px;
      }

      body.device-mobile .toolbar-style-grid .style-text-color,
      body.device-mobile .toolbar-style-grid .style-stroke,
      body.device-mobile .toolbar-style-grid .style-bg {
        background:
          linear-gradient(180deg, rgba(239,246,255,0.94), rgba(248,250,252,0.96)),
          radial-gradient(circle at top right, rgba(14,165,233,0.12), transparent 42%);
        border-color: rgba(125,211,252,0.28);
      }

      body.device-mobile .toolbar-style-grid select {
        height: 32px;
        min-height: 32px;
        padding: 5px 7px;
        border-radius: 10px;
        font-size: 11px;
      }

      body.device-mobile .toolbar-style-grid .color-picker {
        min-height: 30px;
        align-items: center;
        gap: 4px;
        flex-wrap: wrap;
        padding: 4px;
        border-radius: 10px;
        background:
          linear-gradient(45deg, rgba(148,163,184,0.12) 25%, transparent 25%),
          linear-gradient(-45deg, rgba(148,163,184,0.12) 25%, transparent 25%),
          linear-gradient(45deg, transparent 75%, rgba(148,163,184,0.12) 75%),
          linear-gradient(-45deg, transparent 75%, rgba(148,163,184,0.12) 75%),
          rgba(255,255,255,0.72);
        background-size: 12px 12px;
        background-position: 0 0, 0 6px, 6px -6px, -6px 0;
      }

      body.device-mobile .toolbar-style-grid .color-option {
        width: 18px;
        height: 18px;
        border-width: 2px;
      }

      body.device-mobile .workflow-grid-output {
        gap: 8px;
      }

      body.device-mobile .preview-title-row {
        gap: 6px;
      }

      body.device-mobile .output-card .preview-toolbar {
        gap: 6px;
      }

      body.device-mobile .output-card .preview-toolbar .btn {
        min-height: 30px;
        padding: 5px 7px !important;
        font-size: 11px !important;
        border-radius: 10px;
      }

      body.device-mobile .result-surface {
        min-height: 0;
        max-height: 188px;
        overflow-y: auto;
        padding: 10px;
        border-radius: 14px;
      }

      body.device-mobile .result-surface p,
      body.device-mobile .result-surface div {
        font-size: 12px;
        line-height: 1.65;
      }

      body.device-mobile .comment-thread {
        max-height: 230px;
        overflow-y: auto;
        padding-right: 2px;
      }

      body.device-mobile .comment-item {
        margin-bottom: 8px;
        border-radius: 13px;
      }

      body.device-mobile .comment-author {
        font-size: 12px;
      }

      body.device-mobile .comment-text {
        padding: 9px 10px;
        font-size: 12px;
        line-height: 1.6;
      }

      body.device-mobile .app-footer {
        padding: 6px 10px;
        font-size: 10px;
        gap: 6px 10px;
      }
    }

    @media (max-width: 360px) {
      body.device-mobile .toolbar-style-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
      }
    }
  
