:root {
  --bg: #eef3f1;
  --surface: #ffffff;
  --surface-soft: #f6faf9;
  --line: #dbe5e2;
  --text: #101b17;
  --muted: #697873;
  --brand: #d2a24c;
  --brand-dark: #7a5219;
  --accent: #0f8b7d;
  --accent-soft: #e5f6f2;
  --cyan: #47c7d8;
  --sidebar: #0d1b18;
  --danger: #b73525;
  --shadow: 0 22px 60px rgba(13, 27, 24, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  color: var(--text);
  background:
    linear-gradient(90deg, rgba(15, 139, 125, 0.045) 1px, transparent 1px),
    linear-gradient(0deg, rgba(15, 139, 125, 0.04) 1px, transparent 1px),
    linear-gradient(135deg, #f8fbfa, var(--bg));
  background-size: 28px 28px, 28px 28px, auto;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
}

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

.login-page {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 28px;
  background:
    linear-gradient(90deg, rgba(15, 139, 125, 0.075) 1px, transparent 1px),
    linear-gradient(0deg, rgba(15, 139, 125, 0.06) 1px, transparent 1px),
    linear-gradient(135deg, #edf5f2, #f8f4eb);
  background-size: 32px 32px, 32px 32px, auto;
}

.login-page::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(115deg, transparent 0 46%, rgba(255, 255, 255, 0.42) 46.2% 46.4%, transparent 46.6% 100%),
    linear-gradient(155deg, transparent 0 58%, rgba(15, 139, 125, 0.14) 58.2% 58.4%, transparent 58.6% 100%);
}

.login-shell {
  position: relative;
  width: min(920px, 100%);
  min-height: 560px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 410px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.86);
  border-radius: 24px;
  background: var(--surface);
  box-shadow: 0 32px 90px rgba(13, 27, 24, 0.18);
}

.login-visual {
  position: relative;
  min-height: 100%;
  overflow: hidden;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.12), transparent 42%),
    repeating-linear-gradient(135deg, rgba(255, 255, 255, 0.08) 0 1px, transparent 1px 20px),
    linear-gradient(135deg, #0d1b18, #0f6e66 58%, #d2a24c);
}

.login-visual::before,
.login-visual::after {
  content: "";
  position: absolute;
  inset: auto 44px 54px 44px;
  height: 1px;
  background: rgba(255, 255, 255, 0.35);
}

.login-visual::after {
  inset: 54px 44px auto 44px;
}

.login-emblem {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 148px;
  height: 148px;
  transform: translate(-50%, -50%);
  border: 1px solid rgba(255, 255, 255, 0.5);
  border-radius: 34px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.5), transparent 52%),
    rgba(255, 255, 255, 0.12);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.16);
}

.login-emblem::before {
  content: "";
  position: absolute;
  inset: 32px;
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.72);
}

.login-emblem::after {
  content: "";
  position: absolute;
  inset: 54px;
  border-radius: 12px;
  background: var(--brand);
}

.login-signal {
  position: absolute;
  right: 34px;
  bottom: 34px;
  display: grid;
  gap: 8px;
  width: 132px;
}

.login-signal i {
  display: block;
  height: 3px;
  border-radius: 999px;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.85));
}

.login-signal i:nth-child(2) {
  width: 76%;
  margin-left: auto;
}

.login-signal i:nth-child(3) {
  width: 54%;
  margin-left: auto;
}

.login-card {
  position: relative;
  width: 100%;
  align-self: center;
  padding: 52px 44px;
  border: 0;
  border-radius: 0;
  background: var(--surface);
  box-shadow: none;
}

.login-card::before {
  content: "";
  position: absolute;
  left: 44px;
  right: 44px;
  top: 0;
  height: 3px;
  border-radius: 0 0 999px 999px;
  background: linear-gradient(90deg, var(--accent), var(--cyan), var(--brand));
}

.login-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 34px;
}

.login-mark {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.55), transparent 55%),
    linear-gradient(135deg, var(--brand), var(--accent));
  box-shadow: 0 12px 24px rgba(29, 111, 102, 0.16);
}

.login-card h1 {
  margin: 0;
  font-size: 28px;
  line-height: 1.2;
  font-weight: 900;
}

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

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 22px 14px;
  overflow-y: auto;
  background:
    linear-gradient(180deg, rgba(71, 199, 216, 0.08), transparent 28%),
    linear-gradient(135deg, #0d1b18, #132923);
  color: #fff;
  scrollbar-width: none;
}

.sidebar::-webkit-scrollbar {
  display: none;
}

.brand {
  margin: 0 6px 18px;
  padding: 13px 12px 18px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
  color: #f7fbfa;
  font-size: 24px;
  font-weight: 900;
  line-height: 1.25;
}

.nav-link {
  display: block;
  margin-bottom: 6px;
  padding: 11px 13px;
  border-radius: 10px;
  color: rgba(255, 255, 255, 0.70);
  font-size: 14px;
  font-weight: 700;
}

.nav-link.active,
.nav-link:hover {
  background: rgba(255, 255, 255, 0.10);
  color: #fff;
}

.nav-link.active {
  box-shadow:
    inset 3px 0 0 var(--cyan),
    0 10px 24px rgba(0, 0, 0, 0.12);
}

.main {
  min-width: 0;
  padding: 28px 34px 56px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 22px;
}

.topbar h1 {
  margin: 0;
  font-size: 26px;
  line-height: 1.25;
  letter-spacing: 0;
}

.logout {
  padding: 9px 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  color: var(--muted);
  cursor: pointer;
  font: inherit;
  font-weight: 800;
}

.logout:hover {
  color: var(--text);
  border-color: #cad4d1;
}

