/* ═══════════════════════════════════════════════════════════════
   Salon Platform · Neumorphism Design System
   新拟物派 + 暗色模式 + 绿色主题
   ═══════════════════════════════════════════════════════════════ */

/* ─── 浅色模式（默认） ─── */
:root {
  /* 背景 */
  --bg: #e0e5ec;
  --bg-elevated: #e6ebf2;
  --bg-inset: #d6dbe4;

  /* 双光源阴影 */
  --shadow-dark: #b8bcc2;
  --shadow-light: #ffffff;

  /* 凸起阴影（小/中/大） */
  --raise-xs: 2px 2px 4px var(--shadow-dark), -2px -2px 4px var(--shadow-light);
  --raise-sm: 4px 4px 8px var(--shadow-dark), -4px -4px 8px var(--shadow-light);
  --raise-md: 6px 6px 12px var(--shadow-dark), -6px -6px 12px var(--shadow-light);
  --raise-lg: 8px 8px 16px var(--shadow-dark), -8px -8px 16px var(--shadow-light);
  --raise-xl: 12px 12px 24px var(--shadow-dark), -12px -12px 24px var(--shadow-light);

  /* Hover：阴影缩小 */
  --raise-hover-sm: 3px 3px 6px var(--shadow-dark), -3px -3px 6px var(--shadow-light);
  --raise-hover-md: 4px 4px 8px var(--shadow-dark), -4px -4px 8px var(--shadow-light);

  /* 凹陷阴影 */
  --inset-sm: inset 2px 2px 4px var(--shadow-dark), inset -2px -2px 4px var(--shadow-light);
  --inset-md: inset 4px 4px 8px var(--shadow-dark), inset -4px -4px 8px var(--shadow-light);
  --inset-lg: inset 6px 6px 12px var(--shadow-dark), inset -6px -6px 12px var(--shadow-light);

  /* 主题色：绿色 */
  --accent: #4ecdc4;
  --accent-deep: #3dbbb3;
  --accent-bright: #6edad4;
  --accent-soft: rgba(78, 205, 196, 0.15);
  --accent-line: rgba(78, 205, 196, 0.35);

  /* 语义色 */
  --green: #4ecdc4;
  --red: #cf5b52;
  --gold: #c9a24b;

  /* 文字 */
  --ink: #333333;
  --ink-soft: #6b7280;
  --ink-faint: #9ca3af;

  /* 圆角 */
  --r-sm: 10px;
  --r: 14px;
  --r-lg: 20px;
  --r-xl: 24px;

  /* 过渡 */
  --ease: ease-in-out;
  --dur: 0.3s;
}

/* ─── 暗色模式 ─── */
[data-theme="dark"] {
  --bg: #2a2d35;
  --bg-elevated: #323640;
  --bg-inset: #22252c;

  --shadow-dark: #1e2025;
  --shadow-light: #363a45;

  --ink: #e0e5ec;
  --ink-soft: #9ca3af;
  --ink-faint: #6b7280;

  --accent: #5dd4c9;
  --accent-deep: #4ecdc4;
  --accent-bright: #7edad9;
  --accent-soft: rgba(93, 212, 201, 0.15);
  --accent-line: rgba(93, 212, 201, 0.3);
}

/* ─── Reset ─── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-font-smoothing: antialiased; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "PingFang SC", sans-serif;
  background: var(--bg);
  color: var(--ink);
  line-height: 1.6;
  font-size: 15px;
  transition: background-color var(--dur) var(--ease), color var(--dur) var(--ease);
}

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

/* ─── 按钮系统 ─── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 18px;
  font-size: 14px;
  font-weight: 500;
  border-radius: var(--r);
  border: none;
  background: var(--bg);
  color: var(--ink);
  cursor: pointer;
  box-shadow: var(--raise-sm);
  transition: box-shadow var(--dur) var(--ease), background-color var(--dur) var(--ease), color var(--dur) var(--ease);
  font-family: inherit;
  text-decoration: none;
  line-height: 1.4;
  white-space: nowrap;
}

.btn:hover {
  box-shadow: var(--raise-hover-sm);
}

.btn:active {
  box-shadow: var(--inset-sm);
}

/* Primary：绿色实心 + 凸起 */
.btn-primary {
  background: var(--accent);
  color: #fff;
  box-shadow: var(--raise-sm);
}

.btn-primary:hover {
  background: var(--accent-deep);
  box-shadow: var(--raise-hover-sm);
}

