/* 中文后台的基础设计令牌与通用表单样式。 */
:root {
  --ink: #14231f;
  --green: #173f33;
  --cream: #f4f1e9;
  --orange: #e86f37;
  --line: #d9dedb;
  --muted: #68736e;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  font-family:
    Inter,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
  background: #f5f6f4;
  color: var(--ink);
}
button,
input,
textarea,
select {
  font: inherit;
}
button {
  cursor: pointer;
}
.login-view {
  min-height: 100vh;
  display: grid;
  place-items: center;
  background: var(--green);
  color: #fff;
}

/* 登录页 */
.login-view > .admin-logo {
  position: absolute;
  left: 32px;
  top: 28px;
}
.admin-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  color: inherit;
  text-decoration: none;
}
.admin-logo > span {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: var(--orange);
  color: #fff;
  font-family: Georgia;
  font-size: 24px;
}
.admin-logo > img {
  flex: 0 0 auto;
  width: auto;
  max-width: none;
  height: 42px;
  object-fit: contain;
  object-position: left center;
}
aside .admin-logo > img {
  width: auto;
  max-width: none;
  height: 38px;
}
.admin-logo b {
  font-size: 13px;
  letter-spacing: 0.08em;
}
.login-card {
  width: min(470px, calc(100% - 32px));
  background: #fff;
  color: var(--ink);
  padding: 42px;
  border-radius: 24px;
}
.login-card h1 {
  font-family: Georgia;
  font-size: 42px;
  margin: 7px 0;
}
.login-card p {
  color: var(--muted);
}
label {
  display: flex;
  flex-direction: column;
  gap: 7px;
  font-size: 12px;
  font-weight: 700;
}
.image-field-preview {
  min-height: 86px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 14px;
  border: 1px dashed var(--line);
  border-radius: 12px;
  background: #f8faf8;
  color: var(--muted);
  font-size: 12px;
}
.image-field-preview img {
  width: auto;
  max-width: 100%;
  height: 64px;
  object-fit: contain;
  object-position: center;
}
.image-field-preview-large {
  min-height: 180px;
}
.image-field-preview-large img {
  width: 100%;
  height: 156px;
  object-fit: cover;
}
.image-field-wrap .image-field-preview {
  grid-column: 1 / -1;
}

