:root {
  --navy-950: #06162e;
  --navy-900: #091e3d;
  --navy-800: #0b2b55;
  --blue-700: #0c4c9d;
  --blue-600: #1265c1;
  --cyan: #28c7c9;
  --cyan-soft: #dff9f7;
  --ink: #152237;
  --muted: #6d7a8d;
  --paper: #f3f6fa;
  --white: #fff;
  --line: #dce4ed;
  --danger: #b33535;
  --success: #14775a;
  --shadow: 0 20px 60px rgba(10, 34, 67, 0.12);
  --mono: "Cascadia Code", "SFMono-Regular", Consolas, monospace;
  --sans: "Segoe UI", "Microsoft YaHei", "PingFang SC", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  color: var(--ink);
  background: var(--paper);
  font-family: var(--sans);
}

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  font-size: 15px;
  line-height: 1.6;
}

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

button,
a {
  -webkit-tap-highlight-color: transparent;
}

button {
  color: inherit;
}

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

img {
  display: block;
  max-width: 100%;
}

[hidden] {
  display: none !important;
}

.login-view {
  min-height: 100vh;
  color: var(--white);
  background:
    radial-gradient(circle at 80% 20%, rgba(40, 199, 201, 0.2), transparent 30rem),
    linear-gradient(125deg, var(--navy-950), #0c315e);
}

.login-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(420px, 0.95fr);
  min-height: 100vh;
}

.login-intro {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: clamp(34px, 6vw, 84px);
  border-right: 1px solid rgba(255, 255, 255, 0.12);
}

.admin-brand {
  display: inline-flex;
  align-items: center;
  width: max-content;
  gap: 13px;
}

.admin-brand img {
  width: 46px;
  height: 46px;
}

.admin-brand span {
  display: grid;
  line-height: 1.2;
}

.admin-brand strong {
  font: 700 20px/1 var(--mono);
  letter-spacing: 0.06em;
}

.admin-brand small {
  margin-top: 5px;
  color: #91abc7;
  font: 500 9px/1 var(--mono);
  letter-spacing: 0.16em;
}

.login-intro h1 {
  max-width: 760px;
  margin: 20px 0 24px;
  font-size: clamp(44px, 6vw, 82px);
  letter-spacing: -0.055em;
  line-height: 1.05;
}

.login-intro p {
  max-width: 620px;
  color: #bed0e4;
  font-size: 17px;
}

.console-label {
  margin: 0;
  color: #7ce5de !important;
  font: 600 11px/1.4 var(--mono) !important;
  letter-spacing: 0.17em;
  text-transform: uppercase;
}

