:root {
  --green: #006452;
  --green-deep: #003b33;
  --paper: #f7f2e9;
  --white: #fffdf8;
  --ink: #1f1b17;
  --muted: #706a62;
  --line: rgba(31, 27, 23, 0.12);
  --red: #b93628;
  --blue: #236a95;
  font-family: "Microsoft YaHei", "Noto Sans SC", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
}

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

button {
  cursor: pointer;
}

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

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

.admin-sidebar {
  position: sticky;
  top: 0;
  display: flex;
  flex-direction: column;
  height: 100vh;
  padding: 28px 22px;
  color: #fff;
  background: var(--green-deep);
}

.admin-brand {
  display: grid;
  gap: 6px;
  margin-bottom: 42px;
}

.admin-brand span {
  font-size: 24px;
  font-weight: 800;
  letter-spacing: 0.08em;
}

.admin-brand strong {
  color: rgba(255, 255, 255, 0.7);
  font-weight: 500;
}

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

.admin-nav button,
.admin-logout,
.back-home {
  min-height: 44px;
  padding: 0 14px;
  color: rgba(255, 255, 255, 0.76);
  text-align: left;
  background: transparent;
  border: 1px solid transparent;
}

.admin-nav button.is-active,
.admin-nav button:hover,
.admin-logout:hover,
.back-home:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.16);
}

.back-home {
  display: flex;
  align-items: center;
  margin-top: 8px;
}

.admin-logout {
  margin-top: auto;
  min-height: 40px;
  padding: 0 14px;
  color: rgba(255, 255, 255, 0.76);
  text-align: left;
  background: transparent;
  border: 1px solid transparent;
}

.admin-main {
  padding: clamp(20px, 4vw, 46px);
}

.login-panel {
  display: grid;
  grid-template-columns: minmax(260px, 0.8fr) minmax(280px, 0.65fr);
  gap: 42px;
  align-items: center;
  min-height: calc(100vh - 92px);
}

.login-panel > div,
.login-panel form,
.workspace {
  background: var(--white);
  border: 1px solid var(--line);
  box-shadow: 0 16px 46px rgba(31, 27, 23, 0.08);
}

.login-panel > div {
  min-height: 390px;
  padding: clamp(28px, 5vw, 58px);
  color: #fff;
  background:
    linear-gradient(135deg, rgba(0, 65, 53, 0.94), rgba(0, 65, 53, 0.54)),
    url("assets/site-images/fb3811-01-hero.jpg") center / cover no-repeat;
}

.login-panel p,
.workspace-head p {
  margin: 0 0 14px;
  color: var(--green);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.login-panel > div p {
  color: #e8c88f;
}

.login-panel h1,
.workspace-head h1 {
  margin: 0;
  font-size: clamp(34px, 5vw, 56px);
  line-height: 1.1;
}

.login-panel > div span {
  display: block;
  margin-top: 24px;
  color: rgba(255, 255, 255, 0.78);
}

.login-panel form {
  display: grid;
  gap: 18px;
  padding: 30px;
}

label {
  display: grid;
  gap: 8px;
}

label span {
  color: var(--muted);
  font-size: 14px;
}

input,
select,
textarea {
  width: 100%;
  color: var(--ink);
  background: #fff;
  border: 1px solid var(--line);
  outline: none;
}

input {
  height: 42px;
  padding: 0 12px;
}

textarea {
  min-height: 84px;
  padding: 12px;
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(0, 100, 82, 0.11);
}

.primary-action,
.head-actions button,
.settings-grid button {
  min-height: 42px;
  padding: 0 18px;
  color: #fff;
  background: var(--green);
  border: 1px solid var(--green);
}

.danger-action {
  background: var(--red) !important;
  border-color: var(--red) !important;
}

output {
  min-height: 22px;
  color: var(--red);
}

.workspace {
  min-height: calc(100vh - 92px);
  padding: clamp(22px, 4vw, 38px);
}

.workspace-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 22px;
  margin-bottom: 32px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--line);
}

.head-actions {
  display: flex;
  gap: 10px;
}

.head-actions button:first-child {
  color: var(--green);
  background: #fff;
}

.panel-head {
  display: grid;
  gap: 8px;
  margin-bottom: 22px;
}

.split-head {
  grid-template-columns: 1fr auto;
  align-items: end;
}

