:root {
  --bg: #f4f6fb;
  --surface: #ffffff;
  --surface-muted: #f8fafc;
  --line: #d9e2f2;
  --text: #172033;
  --text-muted: #667085;
  --primary: #2b6cb0;
  --primary-dark: #005394;
  --primary-soft: #e0eef8;
  --success: #047857;
  --danger: #dc2626;
  --warning: #d97706;
  --shadow: 0 20px 48px rgba(15, 23, 42, 0.08);
  --radius-lg: 24px;
  --radius-md: 18px;
  --radius-sm: 12px;
  --page-width: 1160px;
  --auth-width: 520px;
  color-scheme: light;
  font-family: "SF Pro Display", "PingFang SC", "Microsoft YaHei", sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  background: radial-gradient(
    circle at top,
    #eef4ff 0,
    #f6f8fc 34%,
    #eef2f8 100%
  );
  color: var(--text);
}

body {
  line-height: 1.5;
}

a {
  color: inherit;
  text-decoration: none;
}

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

button {
  cursor: pointer;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  backdrop-filter: blur(16px);
  background: rgba(244, 246, 251, 0.88);
  border-bottom: 1px solid rgba(217, 226, 242, 0.7);
}

.site-header-inner,
.page-shell {
  width: min(var(--page-width), calc(100vw - 32px));
  margin: 0 auto;
}

.site-header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 72px;
  gap: 20px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-weight: 800;
  letter-spacing: -0.03em;
}

.brand-mark {
  width: 42px;
  height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 14px;
  background: linear-gradient(135deg, #2b6cb0, #3182ce 55%, #63b3ed);
  color: #fff;
  box-shadow: 0 12px 24px rgba(43, 108, 176, 0.28);
}

.site-nav {
  display: inline-flex;
  align-items: center;
  gap: 12px;
}

.nav-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border-radius: 999px;
  color: var(--text-muted);
  transition:
    background 0.2s ease,
    color 0.2s ease;
}

.nav-link:hover,
.nav-link.is-active {
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow);
}

.page-shell {
  padding: 28px 0 56px;
}

.auth-shell {
  width: min(var(--auth-width), calc(100vw - 32px));
  margin: 28px auto 56px;
}

.auth-card,
.card {
  background: var(--surface);
  border: 1px solid rgba(217, 226, 242, 0.8);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
}

.auth-card {
  padding: 36px 32px;
}

.auth-hero {
  margin-bottom: 28px;
}

.auth-title,
.page-title {
  margin: 0;
  font-size: 2rem;
  line-height: 1.1;
  letter-spacing: -0.04em;
}

.auth-subtitle,
.page-subtitle {
  margin: 10px 0 0;
  color: var(--text-muted);
}

.field-group {
  display: grid;
  gap: 16px;
}

.field {
  display: grid;
  gap: 8px;
}

.field label {
  font-size: 0.95rem;
  font-weight: 600;
}

.input,
.textarea,
.select {
  width: 100%;
  padding: 14px 16px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background: var(--surface-muted);
  color: var(--text);
  transition:
    border-color 0.2s ease,
    box-shadow 0.2s ease,
    background 0.2s ease;
}

.input:focus,
.textarea:focus,
.select:focus {
  outline: none;
  border-color: rgba(43, 108, 176, 0.55);
  box-shadow: 0 0 0 4px rgba(43, 108, 176, 0.12);
  background: var(--surface);
}

.textarea {
  min-height: 140px;
  resize: vertical;
}

.input-row {
  display: flex;
  gap: 12px;
}

.input-row .input {
  flex: 1;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
  padding: 0 18px;
  border: 0;
  border-radius: 999px;
  font-weight: 700;
  transition:
    transform 0.18s ease,
    box-shadow 0.18s ease,
    background 0.18s ease;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary), #3182ce);
  color: #fff;
  box-shadow: 0 14px 28px rgba(43, 108, 176, 0.25);
}

.btn-primary:hover {
  background: linear-gradient(135deg, var(--primary-dark), var(--primary));
}

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

.btn-soft {
  background: var(--primary-soft);
  color: var(--primary);
}

.btn-danger {
  background: #fee2e2;
  color: var(--danger);
}

.btn-block {
  width: 100%;
}

.helper-text {
  color: var(--text-muted);
  font-size: 0.92rem;
}

.link {
  color: var(--primary);
  font-weight: 600;
}

.member-shell {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  gap: 24px;
  align-items: start;
}

.member-nav {
  position: sticky;
  top: 96px;
  padding: 20px;
  display: grid;
  gap: 10px;
}

.member-nav-title {
  margin: 0 0 8px;
  font-size: 0.92rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
}

.member-nav-link {
  padding: 12px 14px;
  border-radius: 14px;
  color: var(--text-muted);
}

