:root {
  --tc-bg: #f2f2f7;
  --tc-bg-secondary: rgba(255, 255, 255, 0.82);
  --tc-bg-tertiary: rgba(255, 255, 255, 0.64);

  --tc-text-primary: rgba(20, 20, 24, 0.96);
  --tc-text-secondary: rgba(60, 60, 67, 0.68);
  --tc-text-tertiary: rgba(60, 60, 67, 0.42);

  --tc-glass-bg: rgba(255, 255, 255, 0.62);
  --tc-glass-bg-strong: rgba(255, 255, 255, 0.78);
  --tc-glass-bg-soft: rgba(255, 255, 255, 0.42);
  --tc-glass-border: rgba(255, 255, 255, 0.7);
  --tc-glass-border-soft: rgba(255, 255, 255, 0.4);
  --tc-glass-highlight: inset 0 1px 0 rgba(255, 255, 255, 0.56);

  --tc-accent: #007aff;
  --tc-accent-strong: #0051d5;
  --tc-accent-soft: rgba(0, 122, 255, 0.12);
  --tc-success: #34c759;
  --tc-success-soft: rgba(52, 199, 89, 0.12);
  --tc-warning: #ff9f0a;
  --tc-warning-soft: rgba(255, 159, 10, 0.12);
  --tc-danger: #ff3b30;
  --tc-danger-soft: rgba(255, 59, 48, 0.12);

  --tc-radius-xs: 8px;
  --tc-radius-sm: 12px;
  --tc-radius-md: 18px;
  --tc-radius-lg: 24px;
  --tc-radius-xl: 30px;
  --tc-radius-full: 999px;

  --tc-blur-soft: 10px;
  --tc-blur-medium: 16px;
  --tc-blur-strong: 22px;

  --tc-shadow-soft: 0 10px 30px rgba(30, 35, 50, 0.08);
  --tc-shadow-glass: 0 20px 60px rgba(30, 35, 50, 0.12);
  --tc-shadow-float: 0 8px 32px rgba(30, 35, 50, 0.10);
  --tc-shadow-inset: inset 0 1px 2px rgba(30, 35, 50, 0.06);

  --tc-space-xs: 4px;
  --tc-space-sm: 8px;
  --tc-space-md: 12px;
  --tc-space-lg: 16px;
  --tc-space-xl: 24px;
  --tc-space-2xl: 32px;

  --tc-spring: cubic-bezier(.22, 1, .36, 1);
  --tc-spring-bounce: cubic-bezier(.34, 1.56, .64, 1);
  --tc-standard: cubic-bezier(.4, 0, .2, 1);
  --tc-decelerate: cubic-bezier(0, 0, .2, 1);

  --tc-duration-fast: 140ms;
  --tc-duration-normal: 220ms;
  --tc-duration-slow: 350ms;

  --tc-input-bg: rgba(255, 255, 255, 0.5);
  --tc-input-border: rgba(255, 255, 255, 0.56);
  --tc-input-focus: rgba(0, 122, 255, 0.24);
  --tc-input-height: 48px;

  --tc-safe-top: env(safe-area-inset-top);
  --tc-safe-bottom: env(safe-area-inset-bottom);
  --tc-safe-left: env(safe-area-inset-left);
  --tc-safe-right: env(safe-area-inset-right);
  --tc-keyboard-inset: 0px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --tc-bg: #000000;
    --tc-bg-secondary: #1c1c1e;
    --tc-bg-tertiary: #2c2c2e;

    --tc-text-primary: rgba(255, 255, 255, 0.96);
    --tc-text-secondary: rgba(235, 235, 245, 0.66);
    --tc-text-tertiary: rgba(235, 235, 245, 0.34);

    --tc-glass-bg: rgba(28, 28, 30, 0.64);
    --tc-glass-bg-strong: rgba(44, 44, 46, 0.8);
    --tc-glass-bg-soft: rgba(28, 28, 30, 0.42);
    --tc-glass-border: rgba(255, 255, 255, 0.12);
    --tc-glass-border-soft: rgba(255, 255, 255, 0.06);
    --tc-glass-highlight: inset 0 1px 0 rgba(255, 255, 255, 0.08);

    --tc-shadow-soft: 0 12px 36px rgba(0, 0, 0, 0.28);
    --tc-shadow-glass: 0 24px 70px rgba(0, 0, 0, 0.46);
    --tc-shadow-float: 0 8px 32px rgba(0, 0, 0, 0.32);
    --tc-shadow-inset: inset 0 1px 2px rgba(0, 0, 0, 0.12);

    --tc-input-bg: rgba(28, 28, 30, 0.5);
    --tc-input-border: rgba(255, 255, 255, 0.1);
    --tc-input-focus: rgba(10, 132, 255, 0.3);

    --tc-accent: #0a84ff;
    --tc-accent-strong: #409cff;
    --tc-success: #30d158;
    --tc-warning: #ffb340;
    --tc-danger: #ff453a;
  }
}

