/* Shared design system CSS (openclaw-shared-css + openclaw-brand-css). Extracted 20260702. */

/* ===== openclaw-shared-css ===== */
/* ===== tokens.css ===== */
/* ============================================================
   OpenClaw Shared Design System — tokens.css
   Layer 1: Primitive Tokens (raw scales, theme-independent)
   ============================================================ */

:root {
  /* ---------- Neutral Scale ---------- */
  --ntrl-0: #ffffff;
  --ntrl-10: #f7f7f8;
  --ntrl-20: #e5e5e8;
  --ntrl-30: #d1d1d6;
  --ntrl-40: #a0a0a8;
  --ntrl-50: #71717a;
  --ntrl-60: #52525b;
  --ntrl-70: #3f3f46;
  --ntrl-80: #27272a;
  --ntrl-90: #18181b;
  --ntrl-100: #09090b;

  /* ---------- Blue Scale (A-group) ---------- */
  --blue-300: #93c5fd;
  --blue-400: #60a5fa;
  --blue-500: #3b82f6;
  --blue-600: #2563eb;
  --blue-700: #1d4ed8;

  /* ---------- Indigo Scale (A-group accent) ---------- */
  --indigo-300: #a5b4fc;
  --indigo-400: #818cf8;
  --indigo-500: #6366f1;
  --indigo-600: #4f46e5;
  --indigo-700: #4338ca;

  /* ---------- Rose Scale (B-group: novel) ---------- */
  --rose-300: #fda4af;
  --rose-400: #fb7185;
  --rose-500: #e94560;
  --rose-600: #be123c;
  --rose-700: #9f1239;

  /* ---------- Green Scale (B-group: trade) ---------- */
  --green-300: #86efac;
  --green-400: #4ade80;
  --green-500: #22c55e;
  --green-600: #16a34a;
  --green-700: #15803d;

  /* ---------- Status Colors ---------- */
  --status-success: #10b981;
  --status-warn: #f59e0b;
  --status-error: #ef4444;
  --status-info: #3b82f6;

  /* ---------- Typography ---------- */
  --font-sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI",
    "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  --font-mono: "JetBrains Mono", "Fira Code", "Consolas", monospace;

  /* Fluid font sizes */
  --text-xs: clamp(0.75rem, 0.72rem + 0.1vw, 0.8rem);
  --text-sm: clamp(0.875rem, 0.84rem + 0.15vw, 0.95rem);
  --text-base: clamp(1rem, 0.96rem + 0.2vw, 1.125rem);
  --text-lg: clamp(1.25rem, 1.15rem + 0.5vw, 1.5rem);
  --text-xl: clamp(1.5rem, 1.35rem + 0.8vw, 2rem);
  --text-2xl: clamp(2rem, 1.8rem + 1vw, 2.5rem);
  --text-3xl: clamp(2.5rem, 2.2rem + 1.5vw, 3.5rem);

  /* ---------- Spacing (4px base) ---------- */
  --space-0: 0;
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 24px;
  --space-6: 32px;
  --space-7: 48px;
  --space-8: 64px;

  /* ---------- Radius ---------- */
  --radius-xs: 4px;
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --radius-xl: 18px;
  --radius-2xl: 24px;
  --radius-full: 9999px;

  /* ---------- Transitions ---------- */
  --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-fast: 0.15s ease;
  --transition-slow: 0.5s cubic-bezier(0.4, 0, 0.2, 1);

  /* ---------- Layout ---------- */
  --sidebar-width: 260px;
  --sidebar-collapsed: 64px;
  --topbar-height: 56px;
  --content-max: 1600px;
  --mobile-breakpoint: 768px;
}


/* ===== theme-light.css ===== */
/* ============================================================
   OpenClaw Shared Design System — theme-light.css
   Layer 2: Semantic Tokens (Light Mode)
   ============================================================ */