.logout-form {
  margin: 0;
}

.panel {
  position: relative;
  margin-bottom: 20px;
  padding: 22px;
  border: 1px solid rgba(219, 229, 226, 0.9);
  border-radius: 14px;
  background: var(--surface);
  box-shadow: 0 14px 36px rgba(28, 40, 35, 0.055);
}

.panel h2 {
  margin: 0 0 18px;
  font-size: 18px;
}

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

.stat {
  position: relative;
  overflow: hidden;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
}

.stat::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  width: 4px;
  height: 100%;
  background: linear-gradient(180deg, var(--accent), var(--cyan), var(--brand));
}

.stat strong {
  display: block;
  margin-bottom: 4px;
  color: #08796d;
  font-size: 30px;
  line-height: 1;
}

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

.table-wrap {
  overflow-x: auto;
  padding: 0;
}

table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 14px;
}

th,
td {
  padding: 13px 14px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: middle;
}

th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #f4faf8;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  white-space: nowrap;
}

tbody tr:hover {
  background: #f8fcfb;
}

tbody tr:last-child td {
  border-bottom: 0;
}

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

.btn,
button.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  padding: 9px 15px;
  border: 0;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--brand), #e0b96b);
  color: #1f1609;
  font-weight: 900;
  cursor: pointer;
  transition: transform .15s ease, box-shadow .15s ease, background .15s ease;
}

.btn:hover,
button.btn:hover {
  background: linear-gradient(135deg, #dcad58, #e7c477);
  box-shadow: 0 10px 22px rgba(201, 149, 63, 0.22);
  transform: translateY(-1px);
}

.btn.muted {
  background: #eef3f1;
  color: #495650;
}

.btn.muted:hover {
  background: #e3ebe8;
  box-shadow: none;
}

.btn.danger {
  background: #fff0ed;
  color: var(--danger);
}

.btn.danger:hover {
  background: #ffe4df;
  box-shadow: none;
}

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

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

label {
  display: block;
  margin-bottom: 7px;
  color: #4f5a55;
  font-size: 13px;
  font-weight: 900;
}

input,
select,
textarea {
  width: 100%;
  min-height: 42px;
  padding: 10px 12px;
  border: 1px solid #d7dfdc;
  border-radius: 10px;
  outline: none;
  background: #fff;
  color: var(--text);
  font: inherit;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(29, 111, 102, 0.12);
}

input[readonly] {
  background: #f3f6f5;
  color: var(--muted);
}

textarea {
  min-height: 118px;
  resize: vertical;
}

.image-input-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 118px;
  gap: 10px;
  align-items: stretch;
}

.file-picker {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  margin: 0;
  border-radius: 10px;
  background: #10251f;
  color: #ffffff;
  cursor: pointer;
}

.file-picker input {
  display: none;
}

.field-help {
  margin-top: 7px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.image-preview {
  display: block;
  max-width: 260px;
  max-height: 150px;
  margin-top: 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  object-fit: cover;
  background: #f5f8f7;
}

.form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
}

.login-card .form-actions {
  margin-top: 24px;
}

.login-card .btn {
  width: 100%;
  min-height: 44px;
}

.notice {
  margin-bottom: 18px;
  padding: 12px 14px;
  border: 1px solid #f1ddba;
  border-radius: 10px;
  background: #fff9ed;
  color: var(--brand-dark);
  font-weight: 800;
}

.ops-panel {
  border-color: rgba(15, 139, 125, 0.18);
  background:
    linear-gradient(90deg, rgba(15, 139, 125, 0.08), transparent 36%),
    var(--surface);
}

.ops-panel h2 {
  color: #0f5f58;
}

.ops-panel p {
  margin: 0;
  color: var(--muted);
  line-height: 1.8;
}

.badge {
  display: inline-flex;
  padding: 5px 9px;
  border-radius: 999px;
  background: #eef3f1;
  color: #4f5a55;
  font-size: 12px;
  font-weight: 900;
  white-space: nowrap;
}

.badge.green {
  background: #e6f6ef;
  color: #16734d;
}

.badge.red {
  background: #fff0ed;
  color: var(--danger);
}

code {
  padding: 2px 6px;
  border-radius: 6px;
  background: #eef3f1;
  color: #28433b;
}

@media (max-width: 980px) {
  .layout {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
    height: auto;
    display: flex;
    gap: 6px;
    overflow-x: auto;
    padding: 14px;
  }

  .brand {
    flex: 0 0 auto;
    margin: 0 12px 0 0;
    padding: 9px 12px;
    border: 0;
    font-size: 18px;
  }

  .nav-link {
    flex: 0 0 auto;
    margin: 0;
    white-space: nowrap;
  }

  .main {
    padding: 22px 18px 42px;
  }

  .stats,
  .form-grid {
    grid-template-columns: 1fr;
  }

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

  .topbar {
    align-items: flex-start;
  }

  .login-shell {
    grid-template-columns: 1fr;
    min-height: auto;
    max-width: 430px;
  }

  .login-visual {
    min-height: 150px;
  }

  .login-emblem {
    left: 42px;
    top: 50%;
    width: 84px;
    height: 84px;
    transform: translateY(-50%);
    border-radius: 22px;
  }

  .login-emblem::before {
    inset: 20px;
    border-radius: 14px;
  }

  .login-emblem::after {
    inset: 34px;
    border-radius: 8px;
  }

  .login-signal {
    right: 28px;
    bottom: 34px;
    width: 112px;
  }
}

@media (max-width: 560px) {
  .login-page {
    padding: 18px;
  }

  .login-card {
    padding: 34px 26px;
  }

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

  .panel {
    padding: 18px;
  }

  th,
  td {
    padding: 11px 12px;
  }
}
