:root {
  --ink: #132827;
  --muted: #70807d;
  --line: #e3e9e6;
  --paper: #f4f6f2;
  --white: #ffffff;
  --brand: #147d71;
  --brand-dark: #0d4c46;
  --brand-soft: #e6f2ef;
  --accent: #ef8d4a;
  --accent-soft: #fff0e5;
  --danger: #c94c47;
  --danger-soft: #fdecea;
  --warning: #b97616;
  --warning-soft: #fff4d8;
  --shadow: 0 18px 50px rgba(24, 55, 52, 0.08);
  --radius: 20px;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  background: var(--paper);
  color: var(--ink);
  font-family: "PingFang SC", "Microsoft YaHei", "Noto Sans CJK SC", sans-serif;
  -webkit-font-smoothing: antialiased;
}

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

button {
  color: inherit;
}

[hidden] {
  display: none !important;
}

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

.eyebrow {
  margin: 0 0 12px;
  color: var(--accent);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.2em;
}

.brand-mark {
  display: grid;
  width: 68px;
  height: 68px;
  place-items: center;
  border-radius: 22px;
  background: var(--accent);
  color: #fff;
  font-family: Georgia, serif;
  font-size: 36px;
  font-weight: 800;
  box-shadow: 0 12px 30px rgba(239, 141, 74, 0.3);
}

.brand-mark.small {
  width: 42px;
  height: 42px;
  border-radius: 13px;
  font-size: 23px;
  box-shadow: none;
}

.login-view {
  display: grid;
  min-height: 100vh;
  grid-template-columns: minmax(400px, 1.08fr) minmax(420px, 0.92fr);
}

.login-art {
  position: relative;
  display: flex;
  min-height: 100vh;
  flex-direction: column;
  justify-content: space-between;
  overflow: hidden;
  padding: 64px 72px;
  background:
    radial-gradient(circle at 78% 32%, rgba(94, 177, 162, 0.38), transparent 28%),
    linear-gradient(145deg, #0d332f 0%, #102b2a 52%, #1d3e39 100%);
  color: #fff;
}

.login-art::before,
.login-art::after {
  position: absolute;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 50%;
  content: "";
}

.login-art::before {
  width: 480px;
  height: 480px;
  right: -170px;
  bottom: 8%;
}

.login-art::after {
  width: 300px;
  height: 300px;
  right: -80px;
  bottom: 20%;
  background: rgba(255, 255, 255, 0.025);
}

.login-art-copy {
  position: relative;
  z-index: 1;
  max-width: 560px;
}

.login-art-copy h1 {
  margin: 0 0 24px;
  font-family: "Songti SC", "STSong", serif;
  font-size: clamp(42px, 5.3vw, 76px);
  font-weight: 600;
  letter-spacing: -0.05em;
  line-height: 1.15;
}

.login-art-copy > p:last-child {
  color: rgba(255, 255, 255, 0.68);
  font-size: 17px;
}

.login-art-number {
  position: absolute;
  right: 54px;
  bottom: 30px;
  color: rgba(255, 255, 255, 0.06);
  font-family: Georgia, serif;
  font-size: 170px;
  font-weight: 800;
  line-height: 1;
}

.login-panel {
  display: grid;
  place-items: center;
  padding: 56px;
  background: #fafbf8;
}

.login-form {
  width: min(390px, 100%);
}

.login-form h2 {
  margin: 0;
  font-family: "Songti SC", "STSong", serif;
  font-size: 34px;
  font-weight: 700;
}

.login-form > .muted {
  margin: 10px 0 34px;
  font-size: 14px;
}

.login-form label {
  display: block;
  margin: 0 0 20px;
}

.login-form label span,
.field label {
  display: block;
  margin-bottom: 8px;
  color: #4d615d;
  font-size: 13px;
  font-weight: 700;
}

.login-form input,
.field input,
.field select,
.field textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  outline: none;
  padding: 13px 14px;
  transition: 160ms ease;
}

.login-form input:focus,
.field input:focus,
.field select:focus,
.field textarea:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(20, 125, 113, 0.1);
}

