:root {
  --ink: #102532;
  --ink-2: #294252;
  --ink-3: #536b7a;
  --muted: #7c919d;
  --muted-2: #9db0ba;
  --paper: #f5f7f6;
  --card: #ffffff;
  --line: #e7eceb;
  --line-2: #dbe3e1;
  --green: #0e9f7f;
  --green-dark: #087a62;
  --green-soft: #e6f6f1;
  --mint: #35d7b2;
  --amber: #e79a2d;
  --amber-soft: #fdf3e2;
  --orange: #e8763b;
  --orange-soft: #fdf0e8;
  --red: #d55757;
  --red-soft: #fceeee;
  --blue: #3b7fc4;
  --blue-soft: #eaf3fc;
  --violet: #7159ce;
  --violet-soft: #f0edfc;
  --navy: #0b1e2c;
  --navy-2: #112d3d;
  --shadow-sm: 0 2px 10px rgba(15, 43, 58, 0.04);
  --shadow: 0 16px 44px rgba(15, 43, 58, 0.08);
  --shadow-lg: 0 34px 80px rgba(6, 24, 35, 0.22);
  --radius: 18px;
  --radius-sm: 12px;
  --font: "PingFang SC", "MiSans", "Microsoft YaHei", "Hiragino Sans GB", "Noto Sans CJK SC", sans-serif;
  --mono: "DIN Alternate", "Bahnschrift", "Segoe UI", "Microsoft YaHei", sans-serif;
}

* {
  box-sizing: border-box;
}

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

body {
  font-family: var(--font);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

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

button {
  border: 0;
  background: none;
  cursor: pointer;
}

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

svg {
  display: block;
}

::selection {
  background: rgba(14, 159, 127, 0.2);
}

.icon {
  width: 20px;
  height: 20px;
  flex: none;
}

.icon--sm {
  width: 16px;
  height: 16px;
}

.icon--xs {
  width: 14px;
  height: 14px;
}

.icon--lg {
  width: 24px;
  height: 24px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* 通用按钮 */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  height: 42px;
  padding: 0 18px;
  border: 1px solid transparent;
  border-radius: 11px;
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  transition: transform 0.16s ease, background 0.16s ease, border-color 0.16s ease, box-shadow 0.16s ease;
}

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

.btn:active {
  transform: translateY(0);
}

.btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none;
}

.btn--primary {
  background: var(--green);
  color: #fff;
  box-shadow: 0 8px 20px rgba(14, 159, 127, 0.2);
}

.btn--primary:hover {
  background: var(--green-dark);
}

.btn--dark {
  background: var(--navy);
  color: #fff;
}

.btn--ghost {
  background: #fff;
  border-color: var(--line);
  color: var(--ink-2);
}

.btn--ghost:hover {
  border-color: var(--line-2);
  background: #fbfcfc;
}

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

.btn--danger-ghost {
  background: #fff;
  border-color: #f0dada;
  color: var(--red);
}

.btn--sm {
  height: 34px;
  padding: 0 13px;
  border-radius: 9px;
  font-size: 12px;
}

.btn--block {
  width: 100%;
}

.btn .icon {
  width: 16px;
  height: 16px;
}

/* 状态色 */
.tone-green { --tone: var(--green); --tone-soft: var(--green-soft); }
.tone-amber { --tone: var(--amber); --tone-soft: var(--amber-soft); }
.tone-orange { --tone: var(--orange); --tone-soft: var(--orange-soft); }
.tone-blue { --tone: var(--blue); --tone-soft: var(--blue-soft); }
.tone-violet { --tone: var(--violet); --tone-soft: var(--violet-soft); }
.tone-red { --tone: var(--red); --tone-soft: var(--red-soft); }
.tone-gray,
.tone-slate { --tone: #728691; --tone-soft: #eef2f3; }

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 24px;
  padding: 0 9px;
  border-radius: 7px;
  color: var(--tone, #637985);
  background: var(--tone-soft, #eef2f3);
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
}

.status-pill::before {
  content: "";
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: currentColor;
}

.status-pill--plain::before {
  display: none;
}

/* 头像 */
.avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 12px;
  background: linear-gradient(145deg, #e8f5ef, #d7eee6);
  color: var(--green-dark);
  font-size: 13px;
  font-weight: 700;
  flex: none;
}

.avatar--navy {
  background: linear-gradient(145deg, #244454, #122b39);
  color: #d8f9ef;
}

.avatar--amber {
  background: #fbf0de;
  color: #a96914;
}

.avatar--violet {
  background: #f0edfc;
  color: #5a43b5;
}

.avatar--sm {
  width: 32px;
  height: 32px;
  border-radius: 9px;
  font-size: 11px;
}

/* 表单 */
.field {
  display: grid;
  gap: 8px;
}

.field > label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--ink-2);
  font-size: 12px;
  font-weight: 600;
}

.field > label span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 400;
}

.field input,
.field select,
.field textarea {
  width: 100%;
  height: 44px;
  padding: 0 13px;
  border: 1px solid var(--line-2);
  border-radius: 10px;
  background: #fff;
  font-size: 13px;
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.field textarea {
  height: 78px;
  padding: 11px 13px;
  resize: vertical;
  line-height: 1.55;
}

.field input:focus,
.field select:focus,
.field textarea:focus {
  border-color: rgba(14, 159, 127, 0.75);
  box-shadow: 0 0 0 3px rgba(14, 159, 127, 0.1);
}

.field input::placeholder,
.field textarea::placeholder {
  color: #b2c0c7;
}

.field-hint {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.5;
}

.form-error {
  display: none;
  padding: 10px 12px;
  border-radius: 9px;
  background: var(--red-soft);
  color: var(--red);
  font-size: 12px;
  line-height: 1.5;
}

.form-error.show {
  display: block;
}

/* Toast */
#toast-root {
  position: fixed;
  z-index: 2000;
  top: 22px;
  left: 50%;
  transform: translateX(-50%);
  display: grid;
  gap: 8px;
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 40px;
  padding: 0 16px;
  border-radius: 11px;
  background: #132d3c;
  color: #fff;
  font-size: 12px;
  box-shadow: 0 14px 35px rgba(5, 24, 34, 0.25);
  opacity: 0;
  transform: translateY(-8px);
  transition: opacity 0.22s ease, transform 0.22s ease;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

.toast-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--mint);
}

.toast--error .toast-dot {
  background: #ff7b72;
}

.toast--info .toast-dot {
  background: #6ec0ff;
}

/* 滚动条 */
* {
  scrollbar-width: thin;
  scrollbar-color: #c6d3d2 transparent;
}

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

*::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: #cad6d4;
}

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

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(14, 159, 127, 0.45); }
  70% { box-shadow: 0 0 0 8px rgba(14, 159, 127, 0); }
  100% { box-shadow: 0 0 0 0 rgba(14, 159, 127, 0); }
}