.login-footnote {
  margin: 0 !important;
  color: #7f99b4 !important;
  font: 500 10px/1.5 var(--mono) !important;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.login-panel {
  display: grid;
  place-items: center;
  padding: 38px;
}

.login-card {
  width: min(100%, 440px);
  padding: 42px;
  color: var(--ink);
  background: var(--white);
  border-radius: 22px;
  box-shadow: 0 35px 100px rgba(0, 5, 20, 0.32);
}

.login-card h2 {
  margin: 22px 0 8px;
  font-size: 31px;
  letter-spacing: -0.04em;
}

.login-card > p {
  margin: 0 0 26px;
  color: var(--muted);
}

.login-card form {
  display: grid;
  gap: 18px;
}

.status-dot {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  color: var(--blue-700);
  font: 700 10px/1 var(--mono);
  letter-spacing: 0.11em;
}

.status-dot::before,
.online-dot {
  width: 8px;
  height: 8px;
  content: "";
  background: var(--cyan);
  border-radius: 50%;
  box-shadow: 0 0 0 4px rgba(40, 199, 201, 0.14);
}

.login-help {
  margin: 20px 0 0 !important;
  color: var(--muted);
  font-size: 12px;
}

.login-help code {
  padding: 2px 6px;
  color: var(--navy-900);
  background: var(--paper);
  border-radius: 4px;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 43px;
  padding: 0 18px;
  border: 1px solid transparent;
  border-radius: 7px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: transform 160ms ease, background 160ms ease, border-color 160ms ease;
}

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

.button:disabled {
  opacity: 0.55;
  cursor: wait;
  transform: none;
}

.button-primary {
  color: var(--white);
  background: var(--blue-700);
}

.button-primary:hover {
  background: var(--blue-600);
}

.button-outline {
  color: var(--blue-700);
  background: var(--white);
  border-color: #b8cbe0;
}

.button-ghost {
  color: var(--ink);
  background: var(--white);
  border-color: var(--line);
}

.field {
  display: grid;
  gap: 7px;
}

.field > span {
  color: #35445a;
  font-size: 13px;
  font-weight: 700;
}

.field input,
.field textarea,
.field select {
  width: 100%;
  min-height: 43px;
  padding: 10px 12px;
  color: var(--ink);
  background: #fbfcfe;
  border: 1px solid #ccd7e3;
  border-radius: 7px;
  outline: none;
  transition: border-color 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

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

.field input:focus,
.field textarea:focus,
.field select:focus {
  background: var(--white);
  border-color: var(--blue-600);
  box-shadow: 0 0 0 3px rgba(18, 101, 193, 0.11);
}

.field small {
  color: var(--muted);
  font-size: 11px;
}

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

.form-error:not(:empty) {
  min-height: 22px;
}

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

.sidebar {
  position: sticky;
  top: 0;
  display: flex;
  flex-direction: column;
  height: 100vh;
  padding: 28px 20px 20px;
  color: var(--white);
  background:
    linear-gradient(rgba(6, 22, 46, 0.97), rgba(7, 28, 55, 0.99)),
    repeating-linear-gradient(135deg, #0a284f 0 2px, #071d3a 2px 12px);
}

.sidebar .admin-brand {
  padding-inline: 10px;
}

.admin-nav {
  display: grid;
  gap: 5px;
  margin-top: 48px;
}

.admin-nav button,
.admin-nav a {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  min-height: 46px;
  padding: 0 13px;
  color: #a9bfd5;
  text-align: left;
  background: transparent;
  border: 0;
  border-radius: 7px;
  cursor: pointer;
}

.admin-nav button span,
.admin-nav a span {
  color: #65839f;
  font: 500 10px/1 var(--mono);
}

.admin-nav button:hover,
.admin-nav button.active,
.admin-nav a:hover,
.admin-nav a.active {
  color: var(--white);
  background: rgba(255, 255, 255, 0.09);
}

.admin-nav button.active span,
.admin-nav a.active span {
  color: var(--cyan);
}

.sidebar-bottom {
  display: grid;
  gap: 8px;
  margin-top: auto;
  padding: 18px 10px 0;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
}

.sidebar-bottom a,
.sidebar-bottom button {
  padding: 7px 0;
  color: #98b0c7;
  text-align: left;
  background: transparent;
  border: 0;
  font-size: 13px;
  cursor: pointer;
}

.sidebar-bottom a:hover,
.sidebar-bottom button:hover {
  color: var(--white);
}

.admin-main {
  min-width: 0;
}

.admin-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 100px;
  padding: 20px clamp(24px, 4vw, 58px);
  background: rgba(255, 255, 255, 0.9);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(15px);
}

.admin-header h1 {
  margin: 2px 0 0;
  color: var(--navy-900);
  font-size: 28px;
  letter-spacing: -0.03em;
}

.breadcrumb-label,
.section-kicker {
  display: block;
  margin: 0;
  color: var(--blue-700);
  font: 700 10px/1.4 var(--mono);
  letter-spacing: 0.13em;
}

.session-user {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  color: var(--muted);
  font: 600 12px/1 var(--mono);
}

.online-dot {
  display: inline-block;
  background: var(--success);
  box-shadow: none;
}

.security-banner {
  margin: 22px clamp(24px, 4vw, 58px) 0;
  padding: 13px 16px;
  color: #694800;
  background: #fff5d9;
  border: 1px solid #f0d68e;
  border-radius: 8px;
  font-size: 13px;
}

.security-banner button {
  margin-left: 10px;
  padding: 0;
  color: #715000;
  text-decoration: underline;
  background: transparent;
  border: 0;
  cursor: pointer;
}

.workspace {
  padding: 34px clamp(24px, 4vw, 58px) 70px;
}

.view {
  display: none;
}

.view.active {
  display: block;
  animation: view-in 180ms ease both;
}

@keyframes view-in {
  from {
    opacity: 0;
    transform: translateY(5px);
  }
}

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

.stat-card {
  position: relative;
  overflow: hidden;
  min-height: 165px;
  padding: 25px;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: 0 7px 25px rgba(13, 40, 74, 0.05);
}

.stat-card::after {
  position: absolute;
  top: -42px;
  right: -32px;
  width: 130px;
  height: 130px;
  content: "";
  border: 1px solid #d7eaf3;
  border-radius: 50%;
}

.stat-card > span {
  color: var(--muted);
  font: 700 10px/1 var(--mono);
  letter-spacing: 0.12em;
}

.stat-card strong {
  display: block;
  margin-top: 18px;
  color: var(--navy-900);
  font: 700 48px/1 var(--mono);
}

.stat-card p {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.overview-grid {
  display: grid;
  grid-template-columns: 1.25fr 0.75fr;
  gap: 18px;
  margin-top: 18px;
}

.panel {
  padding: 27px;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: 0 7px 25px rgba(13, 40, 74, 0.05);
}

.panel-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line);
}

.panel-heading span {
  color: var(--blue-700);
  font: 700 10px/1 var(--mono);
  letter-spacing: 0.12em;
}

.panel-heading h2 {
  margin: 7px 0 0;
  font-size: 22px;
}

.quick-actions {
  display: grid;
  gap: 1px;
  margin-top: 18px;
  background: var(--line);
}

.quick-actions button,
.quick-actions a {
  display: grid;
  padding: 15px;
  text-align: left;
  background: var(--white);
  border: 0;
  cursor: pointer;
}

.quick-actions button:hover,
.quick-actions a:hover {
  background: #f3f8fc;
}

.quick-actions b {
  color: var(--blue-700);
  font-size: 14px;
}

.quick-actions span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}