:root,
:root[data-theme="light"] {
  /* ---------- Backgrounds ---------- */
  --color-bg-base: var(--ntrl-0);
  --color-bg-elevated: var(--ntrl-10);
  --color-bg-sunken: var(--ntrl-20);
  --color-bg-hover: var(--ntrl-20);
  --color-bg-active: var(--ntrl-30);
  --color-bg-glass: rgba(255, 255, 255, 0.7);
  --color-bg-overlay: rgba(0, 0, 0, 0.4);
  --color-bg-input: var(--ntrl-0);

  /* ---------- Text ---------- */
  --color-text-primary: var(--ntrl-100);
  --color-text-secondary: var(--ntrl-60);
  --color-text-muted: var(--ntrl-50);
  --color-text-inverse: var(--ntrl-0);
  --color-text-link: var(--blue-600);

  /* ---------- Borders ---------- */
  --color-border-subtle: var(--ntrl-20);
  --color-border-default: var(--ntrl-30);
  --color-border-strong: var(--ntrl-40);
  --color-border-focus: var(--blue-500);

  /* ---------- Shadows ---------- */
  --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.04);
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.06), 0 1px 2px rgba(0, 0, 0, 0.04);
  --shadow-card: 0 1px 3px rgba(0, 0, 0, 0.08), 0 1px 2px rgba(0, 0, 0, 0.04);
  --shadow-elevated: 0 4px 12px rgba(0, 0, 0, 0.1), 0 2px 4px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.12), 0 4px 10px rgba(0, 0, 0, 0.04);
  --shadow-glow: 0 0 30px rgba(99, 102, 241, 0.15);

  /* ---------- Glass ---------- */
  --glass-bg: rgba(255, 255, 255, 0.65);
  --glass-border: rgba(255, 255, 255, 0.5);
  --glass-blur: blur(16px) saturate(180%);

  /* ---------- Gradients ---------- */
  --gradient-surface: linear-gradient(135deg, var(--ntrl-0) 0%, var(--ntrl-10) 100%);
  --gradient-glow: radial-gradient(ellipse at center, rgba(99, 102, 241, 0.08) 0%, transparent 70%);

  /* ---------- Scrollbar ---------- */
  --scrollbar-track: transparent;
  --scrollbar-thumb: rgba(0, 0, 0, 0.15);
  --scrollbar-thumb-hover: rgba(0, 0, 0, 0.25);

  /* ---------- Misc ---------- */
  --color-scrim: rgba(0, 0, 0, 0.5);
  --opacity-disabled: 0.5;
  color-scheme: light;
}


/* ===== theme-dark.css ===== */
/* ============================================================
   OpenClaw Shared Design System — theme-dark.css
   Layer 2: Semantic Tokens (Dark Mode)
   ============================================================ */

:root[data-theme="dark"] {
  /* ---------- Backgrounds ---------- */
  --color-bg-base: var(--ntrl-90);
  --color-bg-elevated: var(--ntrl-80);
  --color-bg-sunken: var(--ntrl-100);
  --color-bg-hover: var(--ntrl-70);
  --color-bg-active: var(--ntrl-60);
  --color-bg-glass: rgba(20, 20, 25, 0.65);
  --color-bg-overlay: rgba(0, 0, 0, 0.6);
  --color-bg-input: rgba(0, 0, 0, 0.3);

  /* ---------- Text ---------- */
  --color-text-primary: var(--ntrl-0);
  --color-text-secondary: var(--ntrl-40);
  --color-text-muted: var(--ntrl-50);
  --color-text-inverse: var(--ntrl-100);
  --color-text-link: var(--blue-400);

  /* ---------- Borders ---------- */
  --color-border-subtle: rgba(255, 255, 255, 0.06);
  --color-border-default: rgba(255, 255, 255, 0.1);
  --color-border-strong: rgba(255, 255, 255, 0.16);
  --color-border-focus: var(--blue-400);

  /* ---------- Shadows ---------- */
  --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.2);
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.3), 0 1px 2px rgba(0, 0, 0, 0.2);
  --shadow-card: 0 1px 3px rgba(0, 0, 0, 0.4), 0 1px 2px rgba(0, 0, 0, 0.2);
  --shadow-elevated: 0 4px 12px rgba(0, 0, 0, 0.5), 0 2px 4px rgba(0, 0, 0, 0.3);
  --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.6), 0 4px 10px rgba(0, 0, 0, 0.3);
  --shadow-glow: 0 0 30px rgba(99, 102, 241, 0.2);

  /* ---------- Glass ---------- */
  --glass-bg: rgba(20, 20, 30, 0.6);
  --glass-border: rgba(255, 255, 255, 0.08);
  --glass-blur: blur(16px) saturate(180%);

  /* ---------- Gradients ---------- */
  --gradient-surface: linear-gradient(135deg, var(--ntrl-80) 0%, var(--ntrl-90) 100%);
  --gradient-glow: radial-gradient(ellipse at center, rgba(99, 102, 241, 0.12) 0%, transparent 70%);

  /* ---------- Scrollbar ---------- */
  --scrollbar-track: transparent;
  --scrollbar-thumb: rgba(255, 255, 255, 0.1);
  --scrollbar-thumb-hover: rgba(255, 255, 255, 0.2);

  /* ---------- Misc ---------- */
  --color-scrim: rgba(0, 0, 0, 0.7);
  --opacity-disabled: 0.4;
  color-scheme: dark;
}