.button {
  display: inline-flex;
  min-height: 40px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid transparent;
  border-radius: 11px;
  background: #fff;
  cursor: pointer;
  padding: 8px 15px;
  font-size: 13px;
  font-weight: 700;
  transition: 160ms ease;
}

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

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

.button.primary:hover {
  background: var(--brand-dark);
}

.button.secondary {
  border-color: var(--line);
}

.button.danger {
  border-color: #f1c2bf;
  background: var(--danger-soft);
  color: var(--danger);
}

.button.small {
  min-height: 32px;
  border-radius: 8px;
  padding: 5px 10px;
  font-size: 12px;
}

.login-submit {
  width: 100%;
  justify-content: space-between;
  margin-top: 8px;
  padding: 15px 18px;
}

.form-error {
  margin: -4px 0 14px;
  color: var(--danger);
  font-size: 13px;
}

.login-note {
  margin-top: 26px;
  border-top: 1px solid var(--line);
  color: #93a09d;
  padding-top: 18px;
  font-size: 12px;
  text-align: center;
}

.mobile-brand {
  display: none;
}

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

.sidebar {
  position: sticky;
  top: 0;
  display: flex;
  height: 100vh;
  flex-direction: column;
  background: #102a28;
  color: #fff;
  padding: 26px 18px 18px;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 8px 30px;
}

.sidebar-brand div {
  display: flex;
  flex-direction: column;
}

.sidebar-brand strong {
  font-size: 17px;
}

.sidebar-brand small {
  margin-top: 3px;
  color: rgba(255, 255, 255, 0.48);
  font-size: 11px;
}

.nav-list {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 7px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 13px;
  width: 100%;
  border: 0;
  border-radius: 12px;
  background: transparent;
  color: rgba(255, 255, 255, 0.62);
  cursor: pointer;
  padding: 12px 14px;
  text-align: left;
}

.nav-item i {
  display: grid;
  width: 22px;
  place-items: center;
  font-style: normal;
  font-size: 17px;
}

.nav-item:hover {
  background: rgba(255, 255, 255, 0.06);
  color: #fff;
}

.nav-item.active {
  background: var(--brand);
  color: #fff;
  box-shadow: 0 10px 25px rgba(20, 125, 113, 0.25);
}

.sidebar-footer {
  display: flex;
  align-items: center;
  gap: 10px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding: 18px 6px 0;
}

.admin-avatar {
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  border-radius: 50%;
  background: #d9b287;
  color: #fff;
  font-size: 13px;
  font-weight: 800;
}

.admin-meta {
  display: flex;
  min-width: 0;
  flex: 1;
  flex-direction: column;
}

.admin-meta strong {
  font-size: 13px;
}

.admin-meta small {
  margin-top: 3px;
  color: rgba(255, 255, 255, 0.45);
  font-size: 10px;
}

.icon-button {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: #fff;
  cursor: pointer;
  font-size: 18px;
}

.sidebar-footer .icon-button {
  border-color: rgba(255, 255, 255, 0.1);
  background: transparent;
  color: rgba(255, 255, 255, 0.62);
}

.main {
  min-width: 0;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 30px 38px 22px;
}

.breadcrumb {
  margin: 0 0 7px;
  color: #93a09d;
  font-size: 12px;
}

.topbar h1 {
  margin: 0;
  font-family: "Songti SC", "STSong", serif;
  font-size: 30px;
  font-weight: 700;
}

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

.date-chip {
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: var(--muted);
  padding: 9px 14px;
  font-size: 12px;
}

.mobile-menu {
  display: none;
}

.page-content {
  padding: 0 38px 48px;
}

.trial-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
  border: 1px solid #eedebf;
  border-radius: 14px;
  background: #fff8e9;
  color: #77571c;
  padding: 12px 16px;
  font-size: 13px;
}

.trial-banner strong {
  margin-right: 6px;
}

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

.stat-card {
  position: relative;
  min-height: 144px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  padding: 21px;
  box-shadow: 0 6px 22px rgba(24, 55, 52, 0.035);
}