.system-panel > p {
  color: var(--muted);
  font-size: 13px;
}

.system-panel dl {
  margin: 20px 0 0;
}

.system-panel dl div {
  display: flex;
  justify-content: space-between;
  padding: 10px 0;
  border-top: 1px solid var(--line);
}

.system-panel dt {
  color: var(--muted);
}

.system-panel dd {
  margin: 0;
  color: var(--navy-900);
  font: 600 12px/1.6 var(--mono);
}

.system-panel a {
  color: var(--blue-700);
  text-decoration: underline;
}

.section-toolbar {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 24px;
}

.section-toolbar h2 {
  margin: 7px 0 5px;
  color: var(--navy-900);
  font-size: 32px;
  letter-spacing: -0.035em;
}

.section-toolbar p {
  max-width: 700px;
  margin: 0;
  color: var(--muted);
}

.list-panel,
.content-form,
.password-form {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: 0 7px 25px rgba(13, 40, 74, 0.05);
}

.list-panel {
  overflow: hidden;
}

.list-head,
.list-row {
  display: grid;
  grid-template-columns: minmax(240px, 1.5fr) minmax(120px, 0.7fr) 130px 190px;
  align-items: center;
  gap: 16px;
}

.list-head {
  padding: 13px 20px;
  color: var(--muted);
  background: #f7f9fc;
  border-bottom: 1px solid var(--line);
  font: 700 10px/1 var(--mono);
  letter-spacing: 0.09em;
}

