@import url("./design-system/colors.css");
@import url("./design-system/typography.css");
@import url("./design-system/spacing.css");
@import url("./design-system/radius.css");
@import url("./design-system/shadows.css");
@import url("./design-system/motion.css");
@import url("./design-system/icons.css");
@import url("./design-system/components/Button.css");
@import url("./design-system/components/Card.css");
@import url("./design-system/components/Banner.css");
@import url("./design-system/components/Dialog.css");
@import url("./design-system/components/BottomSheet.css");
@import url("./design-system/components/Navigation.css");

/* LightFieldCard — bundled here so Registry cards add no cold-start request. */
/*
 * LightFieldCard is the only card primitive for registry-driven entry cards.
 * Consumers may set --lf-card-accent only; geometry, surface, light field,
 * shadow and interaction remain owned here.
 */
:root {
  --lf-card-surface: #FFFFFF;
  --lf-card-border: #ECEDEF;
  --lf-card-radius: 16px;
  --lf-card-padding: 16px;
  --lf-card-icon-size: 44px;
  --lf-card-min-action: 44px;
  --lf-card-motion: 180ms cubic-bezier(.2, .8, .2, 1);
  --lf-card-shadow: 0 10px 28px rgba(20, 24, 20, .065);
  --lf-card-shadow-hover: 0 15px 34px rgba(20, 24, 20, .10);
  --lf-card-shadow-pressed: 0 5px 15px rgba(20, 24, 20, .075);
}

.lf-card {
  --lf-card-accent: #2CFF73;
  position: relative;
  min-width: 0;
  min-height: 156px;
  padding: var(--lf-card-padding);
  border: 1px solid var(--lf-card-border);
  border-radius: var(--lf-card-radius);
  color: var(--oppo-text, #171916);
  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);
  transition: transform var(--lf-card-motion), box-shadow var(--lf-card-motion), border-color var(--lf-card-motion);
}

.lf-card__icon {
  width: var(--lf-card-icon-size);
  height: var(--lf-card-icon-size);
  color: var(--lf-card-accent);
}

.lf-card__title,
.lf-card__description {
  min-width: 0;
  overflow-wrap: anywhere;
}

.lf-card__action {
  min-width: var(--lf-card-min-action);
  min-height: var(--lf-card-min-action);
  color: var(--lf-card-accent);
}

.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);
}

@media (hover: hover) and (pointer: fine) {
  .lf-card:not(:disabled):not([aria-disabled="true"]):hover {
    transform: translateY(-2px);
    box-shadow: var(--lf-card-shadow-hover);
  }
}

.lf-card:not(:disabled):not([aria-disabled="true"]):active,
.lf-card.is-pressed,
.lf-card.tap-animating {
  transform: translateY(1px) scale(.985);
  border-color: color-mix(in srgb, var(--lf-card-accent) 26%, var(--lf-card-border));
  box-shadow:
    var(--lf-card-shadow-pressed),
    inset 0 0 0 1px color-mix(in srgb, var(--lf-card-accent) 12%, transparent);
}

.lf-card:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--lf-card-accent) 34%, transparent);
  outline-offset: 3px;
}

.lf-card:disabled,
.lf-card[aria-disabled="true"] {
  cursor: not-allowed;
  opacity: .58;
  filter: saturate(.72);
  transform: none;
}

@media (prefers-reduced-motion: reduce) {
  .lf-card,
  .lf-card:hover,
  .lf-card:active,
  .lf-card.is-pressed,
  .lf-card.tap-animating {
    transition-duration: 1ms !important;
    transform: none !important;
  }
}
/* End LightFieldCard bundle. */
/* Tool UX Standard V1 — bundled here so archetype primitives add no cold-start request. */
/*
 * Tool UX Standard V1 — canonical cross-platform layout primitives.
 * Runtime owns viewport and insets. Tools own their business canvas/content.
 */
