:root {
  color-scheme: dark;
  --vx-font-sans: Inter, "SF Pro Text", "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  --vx-font-mono: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  --vx-bg: #0a0b10;
  --vx-surface: #11131a;
  --vx-surface-raised: #171a23;
  --vx-border: rgba(255, 255, 255, 0.1);
  --vx-border-strong: rgba(255, 255, 255, 0.18);
  --vx-text: #f4f4f7;
  --vx-text-secondary: #a8acb8;
  --vx-text-muted: #737886;
  --vx-accent: #8b7cf6;
  --vx-accent-soft: rgba(139, 124, 246, 0.14);
  --vx-success: #35d399;
  --vx-warning: #f7c948;
  --vx-danger: #f77979;
  --vx-info: #64a7ff;
  --vx-radius-xs: 4px;
  --vx-radius-sm: 6px;
  --vx-radius-md: 8px;
  --vx-control-height: 40px;
  --vx-shadow: 0 12px 34px rgba(0, 0, 0, 0.28);
}

:root[data-theme="blue"] {
  --vx-accent: #58a6ff;
  --vx-accent-soft: rgba(88, 166, 255, 0.14);
}

:root[data-theme="cyan"] {
  --vx-accent: #38c8d8;
  --vx-accent-soft: rgba(56, 200, 216, 0.13);
}

:root[data-theme="pink"] {
  --vx-accent: #f08fb1;
  --vx-accent-soft: rgba(240, 143, 177, 0.14);
}

:root[data-theme="light"] {
  color-scheme: light;
  --vx-bg: #f5f6f8;
  --vx-surface: #ffffff;
  --vx-surface-raised: #f0f2f5;
  --vx-border: rgba(19, 24, 35, 0.12);
  --vx-border-strong: rgba(19, 24, 35, 0.2);
  --vx-text: #171a21;
  --vx-text-secondary: #4f5664;
  --vx-text-muted: #777f8f;
  --vx-shadow: 0 12px 30px rgba(28, 34, 46, 0.12);
}

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

html {
  font-family: var(--vx-font-sans);
  text-size-adjust: 100%;
}

body,
button,
input,
select,
textarea {
  font-family: var(--vx-font-sans);
  letter-spacing: 0;
}

button,
input,
select,
textarea {
  max-width: 100%;
}

button,
[role="button"],
a,
input,
select,
textarea {
  -webkit-tap-highlight-color: transparent;
}

button:not(:disabled),
[role="button"]:not([aria-disabled="true"]) {
  cursor: pointer;
}

button:disabled,
[aria-disabled="true"] {
  cursor: not-allowed;
}

:focus-visible {
  outline: 2px solid var(--vx-accent);
  outline-offset: 2px;
}

input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 0;
  border-color: var(--vx-accent) !important;
  box-shadow: 0 0 0 3px var(--vx-accent-soft) !important;
}

.btn,
button,
.form-input,
.form-select,
input,
select,
textarea {
  border-radius: var(--vx-radius-md);
}

.btn:not(.btn-xs),
button:not(.btn-xs),
.form-input,
.form-select {
  min-height: var(--vx-control-height);
}

.badge,
.status-badge,
[class*="badge-"] {
  border-radius: var(--vx-radius-xs);
  font-variant-numeric: tabular-nums;
}

.empty,
.empty-state,
[data-empty-state] {
  color: var(--vx-text-muted);
  text-align: center;
  line-height: 1.6;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-variant-numeric: tabular-nums;
}

th {
  color: var(--vx-text-secondary);
  font-size: 12px;
  font-weight: 600;
  text-align: left;
  white-space: nowrap;
}

td {
  overflow-wrap: anywhere;
}

tbody tr {
  border-bottom: 1px solid var(--vx-border);
}

.toast,
[role="status"],
[role="alert"] {
  overflow-wrap: anywhere;
}

.vx-skeleton,
[data-loading="true"] {
  position: relative;
  overflow: hidden;
}

.vx-skeleton::after,
[data-loading="true"]::after {
  content: "";
  position: absolute;
  inset: 0;
  transform: translateX(-100%);
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.08), transparent);
  animation: vx-loading 1.2s ease-in-out infinite;
  pointer-events: none;
}

@keyframes vx-loading {
  to { transform: translateX(100%); }
}

@media (max-width: 768px) {
  :root {
    --vx-control-height: 44px;
  }

  button,
  [role="button"],
  a.btn,
  input,
  select {
    min-height: 44px;
  }

  .debug-close,
  .share-btn,
  .upload-btn,
  .refresh-button {
    min-width: 44px !important;
  }

  .btn-xs {
    min-height: 36px;
  }

  table {
    min-width: 640px;
  }
}

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