.split-head button {
  min-height: 42px;
  padding: 0 18px;
  color: var(--green);
  background: #fff;
  border: 1px solid var(--line);
}

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

.panel-head p,
.settings-grid p {
  margin: 0;
  color: var(--muted);
  line-height: 1.7;
}

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

.wide {
  grid-column: 1 / -1;
}

.product-admin-list {
  display: grid;
  gap: 18px;
}

.edit-card {
  display: grid;
  grid-template-columns: 190px minmax(0, 1fr);
  gap: 20px;
  padding: 16px;
  background: #fff;
  border: 1px solid var(--line);
}

.edit-preview {
  display: grid;
  align-content: start;
  gap: 12px;
}

.edit-preview img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  background: rgba(31, 27, 23, 0.04);
  border: 1px solid var(--line);
}

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

.upload-box {
  display: grid;
  gap: 8px;
}

.upload-button {
  display: grid;
}

.upload-button input {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
}

.upload-button span,
.danger-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  padding: 0 12px;
  font-size: 14px;
  border: 1px solid var(--line);
}

.upload-button span {
  color: #fff;
  background: var(--green);
  border-color: var(--green);
}

.upload-box small {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.danger-link {
  width: 100%;
  color: var(--red);
  background: #fff;
}

.danger-link:hover {
  color: #fff;
  background: var(--red);
  border-color: var(--red);
}

.channel-admin-list {
  display: grid;
  gap: 12px;
  margin-top: 18px;
}

.order-admin-list {
  display: grid;
  gap: 14px;
}

.empty-note {
  margin: 0;
  padding: 20px;
  color: var(--muted);
  background: #fff;
  border: 1px solid var(--line);
}

.order-card {
  display: grid;
  gap: 12px;
  padding: 18px;
  background: #fff;
  border: 1px solid var(--line);
}

.order-card header {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 12px;
}

.order-card header span,
.order-card p {
  color: var(--muted);
}

.order-card header > div:first-child {
  display: grid;
  gap: 5px;
}

.order-status-editor {
  display: grid;
  grid-template-columns: minmax(150px, 1fr) auto;
  gap: 8px;
}

.order-status-editor select,
.order-status-editor button {
  min-height: 36px;
  border: 1px solid var(--line);
}

.order-status-editor select {
  padding: 0 30px 0 10px;
  color: var(--ink);
  background: #fff;
}

.order-status-editor button {
  padding: 0 14px;
  color: #fff;
  background: var(--green);
}

.order-card p {
  margin: 0;
}

.order-card dl {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px 16px;
  margin: 0;
}

.order-card dt {
  color: var(--green);
  font-size: 12px;
  font-weight: 800;
}

.order-card dd {
  margin: 4px 0 0;
  overflow-wrap: anywhere;
}

.channel-edit {
  display: grid;
  grid-template-columns: minmax(150px, 0.4fr) minmax(260px, 1fr) minmax(180px, 0.45fr);
  gap: 14px;
  align-items: end;
  padding: 16px;
  background: #fff;
  border: 1px solid var(--line);
}

.toggle-line {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 42px;
}

.toggle-line input {
  width: 18px;
  height: 18px;
}

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

.settings-grid article {
  display: grid;
  align-content: start;
  gap: 14px;
  padding: 20px;
  background: #fff;
  border: 1px solid var(--line);
}

.settings-grid h3 {
  margin: 0;
  font-size: 20px;
}

.save-status {
  position: fixed;
  right: 24px;
  bottom: 24px;
  min-height: 0;
  color: #fff;
  background: var(--green);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.18);
}

.save-status:not(:empty) {
  padding: 12px 16px;
}

.save-status.is-error {
  background: var(--red);
}

.is-hidden {
  display: none !important;
}

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

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

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

  .back-home {
    margin-top: 8px;
  }

  .admin-logout {
    margin-top: 16px;
  }

  .login-panel,
  .settings-grid,
  .channel-edit,
  .split-head {
    grid-template-columns: 1fr;
  }

  .workspace-head {
    align-items: start;
    flex-direction: column;
  }
}

@media (max-width: 700px) {
  .admin-main {
    padding: 14px;
  }

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

  .field-grid,
  .edit-fields,
  .edit-card,
  .order-card dl {
    grid-template-columns: 1fr;
  }

  .head-actions {
    width: 100%;
  }

  .head-actions button {
    flex: 1;
  }
}