/* ===== base.css ===== */
/* ============================================================
   OpenClaw Shared Design System — base.css
   Reset, base typography, scrollbar, animations
   ============================================================ */

/* ---------- Reset ---------- */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-sans);
  background-color: var(--color-bg-base);
  color: var(--color-text-primary);
  line-height: 1.6;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
  transition: background-color var(--transition), color var(--transition);
}

/* ---------- Typography ---------- */
h1, h2, h3, h4, h5, h6 {
  font-weight: 600;
  line-height: 1.3;
  color: var(--color-text-primary);
}

h1 { font-size: var(--text-2xl); }
h2 { font-size: var(--text-xl); }
h3 { font-size: var(--text-lg); }
h4 { font-size: var(--text-base); font-weight: 600; }
h5 { font-size: var(--text-sm); font-weight: 600; }
h6 { font-size: var(--text-xs); font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; }

p { margin-bottom: var(--space-3); }

a {
  color: var(--color-text-link);
  text-decoration: none;
  transition: color var(--transition-fast);
}
a:hover { text-decoration: underline; }

code, pre, .mono {
  font-family: var(--font-mono);
}

/* ---------- Form Elements ---------- */
input, textarea, select, button {
  font-family: inherit;
  font-size: inherit;
}

input[type="checkbox"], input[type="radio"] {
  accent-color: var(--color-primary);
}

/* ---------- Scrollbar ---------- */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--scrollbar-track); }
::-webkit-scrollbar-thumb {
  background: var(--scrollbar-thumb);
  border-radius: var(--radius-full);
}
::-webkit-scrollbar-thumb:hover { background: var(--scrollbar-thumb-hover); }
* { scrollbar-width: thin; scrollbar-color: var(--scrollbar-thumb) transparent; }

/* ---------- Selection ---------- */
::selection {
  background: var(--color-primary);
  color: white;
}

/* ---------- Focus ---------- */
:focus-visible {
  outline: 2px solid var(--color-border-focus);
  outline-offset: 2px;
}

