/* 回响 · 设计系统
   暖白底 + 墨绿主色，来自心理咨询的场景气质：稳定、不冷、不用力 */

:root {
  --bg: #f6f5f2;
  --surface: #ffffff;
  --surface-2: #fbfaf8;
  --line: #e6e3dc;
  --line-strong: #d5d1c7;

  --ink: #1e2320;
  --ink-2: #4a514c;
  --ink-3: #7b827c;
  --ink-4: #a5aba5;

  --brand: #2f5d50;
  --brand-soft: #e8efec;
  --brand-ink: #24473d;

  --red: #b5372f;
  --red-soft: #fbecea;
  --yellow: #a8721f;
  --yellow-soft: #fbf3e2;
  --green: #2f6b4f;
  --green-soft: #e9f2ec;
  --blue: #2e5c85;
  --blue-soft: #eaf1f7;

  --r-sm: 8px;
  --r: 12px;
  --r-lg: 18px;

  --shadow-sm: 0 1px 2px rgba(30, 35, 32, .05);
  --shadow: 0 2px 8px rgba(30, 35, 32, .06), 0 1px 2px rgba(30, 35, 32, .04);
  --shadow-lg: 0 12px 32px rgba(30, 35, 32, .10), 0 2px 8px rgba(30, 35, 32, .06);

  --ff: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  --ff-mono: ui-monospace, "SF Mono", Menlo, monospace;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { -webkit-text-size-adjust: 100%; }

body {
  font-family: var(--ff);
  background: var(--bg);
  color: var(--ink);
  font-size: 14px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

button, input, textarea, select {
  font-family: inherit;
  font-size: inherit;
  color: inherit;
}

button { cursor: pointer; border: none; background: none; }
a { color: inherit; text-decoration: none; }

::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb { background: #d8d4cb; border-radius: 8px; }
::-webkit-scrollbar-track { background: transparent; }

/* ---------------------------------------------------------------- 按钮 */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 38px;
  padding: 0 16px;
  border-radius: var(--r-sm);
  background: var(--surface);
  border: 1px solid var(--line-strong);
  color: var(--ink);
  font-weight: 500;
  transition: .16s ease;
  white-space: nowrap;
  user-select: none;
}
.btn:hover { border-color: var(--ink-4); background: var(--surface-2); }
.btn:active { transform: translateY(.5px); }
.btn:disabled { opacity: .45; cursor: not-allowed; transform: none; }

.btn-primary {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
  box-shadow: 0 1px 2px rgba(47, 93, 80, .2);
}
.btn-primary:hover { background: var(--brand-ink); border-color: var(--brand-ink); }

.btn-danger { color: var(--red); border-color: #e3c3c0; }
.btn-danger:hover { background: var(--red-soft); border-color: #d9a9a4; }

.btn-ghost { border-color: transparent; background: transparent; color: var(--ink-2); }
.btn-ghost:hover { background: rgba(30, 35, 32, .05); border-color: transparent; }

.btn-sm { height: 30px; padding: 0 11px; font-size: 13px; border-radius: 7px; }
.btn-lg { height: 44px; padding: 0 22px; font-size: 15px; }

/* ---------------------------------------------------------------- 标签 */

.tag {
  display: inline-flex;
  align-items: center;
  height: 21px;
  padding: 0 7px;
  border-radius: 5px;
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: .2px;
  white-space: nowrap;
}
.tag-red { background: var(--red-soft); color: var(--red); }
.tag-yellow { background: var(--yellow-soft); color: var(--yellow); }
.tag-green { background: var(--green-soft); color: var(--green); }
.tag-brand { background: var(--brand-soft); color: var(--brand); }
.tag-grey { background: #eeedea; color: var(--ink-3); }
.tag-blue { background: var(--blue-soft); color: var(--blue); }

.dot { width: 6px; height: 6px; border-radius: 50%; display: inline-block; }
.dot-on { background: #37a06a; box-shadow: 0 0 0 3px rgba(55,160,106,.15); }
.dot-busy { background: #d9a03c; box-shadow: 0 0 0 3px rgba(217,160,60,.15); }
.dot-off { background: #b9bdb9; }

/* ---------------------------------------------------------------- 卡片 */

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r);
  box-shadow: var(--shadow-sm);
}

.section-title {
  font-size: 12px;
  font-weight: 700;
  color: var(--ink-3);
  letter-spacing: .8px;
  margin-bottom: 10px;
  text-transform: uppercase;
}

.muted { color: var(--ink-3); }
.small { font-size: 12.5px; }
.mono { font-family: var(--ff-mono); font-size: 12px; }

.empty {
  padding: 44px 20px;
  text-align: center;
  color: var(--ink-4);
  font-size: 13px;
  line-height: 1.9;
}

/* ---------------------------------------------------------------- 弹层 */

.mask {
  position: fixed;
  inset: 0;
  background: rgba(24, 28, 26, .38);
  backdrop-filter: blur(2px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 20px;
  animation: fade .16s ease;
}
@keyframes fade { from { opacity: 0 } to { opacity: 1 } }

.dialog {
  background: var(--surface);
  border-radius: var(--r-lg);
  width: 100%;
  max-width: 440px;
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  animation: pop .18s cubic-bezier(.2,.9,.3,1.2);
}
@keyframes pop { from { transform: scale(.96); opacity: 0 } to { transform: scale(1); opacity: 1 } }

.dialog-head {
  padding: 18px 20px 12px;
  font-weight: 700;
  font-size: 15px;
}
.dialog-body { padding: 0 20px 18px; color: var(--ink-2); font-size: 13.5px; }
.dialog-foot {
  padding: 14px 20px;
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  border-top: 1px solid var(--line);
  background: var(--surface-2);
}

/* ---------------------------------------------------------------- 表单 */

.field { margin-bottom: 14px; }
.field label { display: block; font-size: 12.5px; color: var(--ink-3); margin-bottom: 6px; font-weight: 500; }

.input, .textarea, .select {
  width: 100%;
  border: 1px solid var(--line-strong);
  border-radius: var(--r-sm);
  padding: 9px 11px;
  background: var(--surface);
  outline: none;
  transition: .15s;
}
.input:focus, .textarea:focus, .select:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(47, 93, 80, .1);
}
.textarea { resize: vertical; min-height: 90px; line-height: 1.7; }

.chip-group { display: flex; gap: 7px; flex-wrap: wrap; }
.chip {
  padding: 6px 12px;
  border-radius: 20px;
  border: 1px solid var(--line-strong);
  font-size: 13px;
  color: var(--ink-2);
  background: var(--surface);
  transition: .15s;
}
.chip:hover { border-color: var(--ink-4); }
.chip.on { background: var(--brand); border-color: var(--brand); color: #fff; }

/* ---------------------------------------------------------------- 提示条 */

.toast-wrap {
  position: fixed;
  left: 50%;
  bottom: 32px;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 200;
  pointer-events: none;
}
.toast {
  background: #262b28;
  color: #fff;
  padding: 10px 18px;
  border-radius: 22px;
  font-size: 13.5px;
  box-shadow: var(--shadow-lg);
  animation: toastIn .2s ease;
  max-width: 80vw;
  text-align: center;
}
.toast.error { background: var(--red); }
.toast.ok { background: var(--brand); }
@keyframes toastIn { from { transform: translateY(8px); opacity: 0 } to { transform: translateY(0); opacity: 1 } }

/* ---------------------------------------------------------------- 骨架 */

.skeleton {
  background: linear-gradient(90deg, #f0eeea 25%, #f7f5f2 50%, #f0eeea 75%);
  background-size: 200% 100%;
  animation: shimmer 1.4s infinite;
  border-radius: 6px;
}
@keyframes shimmer { from { background-position: 200% 0 } to { background-position: -200% 0 } }

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