.list-row {
  min-height: 78px;
  padding: 13px 20px;
  border-bottom: 1px solid var(--line);
}

.list-row:last-child {
  border-bottom: 0;
}

.list-primary {
  display: flex;
  align-items: center;
  min-width: 0;
  gap: 13px;
}

.list-thumb {
  width: 48px;
  height: 48px;
  flex: 0 0 auto;
  overflow: hidden;
  background: #e8eef5;
  border-radius: 7px;
}

.list-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.list-title {
  min-width: 0;
}

.list-title strong {
  display: block;
  overflow: hidden;
  color: var(--navy-900);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.list-title small,
.list-meta {
  color: var(--muted);
  font-size: 11px;
}

.list-actions {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 7px;
}

.list-actions form,
.media-actions form {
  display: inline-flex;
  margin: 0;
}

.mini-button {
  min-height: 32px;
  padding: 0 10px;
  color: var(--blue-700);
  background: var(--white);
  border: 1px solid #c9d6e3;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

.mini-button:hover {
  background: #eef5fc;
}

.mini-button.danger {
  color: var(--danger);
}

.status-pill {
  display: inline-flex;
  width: max-content;
  padding: 3px 8px;
  color: var(--success);
  background: #e8f7f1;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
}

.status-pill.draft {
  color: #796018;
  background: #fff5d9;
}

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

.empty-state strong {
  display: block;
  margin-bottom: 5px;
  color: var(--navy-800);
  font-size: 18px;
}

.form-tabs {
  display: flex;
  gap: 4px;
  padding: 16px 19px 0;
  border-bottom: 1px solid var(--line);
}

.form-tabs button {
  padding: 10px 15px;
  color: var(--muted);
  background: transparent;
  border: 0;
  border-bottom: 2px solid transparent;
  cursor: pointer;
}

.form-tabs button.active {
  color: var(--blue-700);
  border-bottom-color: var(--blue-700);
  font-weight: 700;
}

.form-tab-panel {
  display: none;
}

.form-tab-panel.active {
  display: block;
}

.form-section {
  padding: 26px;
  border-bottom: 1px solid var(--line);
}

.form-section:last-child {
  border-bottom: 0;
}

.form-section-head {
  margin-bottom: 21px;
}

.form-section-head span {
  color: var(--blue-700);
  font: 700 10px/1 var(--mono);
  letter-spacing: 0.11em;
}

.form-section-head h3 {
  margin: 6px 0 0;
  color: var(--navy-900);
  font-size: 20px;
}

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

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

.form-actions {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 19px 26px;
  background: #f7f9fc;
  border-radius: 0 0 12px 12px;
}

.save-status {
  color: var(--success);
  font-size: 13px;
}

.inline-note {
  margin: 20px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.password-form {
  display: grid;
  gap: 18px;
  width: min(100%, 570px);
  padding: 28px;
}

.media-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 16px;
}

.media-card {
  overflow: hidden;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: 0 7px 25px rgba(13, 40, 74, 0.05);
}

.media-image {
  aspect-ratio: 16 / 10;
  background: #e9eef4;
}

.media-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.media-info {
  padding: 13px;
}

.media-info strong {
  display: block;
  overflow: hidden;
  color: var(--navy-900);
  font: 600 11px/1.4 var(--mono);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.media-info small {
  color: var(--muted);
}

.media-actions {
  display: flex;
  gap: 7px;
  margin-top: 10px;
}

.upload-button {
  position: relative;
  cursor: pointer;
}

.editor-dialog {
  width: min(1040px, calc(100vw - 34px));
  max-height: calc(100vh - 34px);
  padding: 0;
  overflow: hidden;
  color: var(--ink);
  background: var(--white);
  border: 0;
  border-radius: 16px;
  box-shadow: 0 35px 100px rgba(0, 9, 28, 0.38);
}

.editor-dialog::backdrop {
  background: rgba(4, 17, 36, 0.7);
  backdrop-filter: blur(4px);
}

.editor-dialog form {
  display: flex;
  flex-direction: column;
  max-height: calc(100vh - 34px);
}

.dialog-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex: 0 0 auto;
  padding: 20px 25px;
  background: var(--navy-950);
}

.dialog-header span {
  color: var(--cyan);
  font: 700 10px/1 var(--mono);
  letter-spacing: 0.13em;
}

.dialog-header h2 {
  margin: 6px 0 0;
  color: var(--white);
  font-size: 24px;
}

.icon-button {
  width: 38px;
  height: 38px;
  color: #c0d1e2;
  background: rgba(255, 255, 255, 0.08);
  border: 0;
  border-radius: 7px;
  font-size: 24px;
  cursor: pointer;
}

.dialog-body {
  overflow-y: auto;
}

.dialog-footer {
  display: flex;
  justify-content: flex-end;
  flex: 0 0 auto;
  gap: 10px;
  padding: 15px 25px;
  background: #f7f9fc;
  border-top: 1px solid var(--line);
}

.image-field {
  display: grid;
  grid-template-columns: minmax(210px, 0.55fr) minmax(0, 1fr);
  align-items: center;
  gap: 22px;
}

.image-preview {
  display: grid;
  place-items: center;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  color: var(--muted);
  background: #e9eef4;
  border: 1px dashed #b7c6d6;
  border-radius: 9px;
  font-size: 12px;
}

.image-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.image-field-controls {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 11px;
}

.image-field-controls .field {
  width: 100%;
}

.image-field-controls small {
  color: var(--muted);
  font-size: 11px;
}

.check-field {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
}

.check-field input {
  width: 18px;
  height: 18px;
  accent-color: var(--blue-700);
}

.toast {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 1000;
  max-width: min(420px, calc(100vw - 48px));
  padding: 13px 17px;
  color: var(--white);
  background: var(--navy-900);
  border-radius: 8px;
  box-shadow: var(--shadow);
  font-size: 13px;
  opacity: 0;
  pointer-events: none;
  transform: translateY(12px);
  transition: opacity 180ms ease, transform 180ms ease;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

.toast.error {
  background: #8f2929;
}

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

  .login-intro {
    min-height: 340px;
    border-right: 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.12);
  }

  .login-intro h1 {
    font-size: clamp(38px, 8vw, 62px);
  }

  .login-panel {
    padding-block: 55px;
  }

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

  .sidebar {
    position: static;
    height: auto;
    padding: 18px;
  }

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

  .sidebar-bottom {
    display: flex;
    padding: 12px 0 0;
  }

  .admin-header {
    min-height: 82px;
  }

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

@media (max-width: 720px) {
  .login-intro {
    min-height: 280px;
    padding: 28px 22px;
  }

  .login-panel {
    padding: 28px 16px 50px;
  }

  .login-card {
    padding: 28px 22px;
    border-radius: 15px;
  }

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

  .admin-nav button {
    min-height: 42px;
    padding-inline: 9px;
    font-size: 13px;
  }

  .sidebar-bottom {
    justify-content: space-between;
  }

  .admin-header,
  .workspace {
    padding-inline: 16px;
  }

  .admin-header h1 {
    font-size: 23px;
  }

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

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

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

  .field-grid,
  .image-field {
    grid-template-columns: 1fr;
  }

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

  .form-tabs {
    overflow-x: auto;
  }

  .form-tabs button {
    flex: 0 0 auto;
  }

  .form-section {
    padding: 20px 16px;
  }

  .list-head {
    display: none;
  }

  .list-row {
    grid-template-columns: 1fr;
    gap: 10px;
    padding: 18px 16px;
  }

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

  .dialog-header,
  .dialog-footer {
    padding-inline: 16px;
  }

  .editor-dialog {
    width: calc(100vw - 16px);
    max-height: calc(100vh - 16px);
  }

  .editor-dialog form {
    max-height: calc(100vh - 16px);
  }
}
