:root {
  --bg: #f2f5f2;
  --panel: #ffffff;
  --panel-solid: #ffffff;
  --line: #d5ded8;
  --line-strong: #bccbc1;
  --text: #15231b;
  --muted: #647168;
  --brand: #176b4d;
  --brand-strong: #0f5038;
  --brand-2: #6f9344;
  --accent: #b7792b;
  --info: #2f7080;
  --danger: #c94f3d;
  --warning: #d99122;
  --success: #2c845d;
  --shadow: 0 8px 24px rgba(28, 52, 39, 0.06);
  --shadow-soft: 0 3px 12px rgba(28, 52, 39, 0.05);
  --radius: 8px;
  --radius-sm: 6px;
  --sidebar: #163b2a;
  --sidebar-2: #1f4d37;
  --surface-tint: #f7f9f7;
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 24px;
}

* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
}

body {
  margin: 0;
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", Arial, sans-serif;
  color: var(--text);
  background: var(--bg);
  font-variant-numeric: tabular-nums;
}

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

button {
  cursor: pointer;
}

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

.boot-screen {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.boot-card {
  width: min(520px, 100%);
  background: var(--panel);
  border: 1px solid rgba(255, 255, 255, 0.75);
  box-shadow: var(--shadow);
  border-radius: 20px;
  padding: 36px;
  text-align: center;
}

.boot-badge,
.pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.boot-badge {
  color: var(--brand);
  background: rgba(23, 107, 77, 0.12);
  margin-bottom: 16px;
}

.boot-card h1 {
  margin: 0 0 10px;
  font-size: clamp(28px, 4vw, 40px);
  line-height: 1.1;
}

.boot-card p {
  margin: 0;
  color: var(--muted);
}

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 248px minmax(0, 1fr);
}

.sidebar {
  position: sticky;
  top: 0;
  min-height: 100vh;
  background: var(--sidebar);
  color: #f8fbff;
  padding: 20px 12px 16px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  border-right: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: none;
}

.brand {
  padding: 4px 8px 18px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.brand-main {
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
}

.brand-symbol {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  color: #f4f8e9;
  background: #2d7654;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 8px;
}

.brand-symbol .nav-icon {
  width: 22px;
  height: 22px;
}

.brand-copy {
  min-width: 0;
}

.brand h1 {
  margin: 0 0 4px;
  font-size: 16px;
  line-height: 1.35;
  white-space: normal;
  overflow: hidden;
  letter-spacing: 0;
}

.brand p {
  margin: 0;
  color: rgba(248, 251, 255, 0.68);
  font-size: 13px;
}

.nav {
  display: grid;
  gap: 6px;
}

.nav-section {
  padding: 10px 10px 6px;
  color: rgba(248, 251, 255, 0.52);
  font-size: 11px;
  letter-spacing: 0;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  padding: 10px 12px 10px 10px;
  border-radius: 6px;
  color: rgba(248, 251, 255, 0.78);
  border: 1px solid transparent;
  position: relative;
  transition: background 0.18s ease, color 0.18s ease, border-color 0.18s ease;
}

.nav-item:hover {
  background: rgba(255, 255, 255, 0.07);
  border-color: rgba(255, 255, 255, 0.08);
}

.nav-item.active {
  background: rgba(255, 255, 255, 0.11);
  color: #fff;
  border-color: rgba(255, 255, 255, 0.12);
  box-shadow: none;
}

.nav-item.active::before {
  content: "";
  position: absolute;
  left: -11px;
  top: 8px;
  bottom: 8px;
  width: 3px;
  border-radius: 0 3px 3px 0;
  background: #a9c66d;
}

.nav-icon-wrap {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.1);
  flex: 0 0 auto;
}

.nav-item.active .nav-icon-wrap {
  color: #f7fbe9;
  background: rgba(169, 198, 109, 0.14);
  border-color: rgba(205, 224, 164, 0.22);
}

.nav-icon {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  pointer-events: none;
}

.sidebar-footer {
  margin-top: auto;
  padding: 12px 10px 0;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  display: grid;
  gap: 12px;
}