.stat-card::after {
  position: absolute;
  width: 80px;
  height: 80px;
  right: -30px;
  bottom: -28px;
  border-radius: 50%;
  background: var(--brand-soft);
  content: "";
}

.stat-card.highlight {
  border-color: #184c45;
  background: #163e39;
  color: #fff;
}

.stat-card.highlight::after {
  background: rgba(255, 255, 255, 0.06);
}

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

.stat-card.highlight .stat-label,
.stat-card.highlight .stat-note {
  color: rgba(255, 255, 255, 0.62);
}

.stat-value {
  margin-top: 18px;
  font-family: Georgia, serif;
  font-size: 36px;
  font-weight: 700;
  line-height: 1;
}

.stat-note {
  margin-top: 10px;
  color: #94a29f;
  font-size: 11px;
}

.content-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(280px, 0.7fr);
  gap: 20px;
}

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

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  border-bottom: 1px solid var(--line);
  padding: 20px 22px;
}

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

.panel-header p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.panel-body {
  padding: 22px;
}

.quick-actions {
  display: grid;
  gap: 10px;
}

.quick-action {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: #fafbf9;
  cursor: pointer;
  padding: 15px;
  text-align: left;
}

.quick-action:hover {
  border-color: #9acbc3;
  background: var(--brand-soft);
}

.quick-action span:first-child {
  font-size: 13px;
  font-weight: 700;
}

.quick-action span:last-child {
  color: var(--brand);
}

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

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

.toolbar input,
.toolbar select {
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  outline: none;
  padding: 8px 12px;
  font-size: 13px;
}

.toolbar input {
  width: 240px;
}

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

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

th {
  background: #f8faf8;
  color: #85918f;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  padding: 12px 14px;
  text-align: left;
  white-space: nowrap;
}

td {
  border-top: 1px solid #edf0ee;
  padding: 15px 14px;
  vertical-align: middle;
}

tbody tr:hover {
  background: #fbfcfa;
}

.cell-main {
  color: var(--ink);
  font-weight: 700;
}

.cell-sub {
  margin-top: 4px;
  color: var(--muted);
  font-size: 11px;
}

.status {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  background: #eef2f0;
  color: #667572;
  padding: 5px 9px;
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
}

.status.green {
  background: var(--brand-soft);
  color: var(--brand);
}

.status.orange {
  background: var(--accent-soft);
  color: #b45e21;
}

.status.red {
  background: var(--danger-soft);
  color: var(--danger);
}

.status.yellow {
  background: var(--warning-soft);
  color: var(--warning);
}

.table-action {
  border: 0;
  background: transparent;
  color: var(--brand);
  cursor: pointer;
  font-size: 12px;
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 3px;
  white-space: nowrap;
}

.empty-state {
  padding: 56px 24px;
  color: var(--muted);
  text-align: center;
}

.empty-state strong {
  display: block;
  margin-bottom: 7px;
  color: var(--ink);
}

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

.model-card {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
}

.model-card-image {
  position: relative;
  height: 180px;
  overflow: hidden;
  background: linear-gradient(145deg, #edf4f1, #dbe8e4);
}

.model-card-image img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.model-card-image .status {
  position: absolute;
  top: 13px;
  left: 13px;
}

.model-card-body {
  padding: 18px;
}

.model-card-body h3 {
  margin: 0;
  font-size: 17px;
}

.model-card-body > p {
  min-height: 42px;
  margin: 8px 0 16px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.7;
}

.price-row {
  display: flex;
  flex-wrap: wrap;
  color: var(--muted);
  gap: 8px 12px;
  font-size: 11px;
}

.price-row strong {
  color: var(--ink);
  font-size: 13px;
}

.model-card-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 17px;
  border-top: 1px solid var(--line);
  padding-top: 14px;
}

.modal-backdrop {
  position: fixed;
  z-index: 30;
  inset: 0;
  display: grid;
  place-items: center;
  overflow-y: auto;
  background: rgba(8, 27, 25, 0.55);
  padding: 24px;
  backdrop-filter: blur(4px);
}