/* 数据分析图表保持原生 SVG，避免后台额外依赖图表库。 */
.overview-analytics-heading {
  margin-top: 44px;
}
.analytics-toolbar {
  display: flex;
  align-items: end;
  gap: 10px;
}
.analytics-toolbar label {
  min-width: 138px;
}
.analytics-toolbar select,
.analytics-toolbar button {
  min-height: 40px;
}
.analytics-metrics {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
.analytics-card {
  margin-top: 18px;
  overflow: hidden;
}
.analytics-card-heading h2,
.analytics-card-heading p {
  margin: 0;
}
.analytics-card-heading p {
  margin-top: 5px;
  color: var(--muted);
  font-size: 12px;
}
.analytics-chart {
  margin-top: 18px;
  min-height: 300px;
  overflow-x: auto;
}
.analytics-chart svg {
  display: block;
  width: 100%;
  min-width: 720px;
  height: auto;
}
.analytics-chart .grid-line {
  stroke: #e2e7e4;
  stroke-width: 1;
}
.analytics-chart .axis-label {
  fill: #73807a;
  font-size: 10px;
}
.analytics-chart .data-line {
  fill: none;
  stroke-width: 3;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.analytics-chart .data-point {
  stroke: #fff;
  stroke-width: 2;
}
.analytics-chart .legend-label {
  fill: #33443e;
  font-size: 11px;
  font-weight: 700;
}
.analytics-module-totals {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}
.analytics-module-totals span {
  padding: 7px 10px;
  border-radius: 999px;
  background: #eef3f0;
  color: #40524b;
  font-size: 11px;
}
.login-card input,
.analytics-toolbar select,
.form-grid input,
.form-grid textarea,
.edit-card input,
.edit-card textarea,
.edit-card select,
.edit-row input,
.edit-row textarea {
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 11px;
  background: #fff;
  width: 100%;
}
.login-card button,
.publish,
.page-heading button,
.subheading button,
.button-link {
  border: 0;
  border-radius: 999px;
  background: var(--orange);
  color: #fff;
  padding: 12px 18px;
  font-weight: 800;
  text-decoration: none;
}
.login-card button {
  width: 100%;
  margin-top: 14px;
}
.status {
  font-size: 12px;
  color: var(--green);
}
.admin-shell {
  min-height: 100vh;
}
aside {
  position: fixed;
  inset: 0 auto 0 0;
  width: 240px;
  background: var(--ink);
  color: #dce7e2;
  padding: 26px 18px;
  display: flex;
  flex-direction: column;
  z-index: 30;
}
aside nav {
  display: grid;
  align-content: start;
  gap: 4px;
  margin-top: 42px;
  min-height: 0;
  overflow-y: auto;
}
aside nav a {
  display: flex;
  gap: 12px;
  align-items: center;
  color: #9fafaa;
  text-decoration: none;
  padding: 11px 13px;
  border-radius: 10px;
  font-size: 13px;
}
aside nav a.active {
  background: #26443b;
  color: #fff;
}
aside nav i {
  margin-left: auto;
  background: var(--orange);
  color: #fff;
  border-radius: 999px;
  padding: 1px 7px;
  font-style: normal;
}
.aside-bottom {
  margin-top: auto;
  display: flex;
  justify-content: space-between;
  font-size: 12px;
}
.aside-bottom a,
.aside-bottom button {
  color: #aebdb7;
  background: none;
  border: 0;
  text-decoration: none;
}
.admin-main {
  margin-left: 240px;
}
.admin-main > header {
  height: 76px;
  background: #fff;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 0 28px;
  position: sticky;
  top: 0;
  z-index: 20;
}
.admin-main > header small {
  display: block;
  color: var(--muted);
  font-size: 10px;
}
.admin-main > header .status {
  margin-left: auto;
}
.publish {
  white-space: nowrap;
}
#mobile-menu {
  display: none;
}
.pane {
  padding: 44px 34px 90px;
  scroll-margin-top: 76px;
}
.page-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 25px;
}
.page-heading small {
  color: var(--orange);
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.15em;
}
.page-heading h1,
.page-heading h2 {
  font-family: Georgia;
  font-size: 42px;
  margin: 4px 0;
}
.page-heading p {
  color: var(--muted);
  margin: 0;
}
.dashboard {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
}
.dashboard article,
.card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 17px;
  padding: 23px;
}
.dashboard span {
  font-size: 12px;
  color: var(--muted);
}
.dashboard b {
  display: block;
  font-family: Georgia;
  font-size: 40px;
  margin-top: 13px;
}
.card {
  margin-top: 18px;
}
.card p {
  color: var(--muted);
}
.form-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}
.form-grid .wide {
  grid-column: 1/-1;
}
.editor-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}
.editor-grid.two {
  grid-template-columns: repeat(2, 1fr);
}
.edit-card,
.edit-row {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 17px;
  padding: 18px;
}
.edit-card header,
.edit-row header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 13px;
}
.edit-card header b,
.edit-row header b {
  font-family: Georgia;
  font-size: 20px;
}
.contact-channel-card header span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}
.field-help {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.5;
}
.remove {
  border: 0;
  background: #f5e9e4;
  color: #a53c26;
  border-radius: 50%;
  width: 30px;
  height: 30px;
}
.card-actions { display: flex; align-items: center; gap: 6px; }
.card-actions button { min-width: 30px; height: 30px; border: 1px solid var(--line); border-radius: 8px; background: #fff; cursor: pointer; }
.card-actions .remove { border: 0; background: #f5e9e4; }
.post-editor-card { grid-column: 1 / -1; }
.post-section-heading { display: flex; align-items: end; justify-content: space-between; gap: 18px; margin-top: 12px; padding-top: 18px; border-top: 1px solid var(--line); }
.post-section-heading div { display: grid; gap: 4px; }
.post-section-heading small { color: var(--muted); font-weight: 500; }
.post-section-heading > button { border: 0; border-radius: 999px; padding: 9px 14px; background: var(--green); color: #fff; font-weight: 800; cursor: pointer; }
.post-sections { display: grid; gap: 12px; }
.post-section-card { padding: 16px; border: 1px dashed #c8d0cb; border-radius: 13px; background: #f8faf7; }
.post-section-card header { margin-bottom: 12px; }
.post-section-card .fields { display: grid; gap: 10px; }
.edit-card .fields {
  display: grid;
  gap: 10px;
}
.edit-card .pair {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.editor-list {
  display: grid;
  gap: 11px;
}
.edit-row {
  display: grid;
  grid-template-columns: 80px 1fr 2fr 34px;
  gap: 12px;
  align-items: end;
}
.subheading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 40px 0 15px;
}
.inbox-list {
  display: grid;
  gap: 12px;
}
.inbox-item {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 20px;
  display: grid;
  grid-template-columns: 1fr 2fr auto;
  gap: 20px;
}
.inbox-item p {
  margin: 4px 0;
  color: var(--muted);
}
.inbox-item small {
  color: var(--muted);
}
.inbox-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}
.inbox-actions select {
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
}
.inbox-actions button {
  border: 0;
  background: #f5e9e4;
  color: #a53c26;
  border-radius: 8px;
}
.toast {
  position: fixed;
  right: 24px;
  bottom: 24px;
  background: var(--ink);
  color: #fff;
  border-radius: 12px;
  padding: 14px 18px;
  transform: translateY(100px);
  opacity: 0;
  transition: 0.2s;
  z-index: 50;
}
.toast.show {
  transform: none;
  opacity: 1;
}
@media (max-width: 1000px) {
  aside {
    transform: translateX(-100%);
    transition: 0.2s;
  }
  aside.open {
    transform: none;
  }
  .admin-main {
    margin-left: 0;
  }
  #mobile-menu {
    display: block;
  }
  .dashboard,
  .editor-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}
@media (max-width: 650px) {
  .pane {
    padding: 30px 16px 70px;
  }
  .admin-main > header {
    padding: 0 14px;
  }
  .publish {
    padding: 10px;
    font-size: 12px;
  }
  .page-heading {
    align-items: start;
    flex-direction: column;
  }
  .dashboard,
  .editor-grid,
  .editor-grid.two,
  .form-grid {
    grid-template-columns: 1fr;
  }
  .edit-row {
    grid-template-columns: 1fr;
  }
  .inbox-item {
    grid-template-columns: 1fr;
  }
  .form-grid .wide {
    grid-column: auto;
  }
}