.user-chip {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.075);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.avatar {
  width: 38px;
  height: 38px;
  border-radius: 6px;
  background: #3b805d;
  display: grid;
  place-items: center;
  font-weight: 700;
  color: white;
  flex: 0 0 auto;
}

.user-meta strong {
  display: block;
  font-size: 14px;
}

.user-meta span {
  color: rgba(248, 251, 255, 0.72);
  font-size: 12px;
}

.ghost-button,
.primary-button,
.danger-button,
.secondary-button,
.link-button {
  border: 0;
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  font-weight: 600;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.primary-button {
  color: #fff;
  background: var(--brand);
  box-shadow: none;
}

.primary-button:hover,
.ghost-button:hover,
.danger-button:hover,
.secondary-button:hover,
.link-button:hover {
  transform: translateY(-1px);
}

.danger-button {
  color: #fff;
  background: linear-gradient(135deg, #dc2626, #ef4444);
}

.secondary-button {
  background: #edf3ee;
  color: var(--text);
  border: 1px solid var(--line);
}

.ghost-button {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.14);
}

.link-button {
  padding: 0;
  color: var(--brand);
  background: transparent;
}

.main {
  min-width: 0;
  padding: 16px 24px 32px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 4px 2px 16px;
  border-radius: 0;
  background: transparent;
  border: 0;
  border-bottom: 1px solid var(--line);
  box-shadow: none;
  margin-bottom: 20px;
}

.topbar h2 {
  margin: 0;
  font-size: 21px;
  letter-spacing: 0;
}

.topbar p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 14px;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.page {
  display: grid;
  gap: 20px;
}

.hero {
  background: #eaf1ec;
  border: 1px solid var(--line);
  border-left: 4px solid var(--brand);
  box-shadow: none;
  border-radius: var(--radius);
  padding: 20px;
  overflow: hidden;
  position: relative;
}

.hero::after {
  display: none;
}

.hero h3 {
  margin: 0 0 10px;
  font-size: 26px;
  letter-spacing: 0;
}

.hero p {
  margin: 0;
  color: var(--muted);
  max-width: 780px;
  line-height: 1.7;
}

.hero-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-top: 18px;
}

.stat {
  background: var(--panel-solid);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
  box-shadow: none;
  position: relative;
}

.stat::before {
  content: "";
  position: absolute;
  left: 0;
  top: 14px;
  bottom: 14px;
  width: 3px;
  border-radius: 0 999px 999px 0;
  background: var(--brand);
}

.stat--info::before {
  background: var(--info);
}

.stat--info .value {
  color: #245d69;
}

.stat--moss::before {
  background: var(--brand-2);
}

.stat--moss .value {
  color: #567633;
}

.stat--success::before {
  background: var(--success);
}

.stat--warning::before {
  background: var(--warning);
}

.stat--warning .value {
  color: #9a6117;
}

.stat--danger::before {
  background: var(--danger);
}

.stat--danger .value {
  color: #a33f32;
}

.stat--accent::before {
  background: var(--accent);
}

.stat--accent .value {
  color: #8b5b20;
}

.stat .label {
  color: var(--muted);
  font-size: 13px;
}

.stat .value {
  margin-top: 8px;
  font-size: 30px;
  font-weight: 800;
  color: #123b28;
  letter-spacing: 0;
}

.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: none;
  overflow: hidden;
}

.card-head {
  padding: 16px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid var(--line);
  background: transparent;
}

.card-head h3 {
  margin: 0;
  font-size: 17px;
  letter-spacing: 0;
}

.card-head p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 14px;
}

.card-body {
  padding: 18px;
}

.toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.toolbar .left,
.toolbar .right {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.field-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
}

.field,
.search-field,
.modal-field {
  display: grid;
  gap: 8px;
}

.field label,
.search-field label,
.modal-field label {
  font-size: 13px;
  color: var(--muted);
  font-weight: 600;
}

.label-text {
  letter-spacing: 0.01em;
}

.required-mark {
  color: #dc2626;
  margin-left: 4px;
}

.field-error {
  color: #b91c1c;
  font-size: 12px;
  line-height: 1.3;
}

.field input,
.field select,
.field textarea,
.search-field input,
.search-field select,
.modal-field input,
.modal-field select,
.modal-field textarea {
  width: 100%;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--text);
  border-radius: 6px;
  padding: 12px 14px;
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.field textarea,
.modal-field textarea {
  min-height: 128px;
  resize: vertical;
}