/* ---------- Utility ---------- */
.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.text-truncate {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ---------- Anim ---------- */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes fadeInDown {
  from { opacity: 0; transform: translateY(-12px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes slideInLeft {
  from { opacity: 0; transform: translateX(-16px); }
  to { opacity: 1; transform: translateX(0); }
}

@keyframes slideInRight {
  from { opacity: 0; transform: translateX(16px); }
  to { opacity: 1; transform: translateX(0); }
}

@keyframes scaleIn {
  from { opacity: 0; transform: scale(0.95); }
  to { opacity: 1; transform: scale(1); }
}

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

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

@keyframes shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

@keyframes glow {
  0%, 100% { box-shadow: 0 0 5px var(--color-primary); }
  50% { box-shadow: 0 0 20px var(--color-primary); }
}

/* Animation utility classes */
.anim-fade-in { animation: fadeIn 0.3s ease-out; }
.anim-fade-in-up { animation: fadeInUp 0.4s ease-out; }
.anim-fade-in-down { animation: fadeInDown 0.4s ease-out; }
.anim-scale-in { animation: scaleIn 0.2s ease-out; }
.anim-slide-left { animation: slideInLeft 0.3s ease-out; }
.anim-slide-right { animation: slideInRight 0.3s ease-out; }

/* ---------- Loading Skeleton ---------- */
.skeleton {
  background: linear-gradient(
    90deg,
    var(--color-bg-sunken) 25%,
    var(--color-bg-hover) 50%,
    var(--color-bg-sunken) 75%
  );
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: var(--radius-sm);
}

/* ---------- Spinner ---------- */
.spinner {
  width: 20px;
  height: 20px;
  border: 2px solid var(--color-border-default);
  border-top-color: var(--color-primary);
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}
.spinner--lg { width: 32px; height: 32px; border-width: 3px; }
.spinner--sm { width: 14px; height: 14px; border-width: 1.5px; }


/* ===== components.css ===== */
/* ============================================================
   OpenClaw Shared Design System — components.css
   Layer 3: Shared Component Library (BEM + CSS Variables)
   ============================================================ */



  /* ==================== Buttons ==================== */
  .btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
    padding: var(--space-2) var(--space-4);
    font-size: var(--text-sm);
    font-weight: 500;
    font-family: inherit;
    line-height: 1.4;
    border: 1px solid transparent;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--transition-fast);
    white-space: nowrap;
    user-select: none;
    text-decoration: none;
    -webkit-tap-highlight-color: transparent;
  }
  .btn:active { transform: scale(0.97); }
  .btn:disabled, .btn.is-disabled {
    opacity: var(--opacity-disabled);
    cursor: not-allowed;
    pointer-events: none;
  }
  .btn:focus-visible {
    outline: 2px solid var(--color-primary);
    outline-offset: 2px;
  }

  .btn--primary {
    background: var(--color-primary);
    color: white;
    border-color: var(--color-primary);
  }
  .btn--primary:hover {
    background: var(--color-primary-hover);
    border-color: var(--color-primary-hover);
    transform: translateY(-1px);
    box-shadow: var(--shadow-sm);
  }

  .btn--ghost {
    background: transparent;
    color: var(--color-text-primary);
    border-color: var(--color-border-default);
  }
  .btn--ghost:hover {
    background: var(--color-bg-hover);
    border-color: var(--color-border-strong);
  }

  .btn--danger {
    background: var(--status-error);
    color: white;
    border-color: var(--status-error);
  }
  .btn--danger:hover {
    filter: brightness(0.9);
    transform: translateY(-1px);
    box-shadow: var(--shadow-sm);
  }

  .btn--success {
    background: var(--status-success);
    color: white;
    border-color: var(--status-success);
  }
  .btn--success:hover { filter: brightness(0.9); transform: translateY(-1px); }

  .btn--gradient {
    background: var(--gradient-primary);
    color: white;
    border: none;
  }
  .btn--gradient:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(99, 102, 241, 0.3);
    filter: brightness(1.05);
  }

  .btn--sm { padding: var(--space-1) var(--space-3); font-size: var(--text-xs); }
  .btn--lg { padding: var(--space-3) var(--space-6); font-size: var(--text-base); }
  .btn--icon { padding: var(--space-2); width: 40px; height: 40px; }
  .btn--icon.btn--sm { width: 32px; height: 32px; padding: var(--space-1); }
  .btn--icon.btn--lg { width: 44px; height: 44px; }
  .btn--block { width: 100%; }
  .btn--pill { border-radius: var(--radius-full); }

  /* ==================== Cards ==================== */
  .card {
    background: var(--color-bg-elevated);
    border: 1px solid var(--color-border-subtle);
    border-radius: var(--radius-lg);
    padding: var(--space-5);
    transition: all var(--transition);
  }

  .card--hover:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-elevated);
    border-color: var(--color-border-default);
  }

  .card--glass {
    background: var(--glass-bg);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
  }

  .card--elevated {
    box-shadow: var(--shadow-elevated);
    border: none;
  }

  .card--interactive {
    cursor: pointer;
  }
  .card--interactive:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-elevated);
    border-color: var(--color-border-default);
  }

  .card__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--space-4);
  }
  .card__title {
    font-size: var(--text-lg);
    font-weight: 600;
  }
  .card__body { flex: 1; }
  .card__footer {
    margin-top: var(--space-4);
    padding-top: var(--space-4);
    border-top: 1px solid var(--color-border-subtle);
    display: flex;
    justify-content: flex-end;
    gap: var(--space-2);
  }

  /* ==================== Forms ==================== */
  .input, .textarea, .select {
    width: 100%;
    padding: var(--space-2) var(--space-3);
    font-size: var(--text-sm);
    font-family: inherit;
    color: var(--color-text-primary);
    background: var(--color-bg-input);
    border: 1px solid var(--color-border-default);
    border-radius: var(--radius-md);
    transition: all var(--transition-fast);
    outline: none;
  }
  .input:focus, .textarea:focus, .select:focus {
    border-color: var(--color-border-focus);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.12);
  }
  .input::placeholder, .textarea::placeholder {
    color: var(--color-text-muted);
  }
  .input:disabled, .textarea:disabled, .select:disabled {
    opacity: var(--opacity-disabled);
    cursor: not-allowed;
  }

  .textarea { min-height: 80px; resize: vertical; line-height: 1.5; }
  .select { cursor: pointer; appearance: none; padding-right: var(--space-8); }

  .form-group {
    margin-bottom: var(--space-4);
  }
  .form-label {
    display: block;
    margin-bottom: var(--space-2);
    font-size: var(--text-sm);
    font-weight: 500;
    color: var(--color-text-secondary);
  }
  .form-hint {
    margin-top: var(--space-1);
    font-size: var(--text-xs);
    color: var(--color-text-muted);
  }
  .form-error {
    margin-top: var(--space-1);
    font-size: var(--text-xs);
    color: var(--status-error);
  }

  /* Switch toggle */
  .switch {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
  }
  .switch input { opacity: 0; width: 0; height: 0; }
  .switch__slider {
    position: absolute;
    cursor: pointer;
    inset: 0;
    background: var(--color-border-default);
    border-radius: var(--radius-full);
    transition: var(--transition);
  }
  .switch__slider::before {
    content: "";
    position: absolute;
    height: 18px; width: 18px;
    left: 3px; bottom: 3px;
    background: white;
    border-radius: 50%;
    transition: var(--transition);
  }
  .switch input:checked + .switch__slider {
    background: var(--color-primary);
  }
  .switch input:checked + .switch__slider::before {
    transform: translateX(20px);
  }

  /* ==================== Badge & Tag ==================== */
  .badge {
    display: inline-flex;
    align-items: center;
    gap: var(--space-1);
    padding: 2px var(--space-2);
    font-size: var(--text-xs);
    font-weight: 500;
    border-radius: var(--radius-sm);
    background: var(--color-bg-hover);
    color: var(--color-text-secondary);
  }
  .badge--primary { background: var(--color-primary); color: white; }
  .badge--success { background: var(--status-success); color: white; }
  .badge--error { background: var(--status-error); color: white; }
  .badge--warn { background: var(--status-warn); color: white; }
  .badge--info { background: var(--status-info); color: white; }
  .badge--dot { width: 8px; height: 8px; padding: 0; border-radius: 50%; }
  .badge--dot.badge--success { background: var(--status-success); }
  .badge--dot.badge--error { background: var(--status-error); }

  .tag {
    display: inline-flex;
    align-items: center;
    gap: var(--space-1);
    padding: var(--space-1) var(--space-3);
    font-size: var(--text-xs);
    border-radius: var(--radius-full);
    background: var(--color-bg-sunken);
    color: var(--color-text-secondary);
    border: 1px solid var(--color-border-subtle);
  }
  .tag--active {
    background: var(--color-primary);
    color: white;
    border-color: var(--color-primary);
  }
  .tag--closable { padding-right: var(--space-1); }
  .tag__close {
    cursor: pointer;
    margin-left: var(--space-1);
    opacity: 0.6;
    transition: opacity var(--transition-fast);
  }
  .tag__close:hover { opacity: 1; }

  /* ==================== Progress ==================== */
  .progress {
    width: 100%;
    height: 6px;
    background: var(--color-bg-sunken);
    border-radius: var(--radius-full);
    overflow: hidden;
  }
  .progress__bar {
    height: 100%;
    background: var(--color-primary);
    border-radius: var(--radius-full);
    transition: width var(--transition-slow);
  }
  .progress__bar--success { background: var(--status-success); }
  .progress__bar--error { background: var(--status-error); }
  .progress__bar--warn { background: var(--status-warn); }
  .progress--lg { height: 10px; }
  .progress--sm { height: 3px; }

  /* ==================== Modal ==================== */
  .modal {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: none;
    align-items: center;
    justify-content: center;
  }
  .modal.is-open { display: flex; animation: fadeIn 0.2s ease-out; }
  .modal__overlay {
    position: absolute;
    inset: 0;
    background: var(--color-bg-overlay);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
  }
  .modal__content {
    position: relative;
    background: var(--color-bg-elevated);
    border: 1px solid var(--color-border-subtle);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-lg);
    width: 90%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
    animation: scaleIn 0.2s ease-out;
  }
  .modal__content--lg { max-width: 800px; }
  .modal__content--xl { max-width: 1200px; }
  .modal__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-5) var(--space-5) var(--space-3);
  }
  .modal__title { font-size: var(--text-lg); font-weight: 600; }
  .modal__close {
    cursor: pointer;
    width: 32px; height: 32px;
    display: flex; align-items: center; justify-content: center;
    border-radius: var(--radius-sm);
    color: var(--color-text-muted);
    transition: all var(--transition-fast);
    background: transparent;
    border: none;
    font-size: 20px;
  }
  .modal__close:hover {
    background: var(--color-bg-hover);
    color: var(--color-text-primary);
  }
  .modal__body { padding: var(--space-3) var(--space-5) var(--space-5); }
  .modal__footer {
    display: flex;
    justify-content: flex-end;
    gap: var(--space-2);
    padding: var(--space-3) var(--space-5) var(--space-5);
  }

  /* ==================== Table ==================== */
  .table {
    width: 100%;
    border-collapse: collapse;
    font-size: var(--text-sm);
  }
  .table th {
    text-align: left;
    padding: var(--space-3) var(--space-4);
    font-weight: 600;
    color: var(--color-text-secondary);
    border-bottom: 1px solid var(--color-border-default);
    white-space: nowrap;
  }
  .table td {
    padding: var(--space-3) var(--space-4);
    border-bottom: 1px solid var(--color-border-subtle);
    color: var(--color-text-primary);
  }
  .table tbody tr {
    transition: background var(--transition-fast);
  }
  .table tbody tr:hover {
    background: var(--color-bg-hover);
  }
  .table--striped tbody tr:nth-child(odd) {
    background: var(--color-bg-sunken);
  }
  .table--striped tbody tr:hover {
    background: var(--color-bg-hover);
  }

  /* ==================== Navigation ==================== */
  .topbar {
    height: var(--topbar-height);
    background: var(--glass-bg);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border-bottom: 1px solid var(--color-border-subtle);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 var(--space-5);
    position: sticky;
    top: 0;
    z-index: 100;
  }

  .sidebar {
    width: var(--sidebar-width);
    background: var(--color-bg-elevated);
    border-right: 1px solid var(--color-border-subtle);
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    transition: width var(--transition);
  }
  .sidebar--collapsed { width: var(--sidebar-collapsed); }

  .nav-item {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-3) var(--space-4);
    color: var(--color-text-secondary);
    cursor: pointer;
    border-radius: var(--radius-md);
    transition: all var(--transition-fast);
    font-size: var(--text-sm);
    font-weight: 500;
    text-decoration: none;
  }
  .nav-item:hover {
    background: var(--color-bg-hover);
    color: var(--color-text-primary);
    text-decoration: none;
  }
  .nav-item.is-active {
    background: var(--color-primary);
    color: white;
  }
  .nav-item__icon {
    width: 20px; height: 20px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  /* ==================== Dropdown ==================== */
  .dropdown {
    position: relative;
    display: inline-block;
  }
  .dropdown__menu {
    position: absolute;
    top: calc(100% + var(--space-1));
    left: 0;
    min-width: 180px;
    background: var(--color-bg-elevated);
    border: 1px solid var(--color-border-subtle);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-elevated);
    padding: var(--space-1);
    z-index: 200;
    display: none;
    animation: scaleIn 0.15s ease-out;
  }
  .dropdown.is-open .dropdown__menu { display: block; }
  .dropdown__item {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-2) var(--space-3);
    color: var(--color-text-primary);
    cursor: pointer;
    border-radius: var(--radius-sm);
    font-size: var(--text-sm);
    transition: background var(--transition-fast);
  }
  .dropdown__item:hover { background: var(--color-bg-hover); }
  .dropdown__divider {
    height: 1px;
    background: var(--color-border-subtle);
    margin: var(--space-1) 0;
  }

  /* ==================== Tooltip ==================== */
  .tooltip {
    position: relative;
    display: inline-block;
  }
  .tooltip::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: calc(100% + var(--space-2));
    left: 50%;
    transform: translateX(-50%);
    padding: var(--space-1) var(--space-2);
    background: var(--ntrl-100);
    color: var(--ntrl-0);
    font-size: var(--text-xs);
    border-radius: var(--radius-sm);
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--transition-fast);
    z-index: 300;
  }
  .tooltip:hover::after { opacity: 1; }

  /* ==================== Toast ==================== */
  .toast-container {
    position: fixed;
    top: var(--space-5);
    right: var(--space-5);
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
    pointer-events: none;
  }
  .toast {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-3) var(--space-4);
    background: var(--color-bg-elevated);
    border: 1px solid var(--color-border-subtle);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-elevated);
    min-width: 280px;
    max-width: 400px;
    pointer-events: auto;
    animation: slideInRight 0.3s ease-out;
  }
  .toast--success { border-left: 3px solid var(--status-success); }
  .toast--error { border-left: 3px solid var(--status-error); }
  .toast--info { border-left: 3px solid var(--status-info); }
  .toast--warn { border-left: 3px solid var(--status-warn); }
  .toast__title { font-weight: 600; font-size: var(--text-sm); }
  .toast__msg { font-size: var(--text-xs); color: var(--color-text-secondary); }
  .toast__close { cursor: pointer; color: var(--color-text-muted); margin-left: auto; }

  /* ==================== Empty State ==================== */
  .empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: var(--space-8) var(--space-5);
    text-align: center;
  }
  .empty-state__icon {
    width: 64px; height: 64px;
    margin-bottom: var(--space-4);
    opacity: 0.4;
  }
  .empty-state__title {
    font-size: var(--text-lg);
    font-weight: 600;
    margin-bottom: var(--space-2);
    color: var(--color-text-secondary);
  }
  .empty-state__desc {
    font-size: var(--text-sm);
    color: var(--color-text-muted);
    max-width: 400px;
  }

  /* ==================== Bento Grid ==================== */
  .bento-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: var(--space-4);
  }
  .bento-grid--lg { grid-template-columns: repeat(auto-fill, minmax(400px, 1fr)); }
  .bento-grid--sm { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }

  /* ==================== Tabs ==================== */
  .tabs {
    display: flex;
    gap: var(--space-1);
    border-bottom: 1px solid var(--color-border-subtle);
    overflow-x: auto;
  }
  .tab {
    padding: var(--space-3) var(--space-4);
    color: var(--color-text-secondary);
    cursor: pointer;
    font-size: var(--text-sm);
    font-weight: 500;
    border-bottom: 2px solid transparent;
    transition: all var(--transition-fast);
    white-space: nowrap;
    background: transparent;
    border-top: none;
    border-left: none;
    border-right: none;
  }
  .tab:hover { color: var(--color-text-primary); }
  .tab.is-active {
    color: var(--color-primary);
    border-bottom-color: var(--color-primary);
  }

  /* ==================== Avatar ==================== */
  .avatar {
    width: 36px; height: 36px;
    border-radius: var(--radius-full);
    background: var(--gradient-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
    font-size: var(--text-sm);
    overflow: hidden;
    flex-shrink: 0;
  }
  .avatar--sm { width: 28px; height: 28px; font-size: var(--text-xs); }
  .avatar--lg { width: 48px; height: 48px; font-size: var(--text-lg); }

  /* ==================== Divider ==================== */
  .divider {
    height: 1px;
    background: var(--color-border-subtle);
    margin: var(--space-4) 0;
    border: none;
  }
  .divider--vertical {
    width: 1px;
    height: 100%;
    margin: 0 var(--space-4);
  }

  /* ==================== Theme Switcher ==================== */
  .theme-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px; height: 40px;
    border-radius: var(--radius-md);
    border: 1px solid var(--color-border-subtle);
    background: var(--color-bg-elevated);
    color: var(--color-text-secondary);
    cursor: pointer;
    transition: all var(--transition-fast);
  }
  .theme-toggle:hover {
    background: var(--color-bg-hover);
    color: var(--color-text-primary);
    border-color: var(--color-border-default);
  }
  .theme-toggle svg { width: 18px; height: 18px; }

