:root {
  --ink: #152236;
  --muted: #667085;
  --line: #d9e2ec;
  --paper: #fff;
  --soft: #f3f7fb;
  --brand: #0066b3;
  --accent: #f0b429;
  --danger: #c93636;
  --green: #168461;
  --shadow: 0 12px 30px rgba(25, 48, 76, 0.08);
  font-family: "Microsoft YaHei", "PingFang SC", Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

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

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

button {
  min-height: 40px;
  padding: 8px 14px;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--ink);
  background: #fff;
  cursor: pointer;
  font-weight: 700;
}

button:hover {
  border-color: var(--brand);
}

button:disabled {
  cursor: wait;
  opacity: 0.65;
}

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

.primary:hover {
  color: #fff;
  background: #005792;
}

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

.admin-shell {
  min-height: 100vh;
}

.login-view {
  display: grid;
  min-height: 100vh;
  place-items: center;
  padding: 24px;
  background:
    linear-gradient(120deg, rgba(0, 55, 96, 0.88), rgba(0, 112, 132, 0.78)),
    url("../assets/fc40a58fe5d17e7024cbf8a5c9333331.jpg") center / cover;
}

.login-card {
  display: grid;
  gap: 16px;
  width: min(420px, 100%);
  padding: 34px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 24px 60px rgba(0, 20, 40, 0.24);
}

.eyebrow {
  margin: 0;
  color: var(--brand);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

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

.login-card h1,
.topbar h1 {
  margin-bottom: 0;
  line-height: 1.2;
}

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

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

input,
select {
  min-height: 42px;
  padding: 9px 11px;
}

textarea {
  min-height: 150px;
  padding: 11px;
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 4px rgba(0, 102, 179, 0.1);
}

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

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

.message.is-error {
  color: var(--danger);
}

.message.is-ok {
  color: var(--green);
}

.dashboard {
  min-height: 100vh;
  width: min(1520px, 100%);
  margin: 0 auto;
  padding: 18px 24px 28px;
}

.topbar {
  position: sticky;
  z-index: 3;
  top: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 20px;
  padding: 18px 22px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: var(--shadow);
  backdrop-filter: blur(12px);
}

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

.topbar-actions a {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 8px 14px;
  border-radius: 6px;
  color: #fff;
  background: var(--green);
  text-decoration: none;
  font-weight: 700;
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 14px;
  margin-bottom: 18px;
}

.stat-grid div {
  display: grid;
  gap: 6px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.stat-card {
  display: grid;
  gap: 6px;
  min-height: auto;
  padding: 18px;
  text-align: left;
  font-weight: inherit;
}

.stat-card.is-active {
  border-color: var(--brand);
  background: #eef7ff;
  box-shadow: inset 0 3px 0 var(--brand);
}

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

.stat-grid strong {
  font-size: 26px;
}

.content-tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 16px;
  padding: 5px;
  width: fit-content;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.content-tabs button {
  min-height: 42px;
  border-color: transparent;
  color: var(--muted);
}

.content-tabs button.is-active {
  color: #fff;
  border-color: var(--brand);
  background: var(--brand);
}

.workspace {
  display: grid;
  grid-template-columns: minmax(320px, 0.82fr) minmax(420px, 1.18fr);
  gap: 18px;
  align-items: start;
}

.content-list-panel,
.editor {
  min-height: 620px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: var(--shadow);
}

.panel-head {
  display: grid;
  grid-template-columns: 1fr 170px;
  gap: 12px;
  padding: 18px;
  border-bottom: 1px solid var(--line);
}

.panel-head .primary {
  grid-column: 1 / -1;
}

.panel-head-single {
  grid-template-columns: 1fr;
}

.content-list {
  max-height: calc(100vh - 334px);
  min-height: 480px;
  overflow: auto;
}

.content-row {
  display: grid;
  grid-template-columns: 58px 1fr;
  gap: 12px;
  width: 100%;
  min-height: 82px;
  padding: 12px 16px;
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  text-align: left;
  transition: background 140ms ease;
}

.content-row:hover {
  background: #f5f9fc;
}

.content-row.is-active {
  background: #eef7ff;
  box-shadow: inset 3px 0 0 var(--brand);
}

.content-row img {
  width: 58px;
  height: 58px;
  object-fit: contain;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #f8fafc;
}

.content-row strong,
.content-row span {
  display: block;
}

.content-row strong {
  margin-bottom: 4px;
  line-height: 1.35;
}

.content-row small {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.empty-list {
  padding: 28px 16px;
  color: var(--muted);
  text-align: center;
}

.editor {
  position: sticky;
  top: 92px;
  max-height: calc(100vh - 112px);
  overflow-y: auto;
  padding: 20px;
}

.editor-empty {
  display: grid;
  min-height: 520px;
  place-content: center;
  color: var(--muted);
  text-align: center;
}

.editor-fields {
  display: grid;
  gap: 15px;
}

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

.upload-row input {
  padding: 9px;
}

.preview {
  display: grid;
  min-height: 250px;
  margin: 0;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: linear-gradient(135deg, #f8fafc, #eef4f8);
}

.preview img {
  max-width: 100%;
  max-height: 250px;
  object-fit: contain;
}

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

.parameter-input textarea {
  min-height: 210px;
  font-family: Consolas, "Microsoft YaHei", monospace;
  line-height: 1.65;
}

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

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

  .stat-grid,
  .two-col,
  .panel-head {
    grid-template-columns: 1fr;
  }

  .content-tabs {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    width: 100%;
  }

  .editor {
    position: static;
    max-height: none;
  }

  .content-list {
    max-height: 520px;
    min-height: 0;
  }
}

@media (min-width: 981px) and (max-width: 1180px) {
  .stat-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}
