:root {
  color-scheme: light;
  --bg-body: #f3f4f6;
  --bg-panel: rgba(255, 255, 255, 0.95);
  --bg-panel-solid: #ffffff;
  --bg-surface: #f9fafb;
  --bg-surface-hover: #f3f4f6;
  --bg-input: #ffffff;

  --text-main: #1e293b;
  --text-muted: #64748b;
  --text-inverse: #ffffff;

  --border-light: rgba(148, 163, 184, 0.2);
  --border-strong: rgba(148, 163, 184, 0.4);

  --accent: #10b981;
  --accent-hover: #059669;
  --accent-soft: rgba(16, 185, 129, 0.1);
  --accent-strong: #047857;

  --warn: #ef4444;
  --warn-soft: rgba(239, 68, 68, 0.1);
  --warn-text: #b91c1c;

  --shadow-sm: 0 2px 8px -2px rgba(15, 23, 42, 0.05);
  --shadow-md: 0 8px 24px -4px rgba(15, 23, 42, 0.08);
  --shadow-lg: 0 24px 70px rgba(15, 23, 42, 0.12);

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 18px;
  --radius-xl: 24px;

  --transition: 200ms cubic-bezier(0.4, 0, 0.2, 1);
}

@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
    --bg-body: #0b1117;
    --bg-panel: rgba(16, 24, 34, 0.95);
    --bg-panel-solid: #101822;
    --bg-surface: #1a2332;
    --bg-surface-hover: #222e40;
    --bg-input: #0b1117;

    --text-main: #edf3f8;
    --text-muted: #94a3b8;
    --text-inverse: #0f172a;

    --border-light: rgba(145, 171, 196, 0.15);
    --border-strong: rgba(145, 171, 196, 0.3);

    --accent: #34d399;
    --accent-hover: #10b981;
    --accent-soft: rgba(52, 211, 153, 0.15);
    --accent-strong: #a7f3d0;

    --warn: #f87171;
    --warn-soft: rgba(248, 113, 113, 0.15);
    --warn-text: #fecaca;

    --shadow-sm: 0 4px 12px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 12px 32px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 24px 70px rgba(0, 0, 0, 0.5);
  }
}

* {
  box-sizing: border-box;
}

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

body {
  font-family: 'Inter', 'Space Grotesk', 'Sora', 'Noto Sans SC', 'Microsoft YaHei', sans-serif;
  color: var(--text-main);
  background: var(--bg-body);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

[x-cloak] {
  display: none !important;
}

.is-hidden {
  display: none !important;
}

h1,
h2,
h3,
h4,
h5,
h6 {
  margin: 0;
  font-weight: 600;
  color: var(--text-main);
}

p {
  margin: 0;
}

a {
  color: inherit;
}

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

button {
  border: 0;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all var(--transition);
}

button:active {
  transform: scale(0.98);
}

button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

input[type='text'],
input[type='password'],
input[type='date'],
select {
  width: 100%;
  padding: 12px 16px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-light);
  background: var(--bg-input);
  color: var(--text-main);
  transition: all var(--transition);
}

input:focus,
select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

code,
pre {
  font-family: 'SFMono-Regular', 'JetBrains Mono', 'Menlo', 'Monaco', 'Cascadia Mono', monospace;
}

.panel {
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  background: var(--bg-panel);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.panel-header {
  padding: 20px 24px;
  border-bottom: 1px solid var(--border-light);
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: rgba(0, 0, 0, 0.02);
}

.panel-title h2 {
  font-size: 18px;
  margin-bottom: 4px;
}

.panel-title span {
  font-size: 13px;
  color: var(--text-muted);
}

.panel-subnote {
  margin-top: 6px;
  max-width: 760px;
  font-size: 12px;
  color: var(--text-muted);
}

.panel-title-row {
  flex-direction: row;
  align-items: center;
  gap: 12px;
}

.btn {
  padding: 10px 18px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 500;
}

.btn-link {
  text-decoration: none;
}

.btn-primary {
  background: var(--accent);
  color: var(--text-inverse);
  box-shadow: 0 4px 12px var(--accent-soft);
}

.btn-primary:hover:not(:disabled) {
  background: var(--accent-hover);
  transform: translateY(-1px);
}

.btn-secondary {
  background: var(--bg-surface);
  border: 1px solid var(--border-light);
  color: var(--text-main);
}

.btn-secondary:hover:not(:disabled) {
  background: var(--bg-surface-hover);
}

.btn-danger {
  background: var(--warn-soft);
  border: 1px solid var(--warn-soft);
  color: var(--warn-text);
}

.btn-danger:hover:not(:disabled) {
  background: var(--warn);
  color: #fff;
}

.btn-icon {
  padding: 8px;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text-muted);
}

.btn-icon:hover:not(:disabled) {
  background: var(--bg-surface);
  color: var(--text-main);
}

.btn-compact {
  padding: 4px 8px;
  font-size: 12px;
}

::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

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

::-webkit-scrollbar-thumb {
  background: var(--border-strong);
  border-radius: 999px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--text-muted);
}