:root {
  --tool-ux-version: 1;
  --tool-ux-accent: var(--oppo-primary, #2CFF73);
  --tool-ux-surface: var(--oppo-surface, #FFFFFF);
  --tool-ux-soft: var(--oppo-bg, #F8FAF9);
  --tool-ux-border: var(--oppo-border, #ECEDEF);
  --tool-ux-text: var(--oppo-text, #171916);
  --tool-ux-muted: var(--oppo-muted, rgba(23, 25, 22, .68));
  --tool-ux-control-radius: 12px;
  --tool-ux-card-radius: 16px;
  --tool-ux-panel-radius: 24px;
  --tool-ux-touch-min: 44px;
  --tool-ux-motion: 180ms cubic-bezier(.2, .8, .2, 1);
  --tool-ux-preview-ratio: 35%;
  --tool-ux-editor-ratio: 65%;
}

[data-tool-archetype] {
  min-width: 0;
  color: var(--tool-ux-text);
  font-family: "OPPO Sans", "PingFang SC", system-ui, sans-serif;
}

[data-tool-archetype] :where(button, a, input, select, textarea, [role="button"]) {
  min-height: var(--tool-ux-touch-min);
}

[data-tool-archetype] :where(button, a, input, select, textarea):focus-visible {
  outline: 3px solid color-mix(in srgb, var(--tool-ux-accent) 34%, transparent);
  outline-offset: 2px;
}

.tool-ux-surface {
  min-width: 0;
  min-height: 0;
  border: 1px solid var(--tool-ux-border);
  border-radius: var(--tool-ux-card-radius);
  background: var(--tool-ux-surface);
  box-shadow: 0 10px 28px rgba(20, 24, 20, .065);
}

.tool-ux-workspace {
  width: 100%;
  min-width: 0;
  min-height: 0;
  display: grid;
  overflow: hidden;
}

[data-tool-archetype="canvas-editor"] .tool-ux-workspace {
  grid-template-columns: minmax(0, 1fr) minmax(300px, 380px);
}

.tool-ux-preview,
.tool-ux-editor {
  min-width: 0;
  min-height: 0;
}

.tool-ux-preview {
  display: grid;
  place-items: center;
  overflow: hidden;
  background: var(--tool-ux-soft);
}

.tool-ux-preview :where(canvas, img, video, iframe) {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.tool-ux-editor {
  height: 100%;
  overflow: hidden auto;
  overscroll-behavior: contain;
  touch-action: pan-y;
  -webkit-overflow-scrolling: touch;
}

.tool-ux-list,
.tool-ux-form,
.tool-ux-chat {
  width: min(1120px, 100%);
  min-width: 0;
  margin-inline: auto;
}

.tool-ux-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(260px, 100%), 1fr));
  gap: 16px;
}

.tool-ux-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 360px);
  gap: 24px;
}

.tool-ux-chat {
  min-height: 0;
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  overflow: hidden;
}

.tool-ux-chat__messages {
  min-height: 0;
  overflow: hidden auto;
  overscroll-behavior: contain;
}

.tool-ux-chat__composer {
  padding-bottom: max(12px, var(--app-safe-bottom, 0px), env(safe-area-inset-bottom, 0px));
  background: var(--tool-ux-surface);
}

@media (max-width: 768px) {
  [data-tool-archetype="canvas-editor"].runtime-v2-managed > .tool-ux-workspace,
  [data-tool-archetype="canvas-editor"].runtime-v2-managed .tool-ux-workspace[data-tool-workspace] {
    height: var(--tool-v2-content-block-size);
    min-height: 0;
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: minmax(0, var(--tool-ux-preview-ratio)) minmax(0, var(--tool-ux-editor-ratio));
  }

  [data-tool-archetype="canvas-editor"] .tool-ux-preview {
    height: 100%;
    overflow: hidden;
  }

  [data-tool-archetype="canvas-editor"] .tool-ux-editor {
    height: 100%;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
    overscroll-behavior: contain;
    touch-action: pan-y;
    -webkit-overflow-scrolling: touch;
    padding-bottom: max(24px, var(--app-safe-bottom, 0px), env(safe-area-inset-bottom, 0px));
  }

  .tool-ux-form {
    grid-template-columns: minmax(0, 1fr);
    gap: 16px;
  }

  .tool-ux-list {
    grid-template-columns: minmax(0, 1fr);
    gap: 12px;
  }
}

@media (prefers-reduced-motion: reduce) {
  [data-tool-archetype],
  [data-tool-archetype] * {
    scroll-behavior: auto !important;
    transition-duration: 1ms !important;
    animation-duration: 1ms !important;
  }
}
/* End Tool UX Standard V1 bundle. */

:root {
  --oppo-primary: #2CFF73;
  --oppo-primary-rgb: 44, 255, 115;
  --oppo-deep: #046a38;
  --oppo-bg: #F8FAF9;
  --oppo-bg-soft: #F1F4F2;
  --oppo-surface: #FFFFFF;
  --oppo-surface-glass: rgba(255, 255, 255, .86);
  --oppo-text: #171916;
  --oppo-muted: rgba(23, 25, 22, .68);
  --oppo-subtle: rgba(23, 25, 22, .48);
  --oppo-border: #ECEDEF;
  --oppo-border-strong: rgba(44, 255, 115, .42);
  --oppo-danger: #D83C32;
  --oppo-warning: #A97910;
  --oppo-info: #3B82F6;
  --oppo-r-card: 24px;
  --oppo-r-panel: 32px;
  --oppo-r-pill: 999px;
  --oppo-space-1: 4px;
  --oppo-space-2: 8px;
  --oppo-space-3: 12px;
  --oppo-space-4: 16px;
  --oppo-space-5: 24px;
  --oppo-space-6: 32px;
  --oppo-space-7: 48px;
  --oppo-shadow-card: 0 16px 48px rgba(20, 24, 20, .055);
  --oppo-shadow-hover: 0 20px 54px rgba(20, 24, 20, .10);
  --oppo-glow: 0 0 0 1px rgba(var(--oppo-primary-rgb), .14), 0 20px 54px rgba(var(--oppo-primary-rgb), .18);
  --oppo-ease: 180ms cubic-bezier(.2, .8, .2, 1);
  --android-status-bar: 0px;
  --android-nav-bar: 0px;

  --ds-primary: var(--oppo-primary);
  --ds-primary-rgb: var(--oppo-primary-rgb);
  --ds-bg: var(--oppo-bg);
  --ds-surface: var(--oppo-surface);
  --ds-text: var(--oppo-text);
  --ds-muted: var(--oppo-muted);
  --ds-border: var(--oppo-border);
  --ds-radius-card: 24px;
  --ds-transition: var(--oppo-ease);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html {
  font-family: "OPPO Sans", "PingFang SC", "Microsoft YaHei", sans-serif;
  color: var(--oppo-text);
  background: var(--oppo-bg);
  font-synthesis: none;
}

body {
  margin: 0;
  min-width: 320px;
  color: var(--oppo-text);
  background:
    radial-gradient(circle at 24% 0%, rgba(var(--oppo-primary-rgb), .10), transparent 360px),
    radial-gradient(circle at 88% 12%, rgba(205, 234, 255, .26), transparent 340px),
    var(--oppo-bg);
}

button, input, textarea, select, a {
  font: inherit;
}

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

button {
  color: inherit;
  -webkit-user-select: none;
  user-select: none;
}

button:active {
  transform: scale(.975);
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible {
  outline: 2px solid rgba(var(--oppo-primary-rgb), .72);
  outline-offset: 3px;
}

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

h1 {
  font-size: 30px;
  line-height: 1.25;
  font-weight: 700;
  letter-spacing: 0;
}

h2 {
  font-size: 24px;
  line-height: 1.32;
  font-weight: 700;
  letter-spacing: 0;
}

h3 {
  font-size: 18px;
  line-height: 1.35;
  font-weight: 600;
  letter-spacing: 0;
}

.oppo-page {
  width: min(1280px, calc(100% - 112px));
  margin: 0 auto;
}

.oppo-topbar {
  min-height: 82px;
  display: flex;
  align-items: center;
  gap: var(--oppo-space-5);
  background: rgba(255,255,255,.84);
  border-bottom: 1px solid rgba(236,237,239,.9);
  backdrop-filter: blur(22px);
}

.oppo-card {
  border-radius: var(--oppo-r-card);
  background: var(--oppo-surface-glass);
  border: 1px solid rgba(236,237,239,.95);
  box-shadow: var(--oppo-shadow-card);
}

.oppo-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--oppo-shadow-hover);
}

.oppo-card-featured {
  border-color: var(--oppo-border-strong);
  background:
    radial-gradient(circle at 20% 10%, rgba(var(--oppo-primary-rgb), .18), transparent 170px),
    rgba(255,255,255,.9);
  box-shadow: var(--oppo-glow);
}

.oppo-button {
  min-height: 44px;
  padding: 0 18px;
  border: 0;
  border-radius: var(--oppo-r-pill);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--oppo-space-2);
  cursor: pointer;
  font-weight: 700;
  text-decoration: none;
}