.field input:focus,
.field select:focus,
.field textarea:focus,
.search-field input:focus,
.search-field select:focus,
.modal-field input:focus,
.modal-field select:focus,
.modal-field textarea:focus {
  border-color: rgba(23, 107, 77, 0.58);
  box-shadow: 0 0 0 4px rgba(23, 107, 77, 0.12);
}

.field.has-error input,
.field.has-error select,
.field.has-error textarea,
.modal-field.has-error input,
.modal-field.has-error select,
.modal-field.has-error textarea {
  border-color: rgba(220, 38, 38, 0.58);
  box-shadow: 0 0 0 4px rgba(220, 38, 38, 0.12);
}

.modal-field {
  border: 1px solid #d9e5f2;
  border-radius: 8px;
  padding: 12px 12px 10px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(250, 252, 255, 0.98));
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.05);
}

.modal-field.field-span-2 {
  grid-column: span 2;
}

.modal-field input,
.modal-field select,
.modal-field textarea {
  background: #f9fbff;
  border-color: #d6e4f3;
}

.modal-field textarea {
  min-height: 150px;
}

.search-panel {
  padding: 16px 18px 6px;
}

.search-form {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 12px 16px;
}

.search-actions {
  display: flex;
  align-items: end;
  gap: 10px;
  flex-wrap: wrap;
}

.table-wrap {
  overflow: auto;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: #fff;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 920px;
}

.data-table th,
.data-table td {
  padding: 14px 14px;
  border-bottom: 1px solid #eef2f7;
  text-align: left;
  vertical-align: middle;
}

.data-table td {
  white-space: normal;
  word-break: break-word;
  overflow-wrap: anywhere;
}

.latin-name-text,
.field-name-latinname input,
[class*="field-name-latin"] input {
  font-style: italic;
}

.data-table th {
  position: sticky;
  top: 0;
  background: #f7faf7;
  color: #294537;
  font-size: 13px;
  letter-spacing: 0.02em;
  z-index: 1;
}

.data-table tbody tr:hover {
  background: #f7faf7;
}

.muted {
  color: var(--muted);
}

.status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
}

.status.success {
  background: rgba(22, 163, 74, 0.12);
  color: #166534;
}

.status.amended {
  background: rgba(14, 165, 233, 0.12);
  color: #0369a1;
}

.status.warning {
  background: rgba(245, 158, 11, 0.14);
  color: #92400e;
}

.status.neutral {
  background: rgba(100, 116, 139, 0.12);
  color: #475569;
}

.row-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: nowrap;
  min-height: 34px;
}

.row-actions:empty {
  min-height: 34px;
}

.table-action-button {
  height: 34px;
  min-width: 64px;
  padding: 0 12px;
  border-radius: 6px;
  line-height: 34px;
  white-space: nowrap;
  box-shadow: none;
}

.icon-action-btn {
  width: 34px;
  height: 34px;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #fff;
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.08);
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.icon-action-btn svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
  pointer-events: none;
}

.icon-action-btn--edit {
  color: var(--brand);
  border-color: rgba(23, 107, 77, 0.24);
  background: linear-gradient(180deg, #ffffff, #f1f7f2);
}

.icon-action-btn--delete {
  color: #dc2626;
  border-color: rgba(220, 38, 38, 0.25);
  background: linear-gradient(180deg, #ffffff, #fef2f2);
}

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

.icon-action-btn--edit:hover {
  background: #e3f0e7;
  box-shadow: 0 6px 16px rgba(23, 107, 77, 0.22);
}

.icon-action-btn--delete:hover {
  background: #fee2e2;
  box-shadow: 0 6px 16px rgba(220, 38, 38, 0.24);
}

.icon-action-btn:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
}

.icon-action-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 14px;
}

.pagination .pages {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.page-btn {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--text);
  min-width: 40px;
  min-height: 40px;
  padding: 0 12px;
  border-radius: 6px;
}

.page-btn.active {
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  color: #fff;
  border-color: transparent;
}

.page-btn:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}

.page-size {
  min-width: 120px;
}