.modal {
  width: min(680px, 100%);
  max-height: calc(100vh - 48px);
  overflow-y: auto;
  border-radius: 22px;
  background: #fff;
  box-shadow: 0 30px 80px rgba(5, 22, 20, 0.22);
}

.modal.wide {
  width: min(900px, 100%);
}

.modal-header {
  position: sticky;
  z-index: 2;
  top: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
  background: #fff;
  padding: 18px 22px;
}

.modal-header h2 {
  margin: 0;
  font-family: "Songti SC", "STSong", serif;
  font-size: 22px;
}

.modal-body {
  padding: 22px;
}

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

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

.field label {
  display: block;
  margin-bottom: 7px;
  color: #4d615d;
  font-size: 12px;
  font-weight: 700;
}

.field textarea {
  min-height: 90px;
  resize: vertical;
}

.form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 22px;
}

.upload-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.upload-preview {
  display: grid;
  width: 88px;
  height: 64px;
  overflow: hidden;
  place-items: center;
  border: 1px dashed #cad5d1;
  border-radius: 10px;
  background: #f7faf8;
  color: var(--muted);
  font-size: 10px;
}

.upload-preview img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

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

.detail-list div {
  border-bottom: 1px solid #eef1ef;
  padding-bottom: 12px;
}

.detail-list dt {
  color: var(--muted);
  font-size: 11px;
}

.detail-list dd {
  margin: 5px 0 0;
  font-size: 13px;
  font-weight: 700;
}

.action-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  margin-top: 22px;
  border-top: 1px solid var(--line);
  padding-top: 18px;
}

.timeline {
  margin-top: 24px;
}

.timeline h3 {
  font-size: 14px;
}

.timeline-item {
  position: relative;
  margin-left: 7px;
  border-left: 1px solid #dce5e1;
  padding: 0 0 15px 19px;
}

.timeline-item::before {
  position: absolute;
  top: 4px;
  left: -4px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--brand);
  content: "";
}

.timeline-item p {
  margin: 0 0 4px;
  font-size: 12px;
}

.timeline-item small {
  color: var(--muted);
  font-size: 10px;
}

.toast {
  position: fixed;
  z-index: 50;
  right: 28px;
  bottom: 28px;
  max-width: 360px;
  border-radius: 11px;
  background: #173b37;
  box-shadow: 0 15px 40px rgba(13, 44, 40, 0.3);
  color: #fff;
  padding: 12px 16px;
  font-size: 13px;
}

.toast.error {
  background: #7e302e;
}

.loading {
  display: grid;
  min-height: 320px;
  place-items: center;
  color: var(--muted);
  font-size: 13px;
}

@media (max-width: 1100px) {
  .stats-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

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

@media (max-width: 860px) {
  .login-view {
    grid-template-columns: 1fr;
  }

  .login-art {
    display: none;
  }

  .login-panel {
    min-height: 100vh;
    padding: 30px;
  }

  .mobile-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 42px;
  }

  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: fixed;
    z-index: 20;
    width: 236px;
    transform: translateX(-100%);
    transition: transform 180ms ease;
  }

  .sidebar.open {
    transform: translateX(0);
    box-shadow: 18px 0 60px rgba(9, 29, 27, 0.25);
  }

  .mobile-menu {
    display: grid;
    width: 38px;
    height: 38px;
    margin-bottom: 18px;
    place-items: center;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: #fff;
  }

  .topbar {
    padding: 22px 20px 18px;
  }

  .page-content {
    padding: 0 20px 36px;
  }

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

@media (max-width: 620px) {
  .topbar-actions .date-chip {
    display: none;
  }

  .topbar h1 {
    font-size: 24px;
  }

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

  .stat-card {
    min-height: 126px;
  }

  .toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .toolbar-group {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .toolbar input {
    width: 100%;
  }

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

  .field.full {
    grid-column: auto;
  }

  .modal-backdrop {
    align-items: end;
    padding: 0;
  }

  .modal,
  .modal.wide {
    width: 100%;
    max-height: 92vh;
    border-radius: 22px 22px 0 0;
  }
}
