:root {
  --color-bg: #f5f7fb;
  --color-surface: #ffffff;
  --color-surface-alt: #f1f4fa;
  --color-border: #d8deed;
  --color-text: #1f2a44;
  --color-muted: #6f7b92;
  --color-accent: #3a7afe;
  --color-accent-soft: rgba(58, 122, 254, 0.1);
  --color-danger: #d6455d;
  --sidebar-width: clamp(250px, 20vw, 320px);
  --shadow-soft: 0 20px 45px rgba(86, 105, 141, 0.15);
  --radius-lg: 22px;
  --font-family-base: 'Inter', 'Segoe UI', 'PingFang SC', 'Microsoft YaHei', sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  min-height: 100vh;
  background: linear-gradient(135deg, #f6f9ff 0%, #edf2fb 45%, #fbfdff 100%);
  color: var(--color-text);
  font-family: var(--font-family-base);
}

#root {
  min-height: 100vh;
  display: flex;
  padding: clamp(1rem, 4vw, 2.5rem);
}

.app {
  flex: 1;
  display: flex;
  min-height: calc(100vh - clamp(2rem, 6vw, 5rem));
  border-radius: var(--radius-lg);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  box-shadow: var(--shadow-soft);
  overflow: hidden;
  position: relative;
}

body ::selection {
  background-color: rgba(58, 122, 254, 0.18);
  color: var(--color-text);
}

::-webkit-scrollbar {
  width: 10px;
}

::-webkit-scrollbar-track {
  background: rgba(216, 222, 237, 0.4);
  border-radius: 999px;
}

::-webkit-scrollbar-thumb {
  background: rgba(111, 123, 146, 0.35);
  border-radius: 999px;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(111, 123, 146, 0.55);
}

button:focus,
a:focus {
  outline: 2px solid rgba(58, 122, 254, 0.45);
  outline-offset: 2px;
}

@media (max-width: 1024px) {
  #root {
    padding: clamp(0.75rem, 4vw, 1.75rem);
  }

  .app {
    min-height: calc(100vh - clamp(1.5rem, 7vw, 3.5rem));
    border-radius: 18px;
  }
}

@media (max-width: 768px) {
  #root {
    padding: clamp(0.5rem, 5vw, 1.2rem);
  }

  .app {
    min-height: 100vh;
    border-radius: 16px;
  }
}
