:root {
  --ink: #17211b;
  --muted: #68736c;
  --line: #dce3de;
  --paper: #ffffff;
  --canvas: #f3f6f3;
  --forest: #176b52;
  --forest-dark: #10513e;
  --forest-soft: #e5f1eb;
  --sun: #e8963a;
  --sun-soft: #fff0dc;
  --danger: #c84b45;
  --shadow-sm: 0 8px 24px rgba(23, 33, 27, 0.08);
  --shadow-md: 0 18px 50px rgba(23, 33, 27, 0.14);
  --radius: 8px;
  --nav-height: 68px;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

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

body {
  margin: 0;
  color: var(--ink);
  background: var(--canvas);
  font-family: "PingFang SC", "Microsoft YaHei", "Noto Sans SC", system-ui, -apple-system, sans-serif;
  -webkit-font-smoothing: antialiased;
}

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

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

img {
  display: block;
  width: 100%;
}

.icon {
  width: 18px;
  height: 18px;
  stroke-width: 1.9;
}

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

.app-nav {
  position: relative;
  z-index: 1100;
  height: var(--nav-height);
  display: flex;
  align-items: center;
  gap: 28px;
  padding: 0 26px;
  background: rgba(255, 255, 255, 0.96);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(14px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-width: max-content;
  font-size: 19px;
  font-weight: 750;
  letter-spacing: 0;
}

.brand-mark {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  color: #fff;
  border-radius: 8px;
  background: var(--forest);
  box-shadow: 0 7px 18px rgba(23, 107, 82, 0.25);
}

.brand-mark .icon {
  width: 21px;
  height: 21px;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-right: auto;
}

.nav-link {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 9px 12px;
  color: var(--muted);
  border-radius: 7px;
  font-size: 14px;
  font-weight: 600;
}

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

.nav-user {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 8px 6px 6px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
}

.nav-user img {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  object-fit: cover;
}

.nav-user span {
  max-width: 90px;
  overflow: hidden;
  color: var(--ink);
  font-size: 13px;
  font-weight: 650;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 42px;
  padding: 10px 16px;
  border: 1px solid transparent;
  border-radius: 7px;
  font-weight: 650;
  line-height: 1;
  cursor: pointer;
  transition: 160ms ease;
}

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

.btn-primary {
  color: #fff;
  background: var(--forest);
  box-shadow: 0 7px 18px rgba(23, 107, 82, 0.2);
}

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

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

.btn-secondary:hover {
  border-color: #b8c7be;
  background: #fafcfb;
}

.btn-ghost {
  min-height: 36px;
  padding: 8px 10px;
  color: var(--muted);
  background: transparent;
}

.btn-ghost:hover {
  color: var(--forest);
  background: var(--forest-soft);
}

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

.btn-danger:hover {
  background: #fff6f5;
}

.btn-icon {
  width: 42px;
  min-width: 42px;
  padding: 0;
}

.page-shell {
  min-height: calc(100vh - var(--nav-height));
}

.page-container {
  width: min(1180px, calc(100% - 40px));
  margin: 0 auto;
}

.page-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  padding: 34px 0 24px;
}

.page-heading h1 {
  margin: 0 0 6px;
  font-size: clamp(27px, 3vw, 40px);
  letter-spacing: 0;
}

.page-heading p {
  margin: 0;
  color: var(--muted);
  font-size: 15px;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
  color: var(--forest);
  font-size: 13px;
  font-weight: 750;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

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

.input,
.textarea,
.select {
  width: 100%;
  min-height: 46px;
  padding: 11px 13px;
  color: var(--ink);
  border: 1px solid #cfd8d2;
  border-radius: 7px;
  outline: none;
  background: #fff;
  transition: 150ms ease;
}

.input:focus,
.textarea:focus,
.select:focus {
  border-color: var(--forest);
  box-shadow: 0 0 0 3px rgba(23, 107, 82, 0.12);
}

.textarea {
  min-height: 116px;
  resize: vertical;
  line-height: 1.7;
}

.field {
  display: grid;
  gap: 8px;
  margin-bottom: 18px;
}

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

.field label {
  color: #344039;
  font-size: 14px;
  font-weight: 650;
}

.field-hint {
  color: var(--muted);
  font-size: 12px;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 9px;
  color: var(--forest);
  border: 1px solid #cbe2d6;
  border-radius: 999px;
  background: var(--forest-soft);
  font-size: 12px;
  font-weight: 650;
}

.badge-warm {
  color: #945a13;
  border-color: #f4d7ae;
  background: var(--sun-soft);
}

.toast {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 3000;
  display: flex;
  align-items: center;
  gap: 10px;
  max-width: min(360px, calc(100vw - 44px));
  padding: 13px 15px;
  color: #fff;
  border-radius: 8px;
  background: #1f2c25;
  box-shadow: var(--shadow-md);
  opacity: 0;
  transform: translateY(12px);
  pointer-events: none;
  transition: 180ms ease;
}

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

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: none;
  place-items: center;
  padding: 20px;
  background: rgba(16, 25, 20, 0.52);
  backdrop-filter: blur(4px);
}

.modal-backdrop.open {
  display: grid;
}

.modal {
  width: min(560px, 100%);
  max-height: calc(100vh - 40px);
  overflow: auto;
  border-radius: 10px;
  background: #fff;
  box-shadow: var(--shadow-md);
}

.modal-head,
.modal-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 20px;
}

.modal-head {
  border-bottom: 1px solid var(--line);
}

.modal-head h3 {
  margin: 0;
  font-size: 18px;
}

.modal-body {
  padding: 20px;
}

.modal-foot {
  justify-content: flex-end;
  border-top: 1px solid var(--line);
}

.empty-state {
  padding: 70px 24px;
  color: var(--muted);
  text-align: center;
  border: 1px dashed #c9d4cd;
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.65);
}

.empty-state .icon {
  width: 36px;
  height: 36px;
  margin-bottom: 12px;
  color: #8a988f;
}

.avatar {
  border-radius: 50%;
  object-fit: cover;
  background: #dce6df;
}

.skeleton {
  position: relative;
  overflow: hidden;
  background: #e8ede9;
}

.skeleton::after {
  position: absolute;
  inset: 0;
  content: "";
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.65), transparent);
  transform: translateX(-100%);
  animation: shimmer 1.3s infinite;
}

@keyframes shimmer {
  to {
    transform: translateX(100%);
  }
}

@media (max-width: 900px) {
  .app-nav {
    gap: 14px;
    padding: 0 16px;
  }

  .nav-links {
    display: none;
  }

  .nav-user {
    margin-left: auto;
  }

  .page-container {
    width: min(100% - 28px, 760px);
  }
}

@media (max-width: 640px) {
  :root {
    --nav-height: 62px;
  }

  .brand {
    font-size: 17px;
  }

  .brand-mark {
    width: 34px;
    height: 34px;
  }

  .nav-user span {
    display: none;
  }

  .field-row {
    grid-template-columns: 1fr;
    gap: 0;
  }

  .page-heading {
    align-items: flex-start;
    flex-direction: column;
    padding-top: 24px;
  }
}