.oppo-button-primary {
  background: var(--oppo-primary);
  color: #101510;
}

.oppo-button-secondary {
  background: #F4F6F5;
  color: rgba(23,25,22,.82);
}

.oppo-input {
  height: 46px;
  border: 1px solid var(--oppo-border);
  border-radius: var(--oppo-r-card);
  background: #FBFCFB;
  padding: 0 14px;
  outline: 0;
}

.oppo-input:focus {
  border-color: var(--oppo-primary);
  box-shadow: 0 0 0 3px rgba(var(--oppo-primary-rgb), .16);
}

.oppo-status {
  display: inline-flex;
  align-items: center;
  gap: var(--oppo-space-2);
  min-height: 32px;
  padding: 0 12px;
  border-radius: var(--oppo-r-pill);
  font-size: 13px;
  font-weight: 700;
}

.oppo-status-success {
  color: #047336;
  background: rgba(var(--oppo-primary-rgb), .14);
}

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

.oppo-tool-card {
  min-height: 238px;
  padding: 30px;
  border-radius: var(--oppo-r-card);
  background: var(--oppo-surface-glass);
  border: 1px solid rgba(236,237,239,.95);
  box-shadow: var(--oppo-shadow-card);
}

.oppo-icon-tile {
  width: 58px;
  height: 58px;
  border-radius: 18px;
  display: grid;
  place-items: center;
  background: rgba(var(--oppo-primary-rgb), .13);
  color: #009b46;
}

.oppo-icon-tile svg {
  width: 29px;
  height: 29px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

@media (max-width: 900px) {
  .oppo-page {
    width: min(100% - 36px, 960px);
  }
  .oppo-tool-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
  }
}

@media (max-width: 520px) {
  .oppo-page {
    width: min(100% - 32px, 960px);
  }
  .oppo-tool-card {
    min-height: 154px;
    padding: 18px 16px;
    border-radius: 24px;
  }
}
