/* Unified Tool Runtime V2 — bundled here to keep the root cold start request count unchanged. */
:root {
  --tool-v2-accent: #2cff73;
  --tool-v2-ink: #111411;
  --tool-v2-border: #ecedef;
  --tool-v2-control-radius: 12px;
  --tool-v2-card-radius: 16px;
  --tool-v2-panel-radius: 24px;
  --tool-v2-motion: 180ms cubic-bezier(.2, .8, .2, 1);
  --tool-v2-shell-height: 64px;
  --tool-v2-safe-top: max(var(--app-safe-top, 0px), env(safe-area-inset-top, 0px));
  --tool-v2-shell-block-size: calc(var(--tool-v2-shell-height) + var(--tool-v2-safe-top));
}

.tool-runtime-v2-shell {
  position: fixed;
  z-index: 9000;
  top: var(--tool-v2-safe-top);
  right: 0;
  left: 0;
  min-height: var(--tool-v2-shell-height);
  padding: 10px max(16px, var(--app-safe-right, 0px), env(safe-area-inset-right, 0px)) 10px max(16px, var(--app-safe-left, 0px), env(safe-area-inset-left, 0px));
  box-sizing: border-box;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  color: var(--tool-v2-ink);
  background: rgba(255, 255, 255, .96);
  border-bottom: 1px solid var(--tool-v2-border);
  font-family: "OPPO Sans", "PingFang SC", system-ui, sans-serif;
  backdrop-filter: blur(18px);
}