/* ===== openclaw-brand-css ===== */
/* ============================================================
   OpenClaw Trade — brand.css (B-Group: Green accent)
   For trade.openclaw1998.icu
   ============================================================ */


:root {
  --color-primary: var(--green-500);
  --color-primary-hover: var(--green-600);
  --color-primary-light: var(--green-400);
  --color-accent: var(--blue-500);
  --color-accent-light: var(--blue-400);
  --gradient-primary: linear-gradient(135deg, var(--green-500) 0%, var(--blue-500) 100%);
  --gradient-hover: linear-gradient(135deg, var(--green-400) 0%, var(--blue-400) 100%);
  --brand-name: "交易看板";
  --brand-icon: "📊";
}

/* ---------- Backward-compatible mappings ---------- */
:root {
  --bg-dark: var(--color-bg-base);
  --bg-primary: var(--color-bg-base);
  --bg-secondary: var(--color-bg-elevated);
  --bg-card: var(--color-bg-elevated);
  --bg-glass: var(--glass-bg);
  --bg-hover: var(--color-bg-hover);
  --text-primary: var(--color-text-primary);
  --text-secondary: var(--color-text-secondary);
  --text-muted: var(--color-text-muted);
  --primary: var(--color-primary);
  --primary-dark: var(--color-primary-hover);
  --primary-light: var(--color-primary-light);
  --accent: var(--color-accent);
  --border: var(--color-border-subtle);
  --border-light: var(--color-border-default);
  --error: var(--status-error);
  --warning: var(--status-warn);
  --success: var(--status-success);
  /* 仅保留异名映射（旧名 → 新名）；同名自引用会使变量失效，故删除 */
  --shadow: var(--shadow-card);

  /* Trade-specific colors */
  --color-up: var(--status-error);   /* A股: 红涨 */
  --color-down: var(--status-success); /* A股: 绿跌 */
  --color-flat: var(--color-text-muted);
}