@media (prefers-contrast: more) {
  :root {
    --tc-glass-bg: rgba(255, 255, 255, 0.88);
    --tc-glass-bg-strong: rgba(255, 255, 255, 0.96);
    --tc-glass-border: rgba(200, 200, 200, 0.92);
    --tc-text-primary: rgba(0, 0, 0, 0.96);
    --tc-text-secondary: rgba(0, 0, 0, 0.76);
    --tc-input-border: rgba(150, 150, 150, 0.8);
  }

  @media (prefers-color-scheme: dark) {
    :root {
      --tc-glass-bg: rgba(28, 28, 30, 0.9);
      --tc-glass-bg-strong: rgba(44, 44, 46, 0.96);
      --tc-glass-border: rgba(255, 255, 255, 0.32);
      --tc-text-primary: rgba(255, 255, 255, 0.98);
      --tc-text-secondary: rgba(235, 235, 245, 0.82);
    }
  }
}

html.fx-high {
  --tc-blur-soft: 12px;
  --tc-blur-medium: 18px;
  --tc-blur-strong: 24px;
}

html.fx-balanced {
  --tc-blur-soft: 8px;
  --tc-blur-medium: 12px;
  --tc-blur-strong: 16px;
}

html.fx-lite {
  --tc-blur-soft: 0px;
  --tc-blur-medium: 0px;
  --tc-blur-strong: 0px;
  --tc-glass-bg: rgba(245, 245, 247, 0.94);
  --tc-glass-bg-strong: rgba(255, 255, 255, 0.94);
  --tc-shadow-soft: 0 4px 12px rgba(30, 35, 50, 0.06);
  --tc-shadow-glass: 0 8px 24px rgba(30, 35, 50, 0.08);
  --tc-shadow-float: 0 6px 18px rgba(30, 35, 50, 0.08);
}

@media (prefers-color-scheme: dark) {
  html.fx-lite {
    --tc-glass-bg: rgba(28, 28, 30, 0.94);
    --tc-glass-bg-strong: rgba(44, 44, 46, 0.96);
  }
}

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

body {
  margin: 0;
  min-height: 100dvh;
  min-height: 100svh;
  color: var(--tc-text-primary);
  background:
    radial-gradient(48% 42% at 18% 14%, rgba(0, 122, 255, 0.12), rgba(0, 122, 255, 0) 68%),
    radial-gradient(42% 36% at 84% 12%, rgba(177, 160, 255, 0.12), rgba(177, 160, 255, 0) 70%),
    radial-gradient(42% 36% at 52% 84%, rgba(52, 199, 89, 0.09), rgba(52, 199, 89, 0) 70%),
    linear-gradient(180deg, var(--tc-bg) 0%, color-mix(in srgb, var(--tc-bg) 72%, white 28%) 52%, var(--tc-bg-secondary) 100%);
  font-family: "PingFang SC", "Hiragino Sans GB", "Helvetica Neue", "SF Pro Text", "SF Pro Display", "Microsoft YaHei", system-ui, -apple-system, sans-serif;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  body {
    background:
      radial-gradient(48% 42% at 18% 14%, rgba(10, 132, 255, 0.14), rgba(10, 132, 255, 0) 68%),
      radial-gradient(42% 36% at 84% 12%, rgba(191, 144, 255, 0.12), rgba(191, 144, 255, 0) 70%),
      radial-gradient(42% 36% at 52% 84%, rgba(48, 209, 88, 0.08), rgba(48, 209, 88, 0) 70%),
      linear-gradient(180deg, #000 0%, #050506 56%, #0a0a0d 100%);
  }
}

a {
  color: inherit;
}

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

button {
  -webkit-tap-highlight-color: transparent;
}

img {
  max-width: 100%;
}

::selection {
  background: rgba(0, 122, 255, 0.18);
}

:focus-visible {
  outline: 2px solid rgba(0, 122, 255, 0.46);
  outline-offset: 2px;
}
