:root {
  color-scheme: light;
  --ink: #151714;
  --muted: #74786f;
  --paper: #f3f2ed;
  --card: #fff;
  --line: #dedfd8;
  --accent: #1d5b45;
  --accent-soft: #e2eee8;
  --danger: #a43a32;
}

* {
  box-sizing: border-box;
}

html,
body {
  min-width: 320px;
  min-height: 100%;
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family:
    Inter, "PingFang SC", "Microsoft YaHei", system-ui, -apple-system, sans-serif;
  -webkit-font-smoothing: antialiased;
}

button,
input {
  font: inherit;
}

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

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

.admin-login {
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    linear-gradient(135deg, rgba(29, 91, 69, 0.08), transparent 42%),
    radial-gradient(circle at 80% 10%, #fff 0, transparent 32%),
    var(--paper);
}

.admin-login-card {
  width: min(420px, 100%);
  padding: 42px;
  border: 1px solid var(--line);
  border-radius: 28px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 30px 90px rgba(25, 30, 24, 0.1);
}

.admin-mark {
  display: grid;
  width: 62px;
  height: 62px;
  place-items: center;
  overflow: hidden;
  border-radius: 20px;
  color: #fff;
  background: var(--ink);
  background-position: center;
  background-repeat: no-repeat;
  background-size: contain;
  font-family: Georgia, serif;
  font-size: 28px;
}

.admin-mark.small {
  width: 42px;
  height: 42px;
  border-radius: 14px;
  font-size: 19px;
}

.admin-mark.has-image {
  border: 1px solid var(--line);
  background-color: #fff;
  color: transparent;
}

.eyebrow {
  margin: 24px 0 8px;
  color: var(--accent);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.18em;
}

.admin-login h1,
.page-heading h1 {
  margin: 0;
  font-family: Georgia, "Songti SC", serif;
  font-weight: 500;
}

.admin-login h1 {
  font-size: clamp(26px, 6vw, 36px);
}

.intro {
  margin: 10px 0 28px;
  color: var(--muted);
  font-size: 14px;
}

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

.admin-login label + label {
  margin-top: 16px;
}

label > span {
  color: #555a52;
  font-size: 12px;
  font-weight: 600;
}

input {
  width: 100%;
  height: 50px;
  padding: 0 15px;
  border: 1px solid var(--line);
  border-radius: 13px;
  outline: 0;
  background: #fbfbf8;
  transition:
    border-color 160ms ease,
    box-shadow 160ms ease;
}

input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(29, 91, 69, 0.1);
}

.primary-button {
  height: 50px;
  border: 0;
  border-radius: 13px;
  color: #fff;
  background: var(--ink);
  font-weight: 600;
  cursor: pointer;
}

.primary-button:disabled {
  cursor: wait;
  opacity: 0.55;
}

.admin-login .primary-button {
  width: 100%;
  margin-top: 22px;
}

.form-message {
  min-height: 20px;
  margin: 10px 0 0;
  color: var(--accent);
  font-size: 12px;
}

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

.back-link {
  display: block;
  margin-top: 10px;
  color: var(--muted);
  font-size: 12px;
  text-align: center;
  text-decoration: none;
}

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

.admin-header {
  position: sticky;
  z-index: 10;
  top: 0;
  display: flex;
  min-height: 74px;
  align-items: center;
  justify-content: space-between;
  padding: 12px max(24px, calc((100vw - 1120px) / 2));
  border-bottom: 1px solid rgba(222, 223, 216, 0.9);
  background: rgba(243, 242, 237, 0.88);
  backdrop-filter: blur(18px);
}

.admin-identity,
.header-actions {
  display: flex;
  align-items: center;
}

.admin-identity {
  gap: 12px;
}

.admin-identity div:last-child {
  display: grid;
  gap: 2px;
}

.admin-identity p {
  margin: 0;
  color: var(--muted);
  font-size: 10px;
  letter-spacing: 0.12em;
}

.admin-identity strong {
  font-family: Georgia, serif;
}

.header-actions {
  gap: 8px;
}

.header-actions a,
.header-actions button {
  height: 38px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 11px;
  color: var(--ink);
  background: #fff;
  font-size: 12px;
  line-height: 36px;
  text-decoration: none;
  cursor: pointer;
}

