:root {
  --color-bg: #eafbf2;
  --color-bg-secondary: #d6f3e3;
  --color-surface: rgba(255, 255, 255, 0.88);
  --color-surface-strong: #ffffff;
  --color-border: rgba(47, 177, 112, 0.2);
  --color-text: #1f3a2c;
  --color-muted: #4a6c5a;
  --color-link: #269c66;
  --color-link-hover: #1e7a51;
  --color-accent: #33c57a;
  --color-accent-contrast: #0f3322;
  --shadow-soft: 0 18px 38px rgba(36, 118, 74, 0.18);
  --radius-lg: 24px;
  --sidebar-width: clamp(240px, 21vw, 320px);
  --gradient-bg: linear-gradient(135deg, #f2fff8 0%, #c9f4df 40%, #a6e7d0 100%);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  min-height: 100vh;
  background: var(--gradient-bg);
  color: var(--color-text);
  font-family: 'Inter', 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
}

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

.app {
  flex: 1;
  display: flex;
  min-height: calc(100vh - clamp(1.5rem, 4vw, 4rem));
  border-radius: var(--radius-lg);
  background: var(--color-surface);
  backdrop-filter: blur(16px);
  box-shadow: var(--shadow-soft);
  overflow: hidden;
  position: relative;
}

body ::selection {
  background-color: rgba(51, 197, 122, 0.35);
  color: var(--color-accent-contrast);
}

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

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: rgba(43, 156, 105, 0.25);
  border-radius: 9999px;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(43, 156, 105, 0.4);
}

button:focus,
a:focus {
  outline: 3px solid rgba(51, 197, 122, 0.45);
  outline-offset: 2px;
}

@media (max-width: 1024px) {
  #root {
    padding: clamp(0.5rem, 3vw, 1.25rem);
  }

  .app {
    min-height: calc(100vh - clamp(1rem, 6vw, 3rem));
    border-radius: 18px;
  }
}

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

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