.empty {
  text-align: center;
  color: var(--muted);
  padding: 36px 12px;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.52);
  display: grid;
  place-items: center;
  padding: 18px;
  overflow-y: auto;
  z-index: 50;
}

.modal {
  width: min(1180px, 100%);
  max-height: min(92vh, 1100px);
  overflow: hidden;
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 24px 70px rgba(19, 32, 24, 0.22);
  display: flex;
  flex-direction: column;
}

.modal form[data-form] {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: 0;
}

.modal-head {
  padding: 18px 22px;
  border-bottom: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}

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

.modal-body {
  padding: 20px 22px 8px;
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
}

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

.modal-tabs {
  display: grid;
  gap: 10px;
  align-content: start;
}

.tab-btn {
  border: 1px solid #d6e4f3;
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(246, 251, 255, 0.98));
  color: #334155;
  padding: 11px 12px;
  min-height: 56px;
  width: 100%;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 10px;
  font-weight: 600;
  text-align: left;
  box-shadow: 0 10px 20px rgba(15, 23, 42, 0.05);
}

.tab-step {
  width: 26px;
  height: 26px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 800;
  background: rgba(23, 107, 77, 0.1);
  color: var(--brand);
}

.tab-copy {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.tab-label {
  font-size: 14px;
  font-weight: 700;
  line-height: 1.15;
}

.tab-copy small {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.2;
}

.tab-btn.active {
  border-color: rgba(23, 107, 77, 0.34);
  color: #fff;
  background:
    radial-gradient(circle at 10% 0%, rgba(255, 255, 255, 0.22), transparent 44%),
    linear-gradient(140deg, var(--brand), var(--brand-2) 56%, #8ca85c);
  box-shadow: 0 14px 26px rgba(23, 107, 77, 0.24);
}

.tab-btn.active .tab-step {
  background: rgba(255, 255, 255, 0.22);
  color: #fff;
}

.tab-btn.active .tab-copy small {
  color: rgba(255, 255, 255, 0.85);
}

.tab-btn.has-error:not(.active) {
  border-color: rgba(220, 38, 38, 0.36);
  color: #b91c1c;
}

.tab-error-badge {
  min-width: 18px;
  height: 18px;
  border-radius: 999px;
  padding: 0 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  background: rgba(220, 38, 38, 0.12);
  color: #b91c1c;
}

.tab-btn.active .tab-error-badge {
  background: rgba(255, 255, 255, 0.2);
  color: #fff;
}

.modal-form--tabs {
  width: min(1240px, 100%);
}

.modal-body--tabs {
  display: grid;
  grid-template-columns: minmax(230px, 250px) minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}

.tab-panels {
  display: grid;
}

.tab-pane {
  display: none;
}

.tab-pane.active {
  display: block;
}

.tab-pane-shell {
  border: 1px solid #d9e6f3;
  border-radius: 8px;
  padding: 14px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.99), rgba(249, 252, 249, 0.97));
  box-shadow: 0 12px 28px rgba(31, 59, 45, 0.065);
}

.tab-pane-head {
  margin-bottom: 12px;
  padding: 0 2px;
}

.tab-pane-head h4 {
  margin: 0;
  font-size: 18px;
}

.tab-pane-head p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.species-image-shell {
  display: grid;
  gap: 14px;
}

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

.species-image-card {
  border: 1px solid #d9e6f3;
  border-radius: 8px;
  padding: 14px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(249, 252, 255, 0.98));
  display: grid;
  gap: 12px;
}

.species-image-card h5 {
  margin: 0;
  font-size: 15px;
  color: var(--text);
}

.species-image-preview {
  min-height: 220px;
  border: 1px dashed #c6d7ea;
  border-radius: 14px;
  background: #f8fbff;
  display: grid;
  place-items: center;
  overflow: hidden;
}

.species-image-preview img {
  width: 100%;
  height: 100%;
  max-height: 320px;
  object-fit: contain;
  display: block;
}

.species-image-placeholder {
  color: var(--muted);
  font-size: 13px;
}

.species-image-meta {
  display: grid;
  gap: 6px;
}

.species-image-tip {
  font-size: 13px;
  line-height: 1.45;
}

