/*
 * 将莱数字员工 · 界面基础规范
 * Figma source: 将莱数字员工 · 设计系统 2026.07
 *
 * 这里只统一跨页面的视觉语言，不覆盖报价、生图、矢量和生产业务逻辑。
 */
:root {
  color-scheme: light;

  /* Color */
  --jl-color-bg-page: #f5f5f7;
  --jl-color-bg-surface: #ffffff;
  --jl-color-bg-subtle: #fbfcfe;
  --jl-color-bg-brand: #0071e3;
  --jl-color-bg-brand-hover: #0066cc;
  --jl-color-bg-brand-soft: #e8f2ff;
  --jl-color-text-primary: #182230;
  --jl-color-text-secondary: #667085;
  --jl-color-text-on-brand: #ffffff;
  --jl-color-border-default: #dce3eb;
  --jl-color-border-strong: #c2ccd8;
  --jl-color-focus: #0071e3;
  --jl-color-success: #168a45;
  --jl-color-success-soft: #eef9f3;
  --jl-color-warning: #b85d00;
  --jl-color-warning-soft: #fff8e9;
  --jl-color-danger: #c72c2c;
  --jl-color-danger-soft: #fff1f1;

  /* Typography */
  --jl-font-sans: "Noto Sans SC", "Microsoft YaHei UI", "Microsoft YaHei",
    "PingFang SC", "Segoe UI", system-ui, -apple-system, sans-serif;
  --jl-font-caption: 11px;
  --jl-font-label: 13px;
  --jl-font-body: 14px;
  --jl-font-title: 18px;
  --jl-font-page-title: 22px;
  --jl-font-display: 30px;

  /* Spacing */
  --jl-space-1: 4px;
  --jl-space-2: 8px;
  --jl-space-3: 12px;
  --jl-space-4: 16px;
  --jl-space-5: 20px;
  --jl-space-6: 24px;
  --jl-space-8: 32px;

  /* Shape */
  --jl-radius-sm: 6px;
  --jl-radius-md: 10px;
  --jl-radius-lg: 14px;
  --jl-radius-xl: 18px;
  --jl-radius-panel: 22px;
  --jl-radius-full: 999px;
  --jl-control-height-compact: 34px;
  --jl-control-height-default: 44px;

  /* Elevation and motion */
  --jl-shadow-subtle: 0 3px 10px rgba(24, 34, 48, .03);
  --jl-shadow-card: 0 8px 24px rgba(24, 34, 48, .06);
  --jl-shadow-overlay: 0 18px 50px rgba(22, 38, 61, .14);
  --jl-focus-ring: 0 0 0 4px rgba(0, 113, 227, .14);
  --jl-motion-fast: 140ms;
  --jl-motion-standard: 180ms;

  /* Keep legacy modules on the same source of truth. */
  --page: var(--jl-color-bg-page);
  --panel: rgba(255, 255, 255, .98);
  --panel-strong: var(--jl-color-bg-surface);
  --text: var(--jl-color-text-primary);
  --ink: var(--jl-color-text-primary);
  --muted: var(--jl-color-text-secondary);
  --line: var(--jl-color-border-default);
  --blue: var(--jl-color-bg-brand);
  --blue-dark: var(--jl-color-bg-brand-hover);
  --blue-soft: var(--jl-color-bg-brand-soft);
  --green: var(--jl-color-success);
  --orange: var(--jl-color-warning);
  --red: var(--jl-color-danger);
  --shadow: var(--jl-shadow-card);
  --radius: var(--jl-radius-lg);
}

html {
  font-family: var(--jl-font-sans);
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body,
button,
input,
select,
textarea {
  font-family: var(--jl-font-sans);
}

body {
  color: var(--jl-color-text-primary);
  background: var(--jl-color-bg-page);
}

::selection {
  color: var(--jl-color-text-primary);
  background: var(--jl-color-bg-brand-soft);
}

:where(button, [role="button"], input, select, textarea, a):focus-visible {
  outline: 2px solid var(--jl-color-focus);
  outline-offset: 2px;
}

:where(input, select, textarea) {
  border-color: var(--jl-color-border-default);
  border-radius: var(--jl-radius-md);
  background: var(--jl-color-bg-surface);
  transition:
    border-color var(--jl-motion-fast) ease,
    box-shadow var(--jl-motion-fast) ease;
}

:where(input, select, textarea):focus {
  border-color: var(--jl-color-focus);
  box-shadow: var(--jl-focus-ring);
}

:where(.btn, .upload-action) {
  border-radius: var(--jl-radius-md);
  transition:
    background-color var(--jl-motion-fast) ease,
    border-color var(--jl-motion-fast) ease,
    box-shadow var(--jl-motion-fast) ease,
    transform var(--jl-motion-fast) ease;
}

:where(.btn, .upload-action):not(:disabled):active {
  transform: translateY(1px);
}

.btn.dark {
  background: var(--jl-color-text-primary);
  color: var(--jl-color-text-on-brand);
}

.btn.light {
  border-color: var(--jl-color-border-default);
  background: var(--jl-color-bg-surface);
}

.plan-option-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: auto;
}

.plan-card .plan-option-actions .btn { margin-top: 0; }

.plan-card .plan-option-actions .btn.warm {
  color: #9b3d0c;
  border-color: #f0a24b;
  background: #fff5ea;
}

.plan-card .plan-option-actions .btn.warm:hover {
  border-color: #d76a16;
  background: #ffead7;
}

:where(.card, .order-purchase-card, .die-layout-panel, .jl-vector-studio) {
  border-color: var(--jl-color-border-default);
  box-shadow: var(--jl-shadow-card);
}

.card {
  border-radius: var(--jl-radius-lg);
}

.sidebar {
  color: var(--jl-color-text-primary);
  border-color: var(--jl-color-border-default);
  background: rgba(255, 255, 255, .94);
}

.nav button {
  border-radius: var(--jl-radius-full);
  color: var(--jl-color-text-secondary);
}

.nav button.active,
.nav button:hover {
  color: var(--jl-color-text-primary);
  background: var(--jl-color-bg-surface);
  box-shadow: var(--jl-shadow-subtle);
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
}