/* ---------- Theme transition ---------- */
*, *::before, *::after {
  transition: background-color 0.3s ease, border-color 0.3s ease, color 0.15s ease;
}

/* ---------- Animated background ---------- */
.bg-mesh {
  position: fixed;
  inset: 0;
  overflow: hidden;
  z-index: 0;
  pointer-events: none;
}

.bg-mesh .orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(90px);
  animation: float 22s infinite ease-in-out;
}

:root[data-theme="dark"] .bg-mesh .orb { opacity: 0.4; }
:root[data-theme="light"] .bg-mesh .orb { opacity: 0.2; }

.bg-mesh .orb:nth-child(1) {
  width: 500px; height: 500px;
  background: radial-gradient(circle, var(--green-500), transparent 70%);
  top: -10%; left: -8%;
}
.bg-mesh .orb:nth-child(2) {
  width: 400px; height: 400px;
  background: radial-gradient(circle, var(--blue-500), transparent 70%);
  bottom: -10%; right: -5%;
  animation-delay: -7s;
}

@keyframes float {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33% { transform: translate(60px, -40px) scale(1.1); }
  66% { transform: translate(-40px, 50px) scale(0.92); }
}

/* ---------- Trade-specific: Data cards ---------- */
.data-card {
  background: var(--color-bg-elevated);
  border: 1px solid var(--color-border-subtle);
  border-radius: var(--radius-lg);
  padding: var(--space-4);
  transition: all var(--transition);
}