.species-image-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.species-image-note {
  border: 1px dashed #c6d7ea;
  border-radius: 14px;
  padding: 20px;
  background: #f8fbff;
}

.modal-footer {
  padding: 18px 22px 22px;
  border-top: 1px solid var(--line);
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}

.toast {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 80;
  min-width: 260px;
  max-width: min(420px, calc(100vw - 40px));
  padding: 14px 16px;
  border-radius: 16px;
  color: #fff;
  box-shadow: 0 22px 60px rgba(15, 23, 42, 0.22);
  animation: toast-in 0.24s ease;
}

.toast.success {
  background: linear-gradient(135deg, var(--success), #22c55e);
}

.toast.error {
  background: linear-gradient(135deg, #dc2626, #ef4444);
}

.toast.info {
  background: linear-gradient(135deg, #334155, #64748b);
}

@keyframes toast-in {
  from {
    transform: translateY(10px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.login-wrap {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
}

.login-hero {
  padding: 40px;
  color: #fff;
  background:
    radial-gradient(circle at top right, rgba(255, 255, 255, 0.18), transparent 24%),
    radial-gradient(circle at bottom left, rgba(151, 196, 106, 0.18), transparent 24%),
    linear-gradient(135deg, #13271d 0%, #1f4930 52%, #176b4d 100%);
  display: grid;
  align-content: end;
  gap: 22px;
  position: relative;
  overflow: hidden;
}

.login-hero::after {
  content: "";
  position: absolute;
  width: 360px;
  height: 360px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  right: -120px;
  top: -100px;
  filter: blur(8px);
}

.login-hero .eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  width: fit-content;
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.login-hero h1 {
  margin: 0;
  font-size: clamp(38px, 4vw, 58px);
  line-height: 1;
  max-width: 10ch;
}

.login-hero p {
  margin: 0;
  max-width: 56ch;
  color: rgba(255, 255, 255, 0.82);
  line-height: 1.7;
}

.login-panel {
  display: grid;
  place-items: center;
  padding: 24px;
}

.login-card {
  width: min(460px, 100%);
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  border-radius: 18px;
  padding: 34px;
}

.login-card h2 {
  margin: 0 0 8px;
  font-size: 30px;
}

.login-card p {
  margin: 0 0 18px;
  color: var(--muted);
}

.login-form {
  display: grid;
  gap: 14px;
}

.helper {
  font-size: 13px;
  color: var(--muted);
  line-height: 1.6;
}

.alert {
  padding: 12px 14px;
  border-radius: 14px;
  font-size: 14px;
}

.alert.info {
  background: rgba(23, 107, 77, 0.08);
  color: var(--brand);
}

.status.danger {
  background: rgba(239, 68, 68, 0.14);
  color: #b91c1c;
}

.stat-hint {
  margin-top: 8px;
  line-height: 1.5;
  font-size: 12px;
}

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

.insight-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.card .insight-grid .stat {
  background: #ffffff;
  min-height: 128px;
}

.bar-list {
  display: grid;
  gap: 16px;
}

.bar-item {
  display: grid;
  gap: 9px;
}

.bar-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: 14px;
  color: #26382d;
}

.bar-head strong {
  font-weight: 700;
}

.bar-track {
  height: 10px;
  border-radius: 999px;
  background: #e4ece5;
  overflow: hidden;
  box-shadow: inset 0 1px 2px rgba(19, 32, 24, 0.08);
}

.bar-fill {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--brand), #8ca85c);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.34) inset;
}

.map-layout {
  display: grid;
  grid-template-columns: minmax(0, 3.1fr) minmax(300px, 0.9fr);
  gap: 16px;
  align-items: stretch;
}

.map-search-panel {
  background: #fff;
  border-color: var(--line-strong);
}

.map-filter-head {
  padding: 0 0 14px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 14px;
}

.map-search-form {
  grid-template-columns: minmax(180px, 1.3fr) repeat(4, minmax(132px, 0.8fr)) auto;
  align-items: end;
}

.map-search-form .search-actions {
  flex-wrap: nowrap;
}

.map-primary-card,
.map-side-card {
  min-width: 0;
}

.map-primary-card .card-body {
  padding: 0;
}

.map-primary-card .card-head {
  align-items: flex-start;
}

.map-side-card {
  display: flex;
  flex-direction: column;
}

.map-side-body {
  min-height: 0;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 18px;
  flex: 1 1 auto;
}

.map-side-section {
  min-width: 0;
}

.map-side-section--points {
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.map-section-label {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
  color: var(--text);
}

.map-section-label strong {
  font-size: 14px;
}

.map-section-label span {
  color: var(--muted);
  font-size: 12px;
}

.map-legend {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.map-legend .status::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
  flex: 0 0 auto;
}

.map-stage {
  min-height: clamp(600px, 66vh, 760px);
  border-radius: 0 0 8px 8px;
  overflow: hidden;
  background: #edf3ef;
  border: 0;
  border-top: 1px solid var(--line);
}

.map-svg {
  width: 100%;
  height: 100%;
  display: block;
}

.china-map-canvas {
  width: 100%;
  height: clamp(600px, 66vh, 760px);
  min-height: 600px;
  background: #edf3ef;
}

.map-fallback {
  min-height: 600px;
  display: grid;
  place-items: center;
  padding: 24px;
  color: var(--muted);
  text-align: center;
}

.map-fallback-note {
  padding: 12px 16px 0;
  color: var(--muted);
  text-align: center;
  font-size: 14px;
}

.map-point {
  stroke: rgba(255, 255, 255, 0.88);
  stroke-width: 2;
  opacity: 0.92;
}

.map-point.warning {
  fill: #f59e0b;
}

.map-point.success {
  fill: #16a34a;
}

.map-point.amended {
  fill: #0ea5e9;
}

.map-point.danger {
  fill: #ef4444;
}

.point-list {
  display: grid;
  gap: 8px;
  min-height: 0;
  max-height: 420px;
  overflow-y: auto;
  padding-right: 4px;
}

.province-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 0;
}

.province-item {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 9px 10px;
  border-radius: 6px;
  background: var(--surface-tint);
  border: 1px solid var(--line);
}

.point-item {
  display: grid;
  grid-template-columns: 1fr;
  align-items: start;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
}

.point-main {
  min-width: 0;
}

.point-item p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.point-meta {
  width: 100%;
  justify-self: stretch;
  display: flex;
  align-items: center;
  gap: 8px 12px;
  flex-wrap: wrap;
  font-size: 12px;
}

.point-meta .status {
  min-width: 72px;
  justify-content: center;
}

.point-meta .muted {
  white-space: nowrap;
}

.review-modal {
  width: min(1080px, 100%);
}

.review-sheet {
  display: grid;
  gap: 18px;
}

.review-tab-switch {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #eef4fb;
}

.review-tab-btn {
  border: 0;
  background: transparent;
  color: var(--muted);
  padding: 10px 16px;
  border-radius: 12px;
  font-weight: 700;
}

.review-tab-btn.active {
  color: #fff;
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  box-shadow: 0 8px 18px rgba(23, 107, 77, 0.22);
}

.review-tab-pane {
  display: none;
  gap: 18px;
}

.review-tab-pane.active {
  display: grid;
}

.review-species-sheet {
  display: grid;
  gap: 14px;
}

.review-species-tip {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #f8fbff;
  color: var(--muted);
  padding: 10px 12px;
  font-size: 13px;
}

.review-species-tip.error {
  border-color: rgba(220, 38, 38, 0.22);
  background: rgba(254, 242, 242, 0.95);
  color: #b91c1c;
}

.review-species-head {
  display: grid;
  grid-template-columns: minmax(240px, 320px) minmax(0, 1fr);
  gap: 12px;
  align-items: start;
}

.review-species-image-card {
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #fff;
  padding: 12px;
  display: grid;
  gap: 8px;
}

.review-species-image-preview {
  min-height: 220px;
  border: 1px dashed #c6d7ea;
  border-radius: 12px;
  background: #f8fbff;
  overflow: hidden;
  display: grid;
  place-items: center;
}

.review-species-image-preview img {
  width: 100%;
  height: 100%;
  max-height: 320px;
  object-fit: contain;
}

.review-species-image-empty {
  color: var(--muted);
  font-size: 13px;
}

.review-species-image-meta {
  font-size: 12px;
}

.review-basic-divider {
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(148, 163, 184, 0.6), transparent);
}

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

.review-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fbff;
  padding: 16px;
}

.review-card .label {
  color: var(--muted);
  font-size: 12px;
  margin-bottom: 8px;
}

.review-card .value {
  font-size: 16px;
  font-weight: 700;
}

.review-info-section {
  display: grid;
  gap: 12px;
}

.review-detail-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
}

.review-basic-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.review-detail-item {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 12px 14px;
  display: grid;
  gap: 8px;
}

.review-detail-item.span-all {
  grid-column: 1 / -1;
}

.review-location-grid {
  grid-template-columns: repeat(6, minmax(0, 1fr));
}

.review-location-grid .loc-province,
.review-location-grid .loc-city,
.review-location-grid .loc-county {
  grid-column: span 2;
}

.review-location-grid .loc-longitude,
.review-location-grid .loc-latitude {
  grid-column: span 3;
}

.review-location-grid .loc-address {
  grid-column: 1 / -1;
}

.review-detail-item .label {
  color: var(--muted);
  font-size: 12px;
  margin: 0;
}

.review-detail-item .value {
  color: #10233f;
  font-size: 14px;
  line-height: 1.45;
  font-weight: 600;
  white-space: pre-wrap;
  word-break: break-word;
}

.review-edit-field {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 12px 14px;
  display: grid;
  gap: 8px;
}

.review-edit-field.span-all {
  grid-column: 1 / -1;
}

.review-edit-field label {
  color: var(--muted);
  font-size: 12px;
  margin: 0;
  font-weight: 600;
}

.review-edit-field input,
.review-edit-field textarea {
  border-radius: 6px;
  padding: 10px 12px;
  background: #f9fbff;
}

.review-edit-field textarea {
  min-height: 96px;
}

.review-comment-field {
  grid-column: 1 / -1;
}

.review-decision-grid {
  grid-template-columns: minmax(520px, max-content) minmax(240px, 1fr);
  align-items: end;
}

.review-status-field {
  min-width: 0;
}

.review-status-field--full {
  grid-column: 1 / -1;
}

.review-push-field {
  align-self: end;
  justify-self: end;
  min-width: 240px;
  max-width: 100%;
}

.review-push-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 2px;
  color: var(--text);
  font-weight: 600;
}

.review-push-toggle input {
  width: 16px;
  height: 16px;
  margin: 0;
}

.review-push-status {
  min-height: 44px;
  display: flex;
  align-items: center;
}

.review-switch {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  width: min(100%, 560px);
  padding: 6px;
  border-radius: 16px;
  background: #eef4fb;
  border: 1px solid var(--line);
}

.switch-option {
  border: 0;
  background: transparent;
  color: var(--muted);
  padding: 12px 18px;
  border-radius: 12px;
  font-weight: 700;
  white-space: nowrap;
}

@media (max-width: 820px) {
  .review-decision-grid {
    grid-template-columns: 1fr;
  }

  .review-push-field {
    justify-self: stretch;
  }
}

.switch-option.active {
  color: #fff;
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  box-shadow: 0 8px 18px rgba(23, 107, 77, 0.22);
}

.required-tag {
  display: inline-flex;
  margin-left: 8px;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 12px;
  color: #b91c1c;
  background: rgba(239, 68, 68, 0.12);
}

.auth-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.auth-card {
  width: min(1120px, 100%);
  display: grid;
  grid-template-columns: 1.35fr 0.65fr;
  gap: 24px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow-soft);
  padding: 32px;
  margin: 0 auto;
  align-items: center;
}