.btn-primary:active {
  background: var(--accent-deep);
  box-shadow: var(--inset-sm);
}

/* Ghost：透明 + 凸起 */
.btn-ghost {
  background: transparent;
  color: var(--ink-soft);
  box-shadow: none;
}

.btn-ghost:hover {
  background: var(--bg-elevated);
  box-shadow: var(--raise-xs);
  color: var(--ink);
}

.btn-ghost:active {
  box-shadow: var(--inset-sm);
}

/* Danger */
.btn-danger {
  background: var(--red);
  color: #fff;
  box-shadow: var(--raise-sm);
}

.btn-danger:hover {
  box-shadow: var(--raise-hover-sm);
}

.btn-danger:active {
  box-shadow: var(--inset-sm);
}

/* 尺寸 */
.btn-sm { padding: 5px 12px; font-size: 12px; border-radius: var(--r-sm); }
.btn-lg { padding: 10px 24px; font-size: 15px; border-radius: var(--r); }
.btn-xl { padding: 14px 32px; font-size: 16px; border-radius: var(--r-lg); }
.btn-block { width: 100%; }

/* ─── 输入框 ─── */
.input, .select, .textarea {
  width: 100%;
  font: inherit;
  font-size: 14px;
  color: var(--ink);
  background: var(--bg);
  border: none;
  border-radius: var(--r);
  padding: 12px 16px;
  outline: none;
  box-shadow: var(--inset-md);
  transition: box-shadow var(--dur) var(--ease);
}

.input::placeholder, .textarea::placeholder { color: var(--ink-faint); }

.input:focus, .select:focus, .textarea:focus {
  box-shadow: var(--inset-sm);
}

/* ─── 卡片 ─── */
.card {
  background: var(--bg);
  border-radius: var(--r-lg);
  padding: 24px;
  box-shadow: var(--raise-md);
  transition: box-shadow var(--dur) var(--ease);
}

.card:hover {
  box-shadow: var(--raise-lg);
}

/* ─── Section ─── */
.section { padding: 48px 0; max-width: 720px; margin: 0 auto; }
.section-label { font-size: 11px; color: var(--ink-faint); font-weight: 500; margin-bottom: 6px; text-transform: uppercase; letter-spacing: 0.04em; }
.section-title { font-size: 24px; font-weight: 600; color: var(--ink); line-height: 1.25; margin-bottom: 8px; }
.section-sub { font-size: 14px; line-height: 1.7; color: var(--ink-soft); }

/* ─── Toast ─── */
.toast {
  position: fixed;
  bottom: 72px;
  left: 50%;
  transform: translateX(-50%) translateY(12px);
  background: var(--ink);
  color: var(--bg);
  padding: 10px 20px;
  border-radius: var(--r);
  font-size: 13px;
  opacity: 0;
  transition: opacity var(--dur) var(--ease), transform var(--dur) var(--ease);
  z-index: 300;
  pointer-events: none;
  box-shadow: var(--raise-md);
}

.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast.error { background: var(--red); color: #fff; }
.toast.success { background: var(--green); color: #fff; }

/* ─── Modal ─── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(51, 51, 51, 0.36);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 400;
  animation: fadeIn 0.2s ease;
}

[data-theme="dark"] .modal-overlay {
  background: rgba(0, 0, 0, 0.55);
}

.modal-box {
  background: var(--bg);
  border-radius: var(--r-lg);
  padding: 24px;
  max-width: 400px;
  width: calc(100% - 32px);
  box-shadow: var(--raise-xl);
}

.modal-box h3 { font-size: 16px; font-weight: 600; margin-bottom: 8px; color: var(--ink); }

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

/* ─── Utilities ─── */
.empty { text-align: center; padding: 48px 20px; color: var(--ink-faint); }
.spinner { display: inline-block; width: 18px; height: 18px; border: 2px solid var(--bg-elevated); border-top-color: var(--accent); border-radius: 50%; animation: spin 0.7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ─── 暗色模式切换按钮 ─── */
.theme-toggle {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: none;
  background: var(--bg);
  box-shadow: var(--raise-sm);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--ink-soft);
  transition: box-shadow var(--dur) var(--ease), color var(--dur) var(--ease);
}

.theme-toggle:hover {
  box-shadow: var(--raise-hover-sm);
  color: var(--accent);
}

.theme-toggle:active {
  box-shadow: var(--inset-sm);
}

.theme-toggle svg { width: 18px; height: 18px; }