.data-card:hover {
  border-color: var(--color-border-default);
  box-shadow: var(--shadow-card);
}

.data-card__label {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  margin-bottom: var(--space-1);
}

.data-card__value {
  font-size: var(--text-2xl);
  font-weight: 700;
  color: var(--color-text-primary);
  font-family: var(--font-mono);
}

.data-card__change {
  font-size: var(--text-xs);
  font-weight: 600;
  margin-top: var(--space-1);
}

.data-card__change--up { color: var(--color-up); }
.data-card__change--down { color: var(--color-down); }
.data-card__change--flat { color: var(--color-flat); }

/* ---------- Trade-specific: Calendar ---------- */
.trade-calendar {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 2px;
}

.calendar-day {
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--text-xs);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--transition-fast);
  border: 1px solid transparent;
}

.calendar-day:hover {
  background: var(--color-bg-hover);
}

.calendar-day--today {
  border-color: var(--color-primary);
  font-weight: 700;
}

.calendar-day--has-data {
  background: var(--color-bg-sunken);
  color: var(--color-primary);
}

.calendar-day--has-data:hover {
  background: var(--color-primary);
  color: white;
}

/* ---------- Trade-specific: Stock table ---------- */
.stock-table th {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.stock-table .stock-code {
  font-family: var(--font-mono);
  font-weight: 600;
}

.stock-table .stock-change--up { color: var(--color-up); }
.stock-table .stock-change--down { color: var(--color-down); }

/* ---------- Trade-specific: Sentiment gauge ---------- */
.sentiment-gauge {
  width: 200px;
  height: 100px;
  position: relative;
  overflow: hidden;
}

.sentiment-gauge__value {
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  font-size: var(--text-xl);
  font-weight: 700;
}

/* ---------- Trade-specific: Heat map ---------- */
.heatmap-cell {
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  font-size: var(--text-xs);
  font-weight: 600;
  cursor: pointer;
  transition: transform var(--transition-fast);
}

.heatmap-cell:hover {
  transform: scale(1.1);
  z-index: 10;
}

/* ---------- Trade-specific: Login overlay ---------- */
.login-overlay {
  position: fixed;
  inset: 0;
  background: var(--color-bg-overlay);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: fadeIn 0.3s ease-out;
}
