:root {
  --ink: #171a1d;
  --muted: #5e666d;
  --line: #d9dde1;
  --paper: #f5f6f4;
  --panel: #ffffff;
  --steel: #273036;
  --accent: #c33f2d;
  --teal: #207b79;
  --gold: #b9862a;
  --danger: #a72f28;
  --shadow: 0 16px 42px rgba(19, 25, 31, 0.13);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  color: var(--ink);
  font-family: "Microsoft YaHei", "PingFang SC", "Segoe UI", Arial, sans-serif;
  background: var(--paper);
  line-height: 1.55;
}

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

.hidden {
  display: none !important;
}

.login-view {
  display: grid;
  min-height: 100vh;
  place-items: center;
  padding: 28px;
  background:
    linear-gradient(rgba(18, 22, 26, 0.78), rgba(18, 22, 26, 0.78)),
    url("/assets/hero-fasteners.jpg") center / cover;
}

.login-card {
  width: min(420px, 100%);
  padding: 34px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

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

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 22px;
  font-size: 30px;
  line-height: 1.2;
}

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

h3 {
  margin: 0 0 12px;
  font-size: 18px;
}

label {
  display: grid;
  gap: 7px;
  margin-bottom: 16px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
}

input,
textarea,
select {
  width: 100%;
  min-height: 44px;
  padding: 10px 12px;
  color: var(--ink);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 6px;
  outline: none;
}

textarea {
  resize: vertical;
}

input:focus,
textarea:focus,
select:focus {
  border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(32, 123, 121, 0.12);
}

.button,
.small-button,
.danger-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 0 16px;
  border: 1px solid transparent;
  border-radius: 6px;
  cursor: pointer;
  font-weight: 800;
}

.button.primary,
.small-button {
  color: #fff;
  background: var(--accent);
}

.button.primary:hover,
.small-button:hover {
  background: #962d23;
}

.danger-button {
  color: #fff;
  background: var(--danger);
}

.muted-button {
  min-height: 38px;
  padding: 0 12px;
  color: var(--steel);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 6px;
  cursor: pointer;
  font-weight: 800;
}

.hint {
  margin: 14px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.form-message {
  min-height: 24px;
  margin: 12px 0 0;
  color: var(--danger);
}

.admin-shell {
  display: grid;
  grid-template-columns: 280px 1fr;
  min-height: 100vh;
}

.sidebar {
  position: sticky;
  top: 0;
  display: flex;
  flex-direction: column;
  height: 100vh;
  padding: 22px;
  color: #fff;
  background: #171a1d;
}

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

.admin-brand span {
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  background: var(--accent);
  font-weight: 900;
}

.admin-brand strong,
.admin-brand small {
  display: block;
}

.admin-brand small {
  color: rgba(255, 255, 255, 0.62);
}

.admin-nav {
  display: grid;
  gap: 8px;
}

.admin-nav button,
.sidebar-actions a,
.sidebar-actions button {
  width: 100%;
  min-height: 42px;
  padding: 0 12px;
  text-align: left;
  color: rgba(255, 255, 255, 0.76);
  background: transparent;
  border: 1px solid transparent;
  border-radius: 6px;
  cursor: pointer;
}

.admin-nav button.active,
.admin-nav button:hover,
.sidebar-actions a:hover,
.sidebar-actions button:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.12);
}

.sidebar-actions {
  display: grid;
  gap: 8px;
  margin-top: auto;
}

.sidebar-actions a {
  display: flex;
  align-items: center;
  text-decoration: none;
}

.workspace {
  min-width: 0;
}

.workspace-head {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 26px 34px;
  background: rgba(245, 246, 244, 0.92);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(12px);
}

.workspace-actions {
  display: flex;
  align-items: end;
  gap: 12px;
}

.admin-language {
  min-width: 190px;
  margin: 0;
}

.admin-language select {
  min-height: 42px;
}

.workspace-head h1 {
  margin-bottom: 6px;
}

.workspace-head p:last-child {
  margin-bottom: 0;
  color: var(--muted);
}

.workspace-content {
  display: grid;
  gap: 18px;
  padding: 28px 34px 60px;
}

.panel {
  padding: 24px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(19, 25, 31, 0.06);
}

.action-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 18px;
  align-items: start;
  background:
    linear-gradient(135deg, rgba(32, 123, 121, 0.08), rgba(195, 63, 45, 0.06)),
    #fff;
}

.panel-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
}

.notice {
  grid-column: 1 / -1;
  display: grid;
  gap: 4px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 14px;
}

.notice strong {
  color: var(--ink);
}

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

.notice.success {
  border-color: rgba(32, 123, 121, 0.32);
  background: rgba(32, 123, 121, 0.08);
}

.notice.warning {
  border-color: rgba(185, 134, 42, 0.38);
  background: rgba(185, 134, 42, 0.1);
}

.notice.muted {
  background: #f4f6f5;
}

.grid-2,
.grid-3 {
  display: grid;
  gap: 16px;
}

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

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

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

.editor-card {
  padding: 18px;
  background: #fbfbfa;
  border: 1px solid var(--line);
  border-radius: 8px;
}

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

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

.image-row {
  display: grid;
  grid-template-columns: 180px 1fr;
  gap: 16px;
  align-items: start;
}

.image-preview {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  background: #e1e4e7;
  border: 1px solid var(--line);
  border-radius: 6px;
}

.upload-input {
  display: none;
}

.pill-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 10px;
  color: #fff;
  background: var(--teal);
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
}

.inquiry-card {
  padding: 18px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.inquiry-meta {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin: 12px 0;
  color: var(--muted);
  font-size: 14px;
}

.inquiry-message {
  padding: 14px;
  background: #f4f6f5;
  border-radius: 6px;
  white-space: pre-wrap;
}

.empty {
  padding: 28px;
  color: var(--muted);
  text-align: center;
  background: #fff;
  border: 1px dashed var(--line);
  border-radius: 8px;
}

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

  .sidebar {
    position: static;
    height: auto;
  }

  .admin-nav {
    grid-template-columns: repeat(3, 1fr);
  }

  .sidebar-actions {
    grid-template-columns: repeat(2, 1fr);
    margin-top: 18px;
  }

  .grid-2,
  .grid-3,
  .inquiry-meta,
  .action-panel,
  .image-row {
    grid-template-columns: 1fr;
  }

  .panel-actions {
    justify-content: flex-start;
  }
}

@media (max-width: 640px) {
  .workspace-head {
    display: grid;
    padding: 20px;
  }

  .workspace-actions {
    display: grid;
    align-items: stretch;
  }

  .workspace-content {
    padding: 20px;
  }

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