.tool-runtime-v2-shell[hidden] { display: none !important; }
.tool-runtime-v2-brand, .tool-runtime-v2-shell nav { display: flex; align-items: center; gap: 8px; }
.tool-runtime-v2-brand > span { width: 36px; height: 36px; border-radius: 12px; display: grid; place-items: center; background: var(--tool-v2-accent); font-weight: 900; }
.tool-runtime-v2-brand strong { white-space: nowrap; }
.tool-runtime-v2-brand i { color: #875600; background: #fff5cc; border-radius: 999px; padding: 4px 8px; font-size: 12px; font-style: normal; }
.tool-runtime-v2-shell button { min-width: 44px; min-height: 44px; padding: 0 14px; border: 1px solid var(--tool-v2-border); border-radius: var(--tool-v2-control-radius); color: var(--tool-v2-ink); background: #fff; font: inherit; font-weight: 700; cursor: pointer; transition: transform var(--tool-v2-motion), background var(--tool-v2-motion), opacity var(--tool-v2-motion); }
.tool-runtime-v2-shell button:hover:not(:disabled) { background: #f5f7f5; transform: translateY(-1px); }
.tool-runtime-v2-shell button:focus-visible, .tool-runtime-v2-export-dialog button:focus-visible { outline: 3px solid rgba(44, 255, 115, .35); outline-offset: 2px; }
.tool-runtime-v2-shell button:disabled { opacity: .42; cursor: not-allowed; }
.tool-runtime-v2-shell button.is-primary { min-width: 92px; background: var(--tool-v2-accent); border-color: var(--tool-v2-accent); color: #081109; }
.tool-runtime-v2-live { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.tool-runtime-v2-toast { position: fixed; top: calc(var(--tool-v2-shell-block-size) + 12px); left: 50%; max-width: min(520px, calc(100vw - 32px)); padding: 12px 16px; border-radius: var(--tool-v2-control-radius); color: #fff; background: #151915; box-shadow: 0 12px 32px rgba(0, 0, 0, .18); opacity: 0; transform: translate(-50%, -8px); pointer-events: none; transition: opacity var(--tool-v2-motion), transform var(--tool-v2-motion); }
.tool-runtime-v2-toast.is-visible { opacity: 1; transform: translate(-50%, 0); }
.tool-runtime-v2-toast[data-kind="error"] { background: #9d1c1c; }
.tool-runtime-v2-toast[data-kind="success"] { color: #09140b; background: var(--tool-v2-accent); }

.runtime-v2-active body { padding-top: var(--tool-v2-shell-block-size) !important; }
.runtime-v2-managed > .topbar { display: none !important; }

.tool-runtime-v2-export-dialog { width: min(520px, calc(100vw - 28px)); padding: 0; border: 1px solid var(--tool-v2-border); border-radius: var(--tool-v2-panel-radius); color: var(--tool-v2-ink); background: #fff; font-family: "OPPO Sans", "PingFang SC", system-ui, sans-serif; box-shadow: 0 28px 80px rgba(0, 0, 0, .2); }
.tool-runtime-v2-export-dialog::backdrop { background: rgba(8, 12, 9, .42); backdrop-filter: blur(4px); }
.tool-runtime-v2-export-dialog form { padding: 22px; }
.tool-runtime-v2-export-dialog header { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 18px; }
.tool-runtime-v2-export-dialog h2 { margin: 3px 0 0; font-size: 22px; }
.tool-runtime-v2-export-dialog header small, .tool-runtime-v2-export-dialog form > p { color: #6b716c; }
.tool-runtime-v2-export-dialog header button { width: 44px; height: 44px; border: 1px solid var(--tool-v2-border); border-radius: var(--tool-v2-control-radius); background: #fff; font-size: 24px; }
.tool-runtime-v2-export-dialog [data-runtime-export-options] { display: grid; gap: 10px; }
.tool-runtime-v2-export-dialog [data-runtime-capability] { min-height: 64px; padding: 12px 16px; display: flex; align-items: center; justify-content: space-between; gap: 16px; text-align: left; border: 1px solid var(--tool-v2-border); border-radius: var(--tool-v2-card-radius); background: #fff; color: inherit; }
.tool-runtime-v2-export-dialog [data-runtime-capability]:hover { border-color: #b8edc9; background: #f4fff7; }
.tool-runtime-v2-export-dialog [data-runtime-capability] small { color: #747a75; }
.tool-runtime-v2-export-dialog form > p { margin: 16px 0 0; font-size: 13px; }

@media (max-width: 640px) {
  :root { --tool-v2-shell-height: 68px; }
  .tool-runtime-v2-shell { gap: 8px; overflow-x: auto; }
  .tool-runtime-v2-brand > span, .tool-runtime-v2-brand strong { display: none; }
  .tool-runtime-v2-brand i { position: absolute; top: 4px; left: 58px; padding: 2px 6px; }
  .tool-runtime-v2-shell nav { margin-left: auto; }
  .tool-runtime-v2-shell button { padding: 0 10px; }
  .tool-runtime-v2-shell nav button { min-width: 48px; font-size: 13px; }
  .runtime-v2-managed .workspace, .runtime-v2-managed .summer-benefits-workspace, .runtime-v2-managed .price-tag-workspace { min-height: calc(100dvh - var(--tool-v2-shell-block-size)); }
  .runtime-v2-managed .workspace { grid-template-columns: minmax(0, 1fr) !important; grid-template-rows: minmax(0, 35dvh) minmax(0, 65dvh) !important; }
  .runtime-v2-managed .preview-panel { min-height: 0; overflow: hidden; }
  .runtime-v2-managed .editor-panel, .runtime-v2-managed .control-area { min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding-bottom: max(24px, env(safe-area-inset-bottom, var(--app-safe-bottom, 0px))); }
}

@media (prefers-reduced-motion: reduce) {
  .tool-runtime-v2-shell *, .tool-runtime-v2-toast { scroll-behavior: auto !important; transition-duration: 1ms !important; animation-duration: 1ms !important; }
}
/* End Unified Tool Runtime V2 bundle. */

/* LightFieldCard bridge: Registry markup consumes the design-system primitive.
   Geometry and interaction stay public; only --lf-card-accent is data-driven. */
.feature-card.lf-card {
  min-height: 174px;
  padding: var(--lf-card-padding);
  border: 1px solid var(--lf-card-border);
  border-radius: var(--lf-card-radius);
  display: grid;
  grid-template-columns: var(--lf-card-icon-size) minmax(0, 1fr);
  grid-template-rows: auto minmax(0, 1fr) auto;
  grid-template-areas: "icon title" "icon description" ". action";
  column-gap: 14px;
  row-gap: 5px;
  align-content: stretch;
  background:
    radial-gradient(circle at 0 0, color-mix(in srgb, var(--lf-card-accent) 9%, transparent) 0, transparent 62%),
    var(--lf-card-surface);
  box-shadow: var(--lf-card-shadow);
}
.feature-card.lf-card.featured,
.feature-card.lf-card.available.featured,
.feature-card.lf-card.poster-entry,
.feature-card.lf-card.long-entry,
.feature-card.lf-card.asset-entry,
.feature-card.lf-card.official-watermark-entry {
  border-color: var(--lf-card-border);
  background:
    radial-gradient(circle at 0 0, color-mix(in srgb, var(--lf-card-accent) 9%, transparent) 0, transparent 62%),
    var(--lf-card-surface);
  box-shadow: var(--lf-card-shadow);
}
.feature-card.lf-card .lf-card__icon {
  grid-area: icon;
  width: var(--lf-card-icon-size) !important;
  height: var(--lf-card-icon-size) !important;
  color: var(--lf-card-accent) !important;
}
.feature-card.lf-card .lf-card__title {
  grid-area: title;
  padding-right: 48px;
  display: -webkit-box;
  overflow: hidden;
  white-space: normal;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}
.feature-card.lf-card .lf-card__description {
  grid-area: description;
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}
.feature-card.lf-card .lf-card__action {
  grid-area: action;
  min-width: 44px;
  min-height: 44px;
  margin: -8px -8px -8px auto;
  display: grid;
  place-items: center;
  color: var(--lf-card-accent);
}
.feature-card.lf-card .lf-card__action > i,
.feature-card.lf-card .lf-card__action > em { position: static; margin: 0; }
.feature-card.lf-card .lf-card__badge {
  border-color: color-mix(in srgb, var(--lf-card-accent) 24%, var(--lf-card-border));
  color: color-mix(in srgb, var(--lf-card-accent) 68%, #111411);
  background: color-mix(in srgb, var(--lf-card-accent) 8%, #fff);
}
.launch-menu-btn { display: none; }
.license-sheet-detail { margin: 0; display: grid; gap: 10px; }
.license-sheet-detail > div { padding: 10px 12px; border: 1px solid #ECEDEF; border-radius: 12px; display: grid; grid-template-columns: 82px minmax(0, 1fr); gap: 10px; }
.license-sheet-detail dt { color: rgba(17,20,17,.58); }
.license-sheet-detail dd { margin: 0; min-width: 0; overflow-wrap: anywhere; font-weight: 700; }

@media (max-width: 768px) {
  html body .launch-shell {
    --page-gutter: 12px;
    padding-top: calc(var(--safe-area-top) + 6px) !important;
  }
  html body .launch-shell .launch-appbar {
    top: var(--safe-area-top) !important;
    min-height: 54px !important;
    height: auto !important;
    margin-bottom: 10px !important;
    padding: 5px 8px !important;
    border-radius: 18px;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 6px 8px;
    align-items: center;
  }
  .launch-brand { min-width: 0; gap: 7px; }
  .launch-brand strong { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; }
  .launch-mini-mark { width: 34px; height: 34px; flex: 0 0 34px; }
  .launch-actions { margin: 0; gap: 4px; }
  .launch-actions #enterAdminTool { display: none; }
  .launch-license-pill { min-width: 44px; max-width: 118px; min-height: 44px; padding: 0 9px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 11px; }
  .launch-icon-btn,
  .launch-menu-btn { width: 44px; min-width: 44px; min-height: 44px; padding: 0; }
  .launch-menu-btn { display: inline-grid; place-items: center; }
  .launch-nav,
  .launch-search { grid-column: 1 / -1; width: 100%; max-width: none; min-width: 0; }
  .launch-appbar:not([data-mobile-expanded="true"]) .launch-nav,
  .launch-appbar:not([data-mobile-expanded="true"]) .launch-search { display: none !important; }
  .launch-appbar[data-mobile-expanded="true"] .launch-nav { display: grid !important; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 4px; }
  .launch-appbar[data-mobile-expanded="true"] .launch-nav a { min-width: 0; min-height: 44px; padding: 0 4px; font-size: 12px; }
  .launch-appbar[data-mobile-expanded="true"] .launch-search { display: flex !important; min-height: 44px; }

  html body .launch-shell .launch-hero { min-height: 124px !important; padding: 14px 16px !important; border-radius: 20px; }
  .launch-hero .launch-mark { width: 34px; height: 34px; }
  .launch-hero p { margin: 8px 0 3px; font-size: 10px; }
  .launch-hero h1 { max-width: 270px; font-size: 22px; line-height: 1.16; }
  .developer-signature { margin-top: 5px; min-height: 30px; }
  .launch-summary { margin: 10px 0 14px; gap: 8px; }
  .profile-card,
  .expiry-card { min-height: 58px; padding: 10px 12px; }
  .tool-section { margin-top: 14px; }
  .tool-section h2 { margin-bottom: 9px; font-size: 18px; }
  .feature-grid,
  .open-tools,
  .pending-tools { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; gap: 11px !important; }
  html body .launch-shell .feature-card.lf-card {
    --lf-card-padding: 14px;
    min-height: 124px !important;
    height: 124px !important;
    padding: 14px !important;
    grid-template-columns: 44px minmax(0, 1fr) !important;
    grid-template-rows: 44px minmax(0, 1fr);
    grid-template-areas: "icon title" "description description";
    column-gap: 10px !important;
    row-gap: 2px !important;
    border-radius: 16px !important;
  }
  .feature-card.lf-card .lf-card__icon,
  .feature-card.lf-card .lf-card__icon .lf-icon-tile { width: 44px !important; height: 44px !important; min-width: 44px !important; min-height: 44px !important; }
  .feature-card.lf-card .lf-card__title { padding-right: 0; font-size: clamp(13px, 4vw, 15px) !important; line-height: 1.18 !important; }
  .feature-card.lf-card .lf-card__description { padding-right: 0; font-size: 10px !important; line-height: 1.28 !important; }
  .feature-card.lf-card .lf-card__action { position: absolute; right: 6px; bottom: 4px; min-height: 44px; margin: 0; }
}

@media (max-width: 340px) {
  .launch-license-pill { max-width: 92px; font-size: 10px; }
  .launch-actions { gap: 2px; }
  .feature-grid,
  .open-tools,
  .pending-tools { gap: 10px !important; }
  html body .launch-shell .feature-card.lf-card { padding: 12px !important; column-gap: 8px !important; }
}
/* Unified 2026 light-field interface.
   This is the final visual layer for Web and Android; feature logic stays unchanged. */
:root {
  --ui-primary: #2CFF73;
  --ui-primary-rgb: 44, 255, 115;
  --ui-cover: #2CFF73;
  --ui-cover-rgb: 44, 255, 115;
  --ui-poster: #FF4D5E;
  --ui-poster-rgb: 255, 77, 94;
  --ui-long: #7C5CFF;
  --ui-long-rgb: 124, 92, 255;
  --ui-asset: #23C7D9;
  --ui-asset-rgb: 35, 199, 217;
  --ui-ink: #141714;
  --ui-muted: rgba(20, 23, 20, .66);
  --ui-subtle: rgba(20, 23, 20, .48);
  --ui-line: rgba(20, 24, 20, .08);
  --ui-surface: rgba(255, 255, 255, .88);
  --ui-surface-strong: #FFFFFF;
  --ui-panel: rgba(248, 250, 249, .92);
  --ui-radius-card: 16px;
  --ui-radius-panel: 24px;
  --ui-shadow: 0 18px 48px rgba(18, 24, 18, .07);
  --ui-shadow-hover: 0 24px 64px rgba(18, 24, 18, .12);
  --ui-ease: 200ms cubic-bezier(.2, .8, .2, 1);
  --ds-primary: var(--ui-primary);
  --ds-primary-rgb: var(--ui-primary-rgb);
  --ds-bg: #F7F9F8;
  --ds-surface: var(--ui-surface-strong);
  --ds-text: var(--ui-ink);
  --ds-muted: var(--ui-muted);
  --ds-border: var(--ui-line);
  --ds-radius-card: var(--ui-radius-card);
  --ds-transition: var(--ui-ease);
}

html,
body {
  color: var(--ui-ink);
  background:
    linear-gradient(135deg, rgba(44, 255, 115, .10) 0%, rgba(255, 255, 255, 0) 34%),
    linear-gradient(225deg, rgba(35, 199, 217, .08) 0%, rgba(255, 255, 255, 0) 38%),
    #F7F9F8;
}

button,
a,
input,
textarea,
select {
  transition: transform var(--ui-ease), box-shadow var(--ui-ease), border-color var(--ui-ease), background-color var(--ui-ease), color var(--ui-ease), opacity var(--ui-ease);
}

button:active,
.quiet-btn:active,
.back-btn:active,
.export-btn:active,
.launch-icon-btn:active,
.feature-card.tap-animating {
  transform: translateY(3px) scale(.955);
}

.launch-shell,
.app {
  background:
    linear-gradient(180deg, rgba(255,255,255,.78) 0%, rgba(247,249,248,.94) 42%, rgba(241,245,243,.98) 100%),
    #F7F9F8;
}

.launch-shell {
  min-height: 100dvh;
  padding: 18px 24px 36px;
}

.launch-appbar,
.topbar {
  border: 1px solid rgba(255,255,255,.72);
  background: rgba(255,255,255,.76);
  box-shadow: 0 10px 34px rgba(16, 22, 16, .055);
  backdrop-filter: blur(22px);
  -webkit-backdrop-filter: blur(22px);
}

.launch-appbar {
  position: sticky;
  top: 0;
  z-index: 12;
  min-height: 64px;
  width: min(1180px, 100%);
  margin: 0 auto 26px;
  padding: 0 16px;
  border-radius: 24px;
}

.launch-brand strong,
.brand strong {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 0;
}

.launch-brand {
  min-width: 176px;
}

.launch-nav {
  display: flex;
  align-items: center;
  gap: 22px;
  flex: 0 0 auto;
}

.launch-nav a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 64px;
  white-space: nowrap;
  word-break: keep-all;
  line-height: 1;
}

.launch-search {
  flex: 1 1 300px;
  min-width: 260px;
  max-width: 420px;
}

.launch-mini-mark,
.launch-mark,
.brand-mark,
.activation-logo {
  color: #07120b;
  background: linear-gradient(145deg, var(--ui-primary), #0BA752);
  box-shadow: 0 14px 34px rgba(var(--ui-primary-rgb), .26);
}

.launch-content {
  width: min(1120px, 100%);
  margin: 0 auto;
}

.launch-hero {
  min-height: 290px;
  padding: 34px;
  border: 1px solid rgba(255,255,255,.9);
  border-radius: 30px;
  background:
    linear-gradient(120deg, rgba(255,255,255,.94) 0%, rgba(239,255,246,.88) 56%, rgba(255,255,255,.82) 100%);
  box-shadow: var(--ui-shadow);
}

.launch-hero p {
  margin-top: 24px;
  color: #047336;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: .08em;
}

.launch-hero h1 {
  max-width: 760px;
  font-size: clamp(34px, 5vw, 56px);
  line-height: 1.08;
  font-weight: 800;
}

.launch-summary {
  gap: 16px;
  margin: 18px 0 28px;
}

.profile-card,
.expiry-card,
.feature-card,
.asset-filter-panel,
.asset-main-panel,
.asset-detail,
.asset-product-card,
.asset-item-card,
.asset-link-dialog > div,
.progress-card,
.activation-card {
  border: 1px solid rgba(20, 24, 20, .075);
  border-radius: var(--ui-radius-card);
  background: var(--ui-surface);
  box-shadow: var(--ui-shadow);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}

.profile-card,
.expiry-card {
  min-height: 78px;
  padding: 18px 20px;
}

.tool-section {
  margin-top: 28px;
}

.tool-section h2 {
  font-size: 22px;
  font-weight: 800;
}

.tool-section > p {
  color: var(--ui-muted);
  font-size: 14px;
}

.feature-grid,
.open-tools,
.pending-tools {
  gap: 18px;
}

.feature-card {
  min-height: 194px;
  padding: 24px;
  border-radius: 20px;
  background: rgba(255,255,255,.84);
  box-shadow: var(--ui-shadow);
}

.feature-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--ui-shadow-hover);
}

.feature-card .tool-icon {
  width: 56px;
  height: 56px;
  border-radius: 17px;
  background: rgba(var(--ui-primary-rgb), .13);
  color: #047336;
}

.feature-card strong {
  font-size: 22px;
  line-height: 1.22;
  font-weight: 800;
}

.feature-card small {
  color: var(--ui-muted);
  font-size: 14px;
  line-height: 1.5;
}

.feature-card.featured,
.feature-card.available.featured {
  border-color: rgba(var(--ui-primary-rgb), .55);
  background:
    linear-gradient(135deg, rgba(var(--ui-primary-rgb), .18), rgba(255,255,255,.9) 58%, rgba(255,255,255,.84));
  box-shadow: 0 0 0 1px rgba(var(--ui-primary-rgb), .14), 0 22px 60px rgba(var(--ui-primary-rgb), .14);
}

.feature-card.poster-entry {
  border-color: rgba(var(--ui-poster-rgb), .22);
}

.feature-card.poster-entry .tool-icon {
  background: rgba(var(--ui-poster-rgb), .13);
  color: #D91F3A;
}

.feature-card.long-entry .tool-icon {
  background: rgba(var(--ui-long-rgb), .13);
  color: #5D43D6;
}

.asset-entry,
.feature-card.asset-entry {
  border-color: rgba(var(--ui-asset-rgb), .26);
}

.asset-entry .tool-icon {
  background: rgba(var(--ui-asset-rgb), .13);
  color: #07889A;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  min-height: var(--topbar-height);
  padding: 0 22px;
  border-width: 0 0 1px;
  border-radius: 0;
}

.brand {
  gap: 12px;
}

.top-actions button,
.top-actions a,
.launch-license-pill,
.launch-icon-btn,
.quiet-btn,
.back-btn,
.export-btn,
.activate-btn,
.asset-actions button,
.asset-link-list button,
.asset-detail-back,
.asset-tabs button {
  min-height: 44px;
  border-radius: 14px;
  border: 1px solid transparent;
  font-weight: 700;
}

.quiet-btn,
.back-btn,
.asset-detail-back,
.asset-tabs button {
  background: rgba(20,24,20,.06);
  color: rgba(20,23,20,.78);
}

.export-btn,
.activate-btn,
.asset-actions button:first-child,
.asset-link-list button:nth-child(2),
.asset-external-actions .export-btn {
  background: var(--ui-primary);
  color: #07120b;
  box-shadow: 0 12px 28px rgba(var(--ui-primary-rgb), .20);
}

.license-badge,
.launch-license-pill {
  color: #047336;
  background: rgba(var(--ui-primary-rgb), .14);
}

.workspace {
  grid-template-columns: minmax(420px, 1fr) minmax(360px, 430px);
  background:
    linear-gradient(135deg, rgba(255,255,255,.72), rgba(247,249,248,.92)),
    #F7F9F8;
}

.preview-panel {
  padding: 26px 32px 34px;
  background:
    linear-gradient(135deg, rgba(255,255,255,.66), rgba(255,255,255,.22)),
    #F7F9F8;
}

.editor-panel {
  border-left: 1px solid rgba(20,24,20,.075);
  background: rgba(255,255,255,.86);
  box-shadow: -16px 0 40px rgba(18,24,18,.035);
}

.section {
  margin-bottom: 20px;
}

.section-title strong {
  font-size: 18px;
  font-weight: 800;
}

.section-title > span {
  width: 34px;
  height: 34px;
  border-radius: 12px;
  background: rgba(var(--ui-primary-rgb), .14);
  color: #047336;
}

.ratio-card,
.template-card,
.upload-box,
.text-input,
.select-input,
.asset-search,
.asset-filter-panel select {
  border-radius: 14px;
  border-color: rgba(20,24,20,.09);
  background: rgba(255,255,255,.78);
}

.ratio-card.active,
.template-card.active,
.asset-tabs button.active {
  border-color: rgba(var(--ui-primary-rgb), .64);
  background: rgba(var(--ui-primary-rgb), .10);
  box-shadow: 0 0 0 3px rgba(var(--ui-primary-rgb), .12);
}

.poster-app {
  --ui-primary: var(--ui-poster);
  --ui-primary-rgb: var(--ui-poster-rgb);
  --ds-primary: var(--ui-poster);
  --ds-primary-rgb: var(--ui-poster-rgb);
}

.poster-app .brand-mark,
.poster-mark {
  background: linear-gradient(145deg, #FF6C79, #D91F3A);
  color: #fff;
  box-shadow: 0 14px 34px rgba(var(--ui-poster-rgb), .24);
}

.poster-app .workspace {
  background:
    linear-gradient(135deg, rgba(var(--ui-poster-rgb), .09), rgba(255,255,255,.04) 44%),
    #FAF7F8;
}

.poster-app .preview-panel {
  background:
    linear-gradient(135deg, rgba(var(--ui-poster-rgb), .10), rgba(255,255,255,.64)),
    #FAF7F8;
}

.poster-canvas-stage {
  border-radius: 24px;
  box-shadow: 0 22px 68px rgba(var(--ui-poster-rgb), .15);
}

.long-app {
  --ui-primary: var(--ui-long);
  --ui-primary-rgb: var(--ui-long-rgb);
  --ds-primary: var(--ui-long);
  --ds-primary-rgb: var(--ui-long-rgb);
}

.long-app .brand-mark {
  background: linear-gradient(145deg, #9076FF, #5136D2);
  color: #fff;
  box-shadow: 0 14px 34px rgba(var(--ui-long-rgb), .24);
}

.long-app .workspace {
  background:
    linear-gradient(135deg, rgba(var(--ui-long-rgb), .09), rgba(255,255,255,.04) 44%),
    #F8F7FD;
}

.long-canvas-stage {
  border-radius: 24px;
  border: 1px solid rgba(255,255,255,.08);
  background:
    linear-gradient(145deg, #202322, #121514);
}

.asset-app {
  --ui-primary: var(--ui-asset);
  --ui-primary-rgb: var(--ui-asset-rgb);
  --ds-primary: var(--ui-asset);
  --ds-primary-rgb: var(--ui-asset-rgb);
}

.asset-app .brand-mark {
  background: linear-gradient(145deg, #54E3EE, #07889A);
  color: #062326;
  box-shadow: 0 14px 34px rgba(var(--ui-asset-rgb), .22);
}

.asset-shell {
  background:
    linear-gradient(135deg, rgba(var(--ui-asset-rgb), .08), rgba(255,255,255,.02) 48%),
    #F7FAFA;
}

.asset-hero {
  border-radius: 24px;
  background:
    linear-gradient(120deg, rgba(255,255,255,.92), rgba(var(--ui-asset-rgb), .08));
  box-shadow: var(--ui-shadow);
}

.asset-product-card:hover,
.asset-item-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--ui-shadow-hover);
}

.asset-link-dialog {
  border-radius: 22px;
}

.asset-link-dialog::backdrop {
  background: rgba(10, 14, 10, .42);
  backdrop-filter: blur(10px);
}

.activation-gate {
  background:
    linear-gradient(135deg, rgba(var(--ui-primary-rgb), .10), rgba(255,255,255,0) 42%),
    #F7F9F8;
}

.toast {
  bottom: max(28px, calc(var(--app-safe-bottom) + 18px));
  z-index: 200;
  font-size: 13px;
  box-shadow: 0 16px 44px rgba(0,0,0,.18);
}

/* Mobile license screen must not inherit wider card assumptions from the final visual layer. */
@media (max-width: 720px) {
  .activation-gate,
  body.android-app .activation-gate {
    width: 100vw !important;
    max-width: 100vw !important;
    min-width: 0 !important;
    padding-left: 14px !important;
    padding-right: 14px !important;
    overflow-x: hidden !important;
    justify-items: start !important;
  }

  .activation-card,
  body.android-app .activation-card {
    width: min(360px, calc(100vw - 28px)) !important;
    max-width: min(360px, calc(100vw - 28px)) !important;
    min-width: 0 !important;
    margin: 0 !important;
    padding: 24px 20px !important;
    place-self: center start !important;
    overflow-x: hidden !important;
  }

  .activation-card *,
  body.android-app .activation-card * {
    box-sizing: border-box !important;
    max-width: 100% !important;
  }

  .license-input-wrap input,
  body.android-app .license-input-wrap input {
    min-width: 0 !important;
    font-size: 13px !important;
    letter-spacing: .015em !important;
  }

  .activate-btn,
  body.android-app .activate-btn,
  .contact-developer button,
  body.android-app .contact-developer button {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
  }

  .demo-license,
  body.android-app .demo-license {
    display: grid !important;
    grid-template-columns: 1fr !important;
    gap: 8px !important;
  }

  .demo-license button,
  body.android-app .demo-license button {
    width: 100% !important;
    text-align: left !important;
  }
}

/* Android 原生卡片进入 WebView 后，在服务端授权完成前隐藏工具首页闪烁。 */
.native-tool-route-pending {
  position: fixed;
  inset: 0;
  z-index: 160;
  display: grid;
  grid-template-rows: auto 1fr;
  min-height: 100dvh;
  color: #101510;
  background:
    radial-gradient(circle at 50% 28%, rgba(44, 255, 115, .16), transparent 34%),
    #f5f7f5;
}

.native-tool-route-pending__bar {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: calc(64px + var(--app-safe-top, 0px));
  padding: var(--app-safe-top, 0px) 16px 0;
  border-bottom: 1px solid #ecedef;
  background: rgba(255, 255, 255, .94);
}

.native-tool-route-pending__bar > span {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 12px;
  background: #2cff73;
  font-weight: 800;
}

.native-tool-route-pending__bar strong { font-size: 15px; }
.native-tool-route-pending__bar small {
  margin-left: auto;
  color: #687069;
  font-size: 12px;
}

.native-tool-route-pending__body {
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 10px;
  padding: 32px 24px calc(32px + var(--app-safe-bottom, 0px));
  text-align: center;
}

.native-tool-route-pending__body i {
  width: 34px;
  height: 34px;
  margin-bottom: 8px;
  border: 3px solid rgba(16, 21, 16, .12);
  border-top-color: #00ad4f;
  border-radius: 50%;
  animation: nativeToolRouteSpin 720ms linear infinite;
}

.native-tool-route-pending__body h1 {
  margin: 0;
  font-size: clamp(22px, 6vw, 30px);
}

.native-tool-route-pending__body p,
.native-tool-route-pending__body small { margin: 0; }
.native-tool-route-pending__body p { color: #3d463f; }
.native-tool-route-pending__body small { color: #737b75; }

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

@media (prefers-reduced-motion: reduce) {
  .native-tool-route-pending__body i { animation-duration: 1400ms; }
}

@media (min-width: 1080px) {
  .feature-grid,
  .open-tools,
  .pending-tools {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 720px) {
  .launch-shell {
    padding: 12px 16px 28px;
  }

  .launch-appbar {
    top: 8px;
    min-height: 58px;
    margin-bottom: 18px;
    border-radius: 22px;
  }

  .launch-nav,
  .launch-search {
    display: none !important;
  }

  .launch-actions {
    margin-left: auto;
  }

  .launch-hero {
    min-height: 230px;
    padding: 28px 24px;
  }

  .launch-hero h1 {
    font-size: 34px;
    line-height: 1.12;
  }

  .launch-summary {
    grid-template-columns: 1fr;
  }

  .feature-grid,
  .open-tools,
  .pending-tools {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
  }

  .feature-card {
    min-height: 158px;
    padding: 18px;
  }

  .feature-card .tool-icon {
    width: 48px;
    height: 48px;
  }

  .feature-card strong {
    font-size: 20px;
  }

  .feature-card small {
    font-size: 13px;
  }

  .workspace,
  .long-workspace,
  .poster-workspace {
    grid-template-columns: 1fr;
  }

  .preview-panel,
  .editor-panel {
    position: relative;
    top: auto;
    height: auto;
  }

  .editor-panel {
    border-left: 0;
    border-top: 1px solid rgba(20,24,20,.075);
  }
}

@media (max-width: 430px) {
  .launch-shell {
    padding-left: 14px;
    padding-right: 14px;
  }

  .launch-hero {
    min-height: 218px;
    padding: 24px 20px;
    border-radius: 26px;
  }

  .launch-hero h1 {
    font-size: 31px;
  }

  .feature-grid,
  .open-tools,
  .pending-tools {
    gap: 12px;
  }

  .feature-card {
    min-height: 146px;
    padding: 16px;
    border-radius: 18px;
  }

  .feature-card strong {
    font-size: 19px;
  }

  .topbar {
    padding-left: 12px;
    padding-right: 12px;
  }
}

body.android-app .launch-shell {
  padding-top: 3px !important;
  padding-bottom: max(24px, var(--app-safe-bottom)) !important;
}

body.android-app .launch-appbar {
  position: sticky !important;
  top: 0 !important;
  margin-top: 0 !important;
}

body.android-app .preview-panel {
  top: calc(var(--topbar-height) + var(--app-safe-top, 0px)) !important;
  height: calc(100dvh - var(--topbar-height) - var(--app-safe-top, 0px)) !important;
}

@media (max-width: 720px) {
  body.android-app .preview-panel {
    top: auto !important;
    height: auto !important;
  }
}

/* Final safe-area override. Keep this file last in index.html. */
html {
  box-sizing: border-box;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  padding-top: env(safe-area-inset-top);
  padding-bottom: env(safe-area-inset-bottom);
}

body.android-app {
  padding-top: env(safe-area-inset-top) !important;
  padding-bottom: env(safe-area-inset-bottom) !important;
}

.launch-shell {
  padding-top: 8px !important;
  padding-bottom: calc(28px + env(safe-area-inset-bottom)) !important;
}

body.android-app .launch-shell {
  padding-top: 8px !important;
  padding-bottom: calc(28px + env(safe-area-inset-bottom)) !important;
}

.launch-hero {
  margin-top: 8px !important;
}

body.android-app .launch-hero {
  margin-top: 8px !important;
}

/* Topbar safe-area padding is owned by styles.css via --android-status-bar. */

.workspace,
body.android-app .workspace,
.long-workspace,
.poster-workspace {
  min-height: calc(100dvh - var(--topbar-height) - var(--app-safe-top, 0px)) !important;
}

.preview-panel,
body.android-app .preview-panel {
  top: calc(var(--topbar-height) + var(--app-safe-top, 0px)) !important;
  height: calc(100dvh - var(--topbar-height) - var(--app-safe-top, 0px)) !important;
}

body.android-app .preview-panel {
  top: calc(var(--topbar-height) + var(--app-safe-top, 0px)) !important;
  height: calc(100dvh - var(--topbar-height) - var(--app-safe-top, 0px)) !important;
}

.long-canvas-stage,
.canvas-stage,
.long-editor-panel,
.poster-editor-panel,
.editor-panel {
  box-sizing: border-box;
}

.long-canvas-stage,
#longCanvas {
  touch-action: none;
  -webkit-user-select: none;
  user-select: none;
}

.long-canvas-stage.is-dragging,
.long-canvas-stage.is-dragging #longCanvas {
  cursor: grabbing;
}

@media (max-width: 720px) {
  .preview-panel,
  body.android-app .preview-panel {
    top: auto !important;
    height: auto !important;
  }
}

/* Final mobile home authority: keep the first row readable and make every
   registry card consume the same compact LightFieldCard geometry. */
@media (max-width: 768px) {
  html body .launch-shell .launch-appbar {
    grid-template-columns: minmax(132px, 1fr) auto !important;
    padding: 5px 8px !important;
  }

  html body .launch-shell .launch-brand {
    min-width: 0 !important;
    gap: 7px !important;
  }

  html body .launch-shell .launch-brand strong {
    display: block !important;
    min-width: 0 !important;
    overflow: visible !important;
    color: #101510 !important;
    font-size: 13px !important;
    line-height: 1.15 !important;
    text-overflow: clip !important;
    white-space: normal !important;
  }

  html body .launch-shell .launch-brand .launch-mini-mark {
    width: 34px !important;
    height: 34px !important;
    flex: 0 0 34px !important;
    opacity: 1 !important;
    display: inline-grid !important;
    place-items: center !important;
    border-radius: 11px !important;
    color: #101510 !important;
    background: linear-gradient(145deg, #2CFF73, #18D769) !important;
    box-shadow: 0 6px 16px rgba(44, 255, 115, .22) !important;
    font-size: 15px !important;
    font-weight: 900 !important;
  }

  html body .launch-shell .launch-brand img.launch-mini-mark {
    display: block !important;
    place-items: initial !important;
    border-radius: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
    object-fit: contain !important;
  }

  html body .launch-shell .launch-actions {
    min-width: 0 !important;
    gap: 4px !important;
  }

  html body .launch-shell .launch-license-pill {
    width: auto !important;
    min-width: 76px !important;
    max-width: 92px !important;
    min-height: 44px !important;
    padding: 0 8px !important;
    overflow: visible !important;
    font-size: 10px !important;
    text-overflow: clip !important;
    white-space: nowrap !important;
  }

  html body .launch-shell .feature-card.lf-card {
    height: 124px !important;
    min-height: 124px !important;
    padding: 12px !important;
    grid-template-columns: 44px minmax(0, 1fr) !important;
    grid-template-rows: 44px minmax(0, 1fr) !important;
    grid-template-areas:
      "icon title"
      "description description" !important;
    column-gap: 7px !important;
    row-gap: 4px !important;
    align-items: start !important;
  }

  html body .launch-shell .feature-card.lf-card .lf-card__icon {
    position: static !important;
    grid-area: icon !important;
    margin: 0 !important;
  }

  html body .launch-shell .feature-card.lf-card .lf-card__title {
    grid-area: title !important;
    align-self: center !important;
    padding: 0 !important;
    display: -webkit-box !important;
    max-height: 36px !important;
    overflow: hidden !important;
    color: #101510 !important;
    font-size: 14px !important;
    line-height: 1.24 !important;
    text-align: left !important;
    text-overflow: clip !important;
    white-space: normal !important;
    overflow-wrap: anywhere !important;
    -webkit-box-orient: vertical !important;
    -webkit-line-clamp: 2 !important;
  }

  html body .launch-shell .feature-card.lf-card .lf-card__description {
    position: static !important;
    grid-area: description !important;
    align-self: start !important;
    margin: 0 !important;
    padding: 0 !important;
    display: -webkit-box !important;
    max-height: 28px !important;
    overflow: hidden !important;
    color: #68716b !important;
    font-size: 10px !important;
    line-height: 1.35 !important;
    text-align: left !important;
    text-overflow: clip !important;
    white-space: normal !important;
    overflow-wrap: anywhere !important;
    -webkit-box-orient: vertical !important;
    -webkit-line-clamp: 2 !important;
  }

  html body .launch-shell .feature-card.lf-card .lf-card__badge {
    position: absolute !important;
    grid-area: auto !important;
    top: 7px !important;
    left: 43px !important;
    z-index: 2 !important;
    width: 24px !important;
    min-width: 24px !important;
    max-width: 24px !important;
    min-height: 20px !important;
    margin: 0 !important;
    padding: 0 3px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    overflow: hidden !important;
    font-size: 7px !important;
    line-height: 1 !important;
    white-space: nowrap !important;
  }

  html body .launch-shell .feature-card.lf-card .lf-card__action {
    position: absolute !important;
    grid-area: auto !important;
    right: 3px !important;
    bottom: 3px !important;
    min-width: 44px !important;
    min-height: 44px !important;
    margin: -9px -9px -9px 0 !important;
  }
}

@media (max-width: 340px) {
  html body .launch-shell .launch-appbar {
    grid-template-columns: minmax(124px, 1fr) auto !important;
  }

  html body .launch-shell .launch-actions {
    width: 118px !important;
    display: flex !important;
    flex-wrap: wrap !important;
    justify-content: flex-end !important;
  }

  html body .launch-shell .launch-brand strong {
    font-size: 12px !important;
  }

  html body .launch-shell .launch-license-pill {
    min-width: 70px !important;
    max-width: 76px !important;
    padding-inline: 5px !important;
  }
}

/* Safe Area Layout Engine: final contract for Web, Android WebView and iOS. */
:root {
  --safe-area-top-raw: var(--app-safe-top, env(safe-area-inset-top, 0px));
  --safe-area-bottom-raw: var(--app-safe-bottom, env(safe-area-inset-bottom, 0px));
  --safe-area-top: clamp(0px, var(--safe-area-top-raw), 48px);
  --safe-area-bottom: clamp(0px, var(--safe-area-bottom-raw), 34px);
  --page-gutter: 16px;
  --page-top-gap: 12px;
  --page-bottom-gap: 12px;
  --nav-content-height: 56px;
  --nav-total-height: calc(var(--safe-area-top) + var(--nav-content-height));
}

html,
body {
  box-sizing: border-box;
  min-height: 100%;
}

*,
*::before,
*::after {
  box-sizing: inherit;
}

body,
body.android-app {
  padding-top: 0 !important;
  padding-bottom: 0 !important;
}

/*
 * Shared safe-area contract for independently rendered tools.
 * A tool root only needs data-safe-area-page and its header needs
 * data-safe-area-header. Android WebView supplies --app-safe-top/bottom;
 * browsers fall back to the platform safe-area environment variables.
 */
[data-safe-area-page] {
  --safe-area-page-top: var(--app-safe-top, env(safe-area-inset-top, 0px));
  --safe-area-page-bottom: var(--app-safe-bottom, env(safe-area-inset-bottom, 0px));
  --safe-header-total-height: calc(var(--safe-header-base-height, 56px) + var(--safe-area-page-top));
  min-height: 100dvh;
  padding-bottom: calc(var(--safe-area-page-bottom) + var(--page-bottom-gap));
  box-sizing: border-box;
}

[data-safe-area-page] [data-safe-area-header] {
  top: 0 !important;
  min-height: var(--safe-header-total-height) !important;
  box-sizing: border-box;
}

.launch-shell,
body.android-app .launch-shell {
  min-height: 100dvh !important;
  padding: calc(var(--safe-area-top) + var(--page-top-gap)) var(--page-gutter) calc(var(--safe-area-bottom) + var(--page-bottom-gap)) !important;
  align-content: start !important;
}

.launch-appbar,
body.android-app .launch-appbar {
  position: sticky !important;
  top: var(--safe-area-top) !important;
  min-height: var(--nav-content-height) !important;
  padding: 0 16px !important;
  margin-top: 0 !important;
  margin-bottom: 16px !important;
}

.launch-hero,
body.android-app .launch-hero {
  margin-top: 0 !important;
}

.topbar,
body.android-app .topbar,
#toolApp .topbar,
#longToolApp .topbar,
#posterToolApp .topbar,
#assetToolApp .topbar,
body.android-app #toolApp .topbar,
body.android-app #longToolApp .topbar,
body.android-app #posterToolApp .topbar,
body.android-app #assetToolApp .topbar {
  position: sticky !important;
  top: 0 !important;
  min-height: var(--nav-total-height) !important;
  height: var(--nav-total-height) !important;
  padding: var(--safe-area-top) var(--page-gutter) 0 !important;
  align-items: center !important;
}

.workspace,
body.android-app .workspace,
.long-workspace,
.poster-workspace {
  min-height: calc(100dvh - var(--nav-total-height)) !important;
}

.preview-panel,
body.android-app .preview-panel {
  top: var(--nav-total-height) !important;
  height: calc(100dvh - var(--nav-total-height)) !important;
}

.editor-panel,
.long-editor-panel,
.poster-editor-panel,
.asset-panel,
body.android-app .editor-panel,
body.android-app .long-editor-panel,
body.android-app .poster-editor-panel,
body.android-app .asset-panel {
  padding-bottom: calc(24px + var(--safe-area-bottom)) !important;
}

@media (max-width: 720px) {
  .launch-shell,
  body.android-app .launch-shell {
    padding-left: var(--page-gutter) !important;
    padding-right: var(--page-gutter) !important;
  }

  .topbar,
  body.android-app .topbar,
  #toolApp .topbar,
  #longToolApp .topbar,
  #posterToolApp .topbar,
  #assetToolApp .topbar,
  body.android-app #toolApp .topbar,
  body.android-app #longToolApp .topbar,
  body.android-app #posterToolApp .topbar,
  body.android-app #assetToolApp .topbar {
    min-height: var(--nav-total-height) !important;
    height: var(--nav-total-height) !important;
    padding-top: var(--safe-area-top) !important;
  }

  .preview-panel,
  body.android-app .preview-panel {
    top: auto !important;
    height: auto !important;
  }
}