.auth-copy h1 {
  margin: 16px 0 10px;
  font-size: clamp(30px, 4vw, 48px);
  line-height: 1.1;
  white-space: nowrap;
}

.auth-copy p {
  margin: 0;
  color: var(--muted);
  max-width: 520px;
}

.auth-form {
  display: grid;
  gap: 14px;
  align-self: center;
}

.auth-button {
  width: 100%;
}

.review-media-section,
.review-history {
  display: grid;
  gap: 12px;
}

.section-title {
  font-size: 14px;
  font-weight: 700;
  color: #334155;
}

.review-media-grid {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 14px;
}

.media-card {
  display: grid;
  gap: 8px;
  padding: 12px;
  width: fit-content;
  max-width: min(100%, 420px);
  border-radius: 8px;
  border: 1px solid var(--line);
  background: #fff;
}

.media-card-empty {
  min-width: 220px;
}

.media-card img,
.media-card video {
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: 260px;
  object-fit: contain;
  border-radius: 12px;
  background: #e5eef8;
  display: block;
}

.media-card span {
  color: var(--muted);
  font-size: 13px;
  word-break: break-all;
}

.history-item {
  display: grid;
  grid-template-columns: 160px 1fr;
  gap: 12px;
  padding: 14px 16px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: #fff;
}