.member-nav-link:hover,
.member-nav-link.is-active {
  background: var(--primary-soft);
  color: var(--primary);
}

.member-content {
  display: grid;
  gap: 20px;
}

.hero-card {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 24px;
  border-radius: var(--radius-lg);
  background: linear-gradient(145deg, #0f172a, #2b6cb0 78%);
  color: #fff;
}

.avatar {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  object-fit: cover;
  background: rgba(255, 255, 255, 0.16);
}

.hero-meta h1 {
  margin: 0;
  font-size: 1.85rem;
  letter-spacing: -0.03em;
}

.hero-meta p {
  margin: 8px 0 0;
  color: rgba(255, 255, 255, 0.85);
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.stat-card {
  padding: 18px;
  background: var(--surface);
  border: 1px solid rgba(217, 226, 242, 0.8);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow);
}

.stat-label {
  color: var(--text-muted);
  font-size: 0.92rem;
}

.stat-value {
  margin-top: 10px;
  font-size: 1.65rem;
  font-weight: 800;
  letter-spacing: -0.04em;
}

.section-card {
  padding: 24px;
}

.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.section-title {
  margin: 0;
  font-size: 1.2rem;
  letter-spacing: -0.03em;
}

.section-note {
  color: var(--text-muted);
  font-size: 0.92rem;
}

.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.list {
  display: grid;
  gap: 12px;
}

.list-item {
  padding: 18px;
  background: var(--surface-muted);
  border: 1px solid rgba(217, 226, 242, 0.75);
  border-radius: var(--radius-md);
}

.list-title {
  margin: 0;
  font-weight: 700;
}

.list-meta {
  margin-top: 8px;
  color: var(--text-muted);
  font-size: 0.92rem;
}

.split-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 0;
  border-top: 1px solid rgba(217, 226, 242, 0.75);
}

.toggle-row:first-child {
  border-top: 0;
  padding-top: 0;
}

.toggle-label {
  font-weight: 600;
}

.toggle-note {
  color: var(--text-muted);
  font-size: 0.9rem;
}

.switch {
  position: relative;
  width: 54px;
  height: 30px;
  flex: 0 0 auto;
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  inset: 0;
  border-radius: 999px;
  background: #cbd5e1;
  transition: background 0.18s ease;
}

.slider::before {
  content: "";
  position: absolute;
  width: 24px;
  height: 24px;
  top: 3px;
  left: 3px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 3px 12px rgba(15, 23, 42, 0.18);
  transition: transform 0.18s ease;
}

.switch input:checked + .slider {
  background: var(--primary);
}

.switch input:checked + .slider::before {
  transform: translateX(24px);
}

.pill {
  display: inline-flex;
  align-items: center;
  padding: 5px 10px;
  border-radius: 999px;
  background: var(--primary-soft);
  color: var(--primary);
  font-size: 0.82rem;
  font-weight: 700;
}

.pill.success {
  background: #d1fae5;
  color: var(--success);
}

.pill.warning {
  background: #fef3c7;
  color: var(--warning);
}

.pill.danger {
  background: #fee2e2;
  color: var(--danger);
}

.empty-state {
  padding: 42px 24px;
  text-align: center;
  color: var(--text-muted);
}

.toast {
  position: fixed;
  top: 50%;
  left: 50%;
  right: auto;
  bottom: auto;
  z-index: 60;
  min-width: 240px;
  max-width: min(420px, calc(100vw - 32px));
  padding: 14px 18px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.98);
  color: #1f2937;
  border: 1px solid #e5e7eb;
  box-shadow: 0 18px 42px rgba(15, 23, 42, 0.12);
  opacity: 0;
  transform: translate(-50%, -50%) scale(0.98);
  pointer-events: none;
  transition:
    opacity 0.18s ease,
    transform 0.18s ease;
}

.toast.is-centered {
  top: 50%;
  left: 50%;
}

.toast.is-visible {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
}

.toast.is-centered.is-visible {
  transform: translate(-50%, -50%) scale(1);
}

@media (max-width: 980px) {
  .member-shell {
    grid-template-columns: 1fr;
  }

  .member-nav {
    position: static;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .stat-grid,
  .split-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .site-header-inner,
  .page-shell,
  .auth-shell {
    width: min(100vw - 20px, var(--page-width));
  }

  .auth-card,
  .section-card,
  .member-nav {
    padding: 20px;
  }

  .hero-card {
    flex-direction: column;
    align-items: flex-start;
  }

  .stat-grid,
  .split-grid,
  .member-nav {
    grid-template-columns: 1fr;
  }

  .input-row,
  .section-head,
  .site-header-inner {
    flex-direction: column;
    align-items: stretch;
  }
}