.admin-content {
  width: min(1120px, calc(100% - 48px));
  margin: 0 auto;
  padding: 58px 0 80px;
}

.page-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  margin-bottom: 28px;
}

.page-heading .eyebrow {
  margin-top: 0;
}

.page-heading h1 {
  font-size: clamp(34px, 5vw, 54px);
}

.page-heading > div > p:last-child {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 14px;
}

.status-pill {
  padding: 9px 13px;
  border-radius: 999px;
  color: var(--accent);
  background: var(--accent-soft);
  font-size: 11px;
  font-weight: 700;
}

#settingsForm {
  display: grid;
  gap: 14px;
}

.settings-card {
  display: grid;
  grid-template-columns: minmax(220px, 0.8fr) minmax(300px, 1.35fr);
  gap: 50px;
  padding: 32px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: var(--card);
}

.card-copy {
  display: flex;
  gap: 16px;
  align-items: flex-start;
}

.section-number {
  display: grid;
  flex: 0 0 auto;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 50%;
  color: var(--accent);
  background: var(--accent-soft);
  font-family: Georgia, serif;
  font-size: 12px;
}

.card-copy h2 {
  margin: 4px 0 8px;
  font-family: Georgia, "Songti SC", serif;
  font-size: 21px;
  font-weight: 500;
}

.card-copy p,
.logo-editor p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.7;
}

.card-fields {
  display: grid;
  gap: 20px;
}

.two-column {
  grid-template-columns: 1fr 1fr;
}

.logo-editor {
  display: grid;
  grid-template-columns: 90px 1fr;
  gap: 18px;
  align-items: center;
  padding: 18px;
  border: 1px dashed #cfd1c8;
  border-radius: 16px;
  background: #fafaf7;
}

.logo-preview {
  display: grid;
  width: 90px;
  height: 90px;
  place-items: center;
  overflow: hidden;
  border-radius: 24px;
  color: white;
  background: var(--ink);
  background-position: center;
  background-repeat: no-repeat;
  background-size: contain;
  font-family: Georgia, serif;
  font-size: 38px;
}

.logo-preview.has-image {
  border: 1px solid var(--line);
  background-color: white;
  color: transparent;
}

.logo-editor strong {
  display: block;
  margin-bottom: 5px;
  font-size: 13px;
}

.logo-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.upload-button,
.text-button {
  min-height: 34px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--ink);
  background: #fff;
  font-size: 11px;
  cursor: pointer;
}

.text-button {
  color: var(--muted);
}

.save-bar {
  position: sticky;
  z-index: 5;
  bottom: 14px;
  display: flex;
  min-height: 72px;
  align-items: center;
  justify-content: flex-end;
  gap: 20px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 18px 50px rgba(25, 30, 24, 0.1);
  backdrop-filter: blur(18px);
}

.save-bar .form-message {
  margin: 0;
}

.save-button {
  min-width: 170px;
  padding: 0 22px;
  background: var(--accent);
}

@media (max-width: 760px) {
  .admin-login-card {
    padding: 30px 24px;
  }

  .admin-header {
    padding-right: 14px;
    padding-left: 14px;
  }

  .header-actions a {
    display: none;
  }

  .admin-content {
    width: min(100% - 24px, 680px);
    padding-top: 32px;
  }

  .page-heading {
    align-items: flex-start;
  }

  .status-pill {
    margin-top: 4px;
  }

  .settings-card {
    grid-template-columns: 1fr;
    gap: 24px;
    padding: 24px 18px;
  }

  .two-column {
    grid-template-columns: 1fr;
  }

  .logo-editor {
    grid-template-columns: 72px 1fr;
    padding: 14px;
  }

  .logo-preview {
    width: 72px;
    height: 72px;
    border-radius: 20px;
  }

  .save-bar {
    justify-content: space-between;
  }

  .save-button {
    min-width: 150px;
  }
}

@media (max-width: 430px) {
  .page-heading .status-pill {
    display: none;
  }

  .logo-editor {
    grid-template-columns: 1fr;
  }

  .save-bar {
    display: grid;
  }

  .save-button {
    width: 100%;
  }
}