.history-item p {
  margin: 6px 0 0;
  color: var(--muted);
}

.province-item {
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 6px;
  padding: 9px 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  text-align: left;
}

.province-item.active {
  border-color: rgba(23, 107, 77, 0.34);
  background: rgba(23, 107, 77, 0.08);
}

.spinner {
  width: 18px;
  height: 18px;
  border: 2px solid rgba(255, 255, 255, 0.35);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

@media (max-width: 980px) {
  .map-search-form {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .map-search-form .search-actions {
    grid-column: 1 / -1;
  }

  .map-layout {
    grid-template-columns: 1fr;
  }

  .map-side-body {
    grid-template-columns: minmax(260px, 0.8fr) minmax(0, 1.2fr);
    grid-template-rows: auto;
  }
}

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

  .auth-card {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
    min-height: auto;
    border-right: 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    gap: 12px;
  }

  .brand {
    padding-bottom: 12px;
  }

  .nav {
    grid-template-columns: repeat(auto-fit, minmax(138px, 1fr));
  }

  .nav-section {
    grid-column: 1 / -1;
  }

  .sidebar-footer {
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    padding-top: 12px;
  }

  .modal-body--tabs {
    grid-template-columns: 1fr;
  }

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

  .species-image-grid {
    grid-template-columns: 1fr;
  }

}

@media (max-width: 760px) {
  .main {
    padding: 12px;
  }

  .sidebar {
    padding: 14px 12px;
  }

  .brand h1 {
    white-space: normal;
  }

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

  .nav-item {
    padding: 9px 10px;
  }

  .map-search-form {
    grid-template-columns: 1fr;
  }

  .map-search-form .search-actions {
    grid-column: auto;
  }

  .map-filter-head {
    align-items: stretch;
    flex-direction: column;
  }

  .map-filter-head .primary-button {
    width: 100%;
  }

  .map-side-body {
    grid-template-columns: 1fr;
  }

  .map-stage,
  .china-map-canvas {
    height: 480px;
    min-height: 480px;
  }

  .map-fallback {
    min-height: 480px;
  }

  .sidebar-footer {
    grid-template-columns: 1fr;
  }

  .topbar,
  .card-head,
  .card-body,
  .modal-head,
  .modal-body,
  .modal-footer,
  .search-panel {
    padding-left: 14px;
    padding-right: 14px;
  }

  .hero h3 {
    font-size: 26px;
  }

  .hero-grid {
    grid-template-columns: 1fr;
  }

  .split-grid,
  .map-layout,
  .insight-grid,
  .review-grid,
  .review-detail-grid {
    grid-template-columns: 1fr;
  }

  .point-item {
    grid-template-columns: 1fr;
  }

  .point-meta {
    width: 100%;
    justify-self: stretch;
  }

  .review-location-grid .loc-province,
  .review-location-grid .loc-city,
  .review-location-grid .loc-county,
  .review-location-grid .loc-longitude,
  .review-location-grid .loc-latitude,
  .review-location-grid .loc-address {
    grid-column: auto;
  }

  .review-tab-switch {
    display: grid;
    grid-template-columns: 1fr;
  }

  .review-species-head {
    grid-template-columns: 1fr;
  }

  .modal-grid,
  .modal-tabs {
    grid-template-columns: 1fr;
  }

  .species-image-grid {
    grid-template-columns: 1fr;
  }

  .modal-field.field-span-2 {
    grid-column: auto;
  }

  .tab-btn {
    min-height: 52px;
  }

  .login-panel,
  .login-hero {
    padding: 18px;
  }
}
