:root {
  color-scheme: light;
  font-family: "Microsoft YaHei", "PingFang SC", Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
}

button,
input,
textarea {
  font: inherit;
}

.landing-body {
  min-height: 100vh;
  min-height: 100svh;
  background: #0f172a;
  overflow-x: hidden;
}

.landing-page {
  width: 100vw;
  min-width: 100vw;
  min-height: 100vh;
  min-height: 100dvh;
  min-height: 100svh;
  display: grid;
  place-items: center;
  padding: 0;
  background:
    linear-gradient(135deg, rgba(15, 23, 42, 0.68), rgba(127, 29, 29, 0.44)),
    var(--landing-bg, linear-gradient(135deg, #0f172a, #b91c1c));
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  overflow: hidden;
}

.clickable-page {
  cursor: pointer;
}

.landing-content {
  position: relative;
  width: 100vw;
  max-width: none;
  min-height: 100vh;
  min-height: 100dvh;
  min-height: 100svh;
  display: grid;
  place-items: center;
  padding: max(22px, env(safe-area-inset-top)) 20px max(24px, env(safe-area-inset-bottom));
  overflow: hidden;
  text-align: center;
  color: #ffffff;
}

.landing-content.has-main-image {
  min-height: 100vh;
  min-height: 100dvh;
  min-height: 100svh;
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.18);
}

.main-image {
  position: absolute;
  inset: 0;
  z-index: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

.landing-copy {
  position: relative;
  z-index: 1;
  width: min(100%, 360px);
  display: grid;
  justify-items: center;
  gap: 10px;
  padding: 14px 8px;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.48);
}

.landing-content h1 {
  margin: 0 0 14px;
  max-width: 100%;
  font-size: clamp(20px, 6vw, 34px);
  line-height: 1.16;
  letter-spacing: 0;
  overflow-wrap: anywhere;
}

.landing-content p {
  margin: 0 auto 8px;
  max-width: 24em;
  font-size: clamp(13px, 3.8vw, 17px);
  line-height: 1.45;
  color: rgba(255, 255, 255, 0.88);
  overflow-wrap: anywhere;
}

.cta-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: min(100%, 240px);
  min-height: 48px;
  padding: 12px 22px;
  border-radius: 8px;
  text-decoration: none;
  font-weight: 700;
  font-size: clamp(14px, 4vw, 16px);
  box-shadow: 0 14px 30px rgba(0, 0, 0, 0.28);
  overflow-wrap: anywhere;
}

@media (orientation: landscape) and (max-height: 520px) {
  .landing-content {
    width: 100vw;
    min-height: 100svh;
    padding: 12px;
  }

  .landing-copy {
    gap: 6px;
    padding: 8px;
  }

  .landing-content h1 {
    font-size: clamp(18px, 4vh, 26px);
    margin-bottom: 4px;
  }

  .landing-content p {
    font-size: clamp(12px, 3vh, 14px);
    line-height: 1.3;
  }

  .cta-button {
    width: min(100%, 210px);
    min-height: 40px;
    padding: 9px 16px;
  }
}

.admin-body {
  min-height: 100vh;
  color: #172033;
  background: #f4f7fb;
}

.topbar {
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 0 24px;
  background: #ffffff;
  border-bottom: 1px solid #dfe7f1;
}

.brand {
  color: #111827;
  text-decoration: none;
  font-weight: 800;
}

.nav {
  display: flex;
  align-items: center;
  gap: 16px;
}

.nav a,
.link-button {
  color: #31517a;
  border: 0;
  background: transparent;
  text-decoration: none;
  cursor: pointer;
}

.admin-shell {
  width: min(1180px, calc(100% - 32px));
  margin: 24px auto 48px;
}

.messages {
  display: grid;
  gap: 10px;
  margin-bottom: 16px;
}

.message {
  padding: 12px 14px;
  border-radius: 8px;
  border: 1px solid #d5dfeb;
  background: #ffffff;
}

.message.success {
  border-color: #8fd7a5;
  background: #eefbf2;
}

.message.error {
  border-color: #f2a1a1;
  background: #fff1f1;
}

.panel,
.metric {
  background: #ffffff;
  border: 1px solid #dfe7f1;
  border-radius: 8px;
  box-shadow: 0 8px 20px rgba(20, 32, 55, 0.05);
}

.panel {
  padding: 24px;
  margin-top: 18px;
}

.login-panel {
  width: min(420px, 100%);
  margin: 80px auto;
}

.panel h1,
.panel h2 {
  margin: 0 0 18px;
}

.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.section-head h1 {
  margin: 0;
}

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

.metric {
  padding: 18px;
}

.metric span {
  display: block;
  color: #68758a;
  margin-bottom: 8px;
}

.metric strong {
  font-size: 30px;
}

.form-stack,
.settings-form {
  display: grid;
  gap: 18px;
}

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

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

label span {
  color: #46566d;
  font-weight: 700;
}

input,
textarea,
select {
  width: 100%;
  border: 1px solid #cbd6e3;
  border-radius: 8px;
  padding: 11px 12px;
  background: #ffffff;
  color: #172033;
}

input[type="color"] {
  height: 44px;
  padding: 4px;
}

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

.toggle-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.toggle-row input {
  width: auto;
}

.primary-button,
.secondary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 10px 16px;
  border-radius: 8px;
  border: 1px solid transparent;
  cursor: pointer;
  text-decoration: none;
  font-weight: 700;
}

.primary-button {
  background: #0f766e;
  color: #ffffff;
}

.secondary-button {
  background: #eef5ff;
  color: #24507f;
  border-color: #c9ddf5;
}

.table-wrap {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
}

th,
td {
  padding: 12px 10px;
  text-align: left;
  border-bottom: 1px solid #e5ecf4;
}

th {
  color: #52627a;
  background: #f8fafc;
}

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

.manager-layout {
  display: grid;
  grid-template-columns: 320px minmax(0, 1fr);
  gap: 18px;
  margin-top: 18px;
}

.page-list {
  align-self: start;
  position: sticky;
  top: 18px;
}

.quick-create {
  display: grid;
  gap: 10px;
  margin-bottom: 16px;
}

.page-links {
  display: grid;
  gap: 10px;
}

.page-links a {
  display: grid;
  gap: 4px;
  padding: 12px;
  color: #172033;
  text-decoration: none;
  border: 1px solid #e1e9f2;
  border-radius: 8px;
  background: #fbfdff;
}

.page-links a.active {
  border-color: #0f766e;
  background: #eefbf8;
}

.page-links span,
.hint-box span {
  color: #66758a;
}

.actions-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.hint-box {
  display: grid;
  gap: 8px;
  margin-top: 18px;
  padding: 14px;
  border: 1px solid #d5e3f3;
  border-radius: 8px;
  background: #f7fbff;
}

.hint-box code {
  display: block;
  padding: 10px;
  overflow-x: auto;
  color: #0f3a5f;
  border-radius: 8px;
  background: #ffffff;
}

.danger-form {
  margin-top: 18px;
}

.danger-button {
  min-height: 40px;
  padding: 9px 14px;
  color: #b42318;
  border: 1px solid #f3b7b0;
  border-radius: 8px;
  background: #fff4f2;
  cursor: pointer;
}

.inline-filter select {
  min-height: 42px;
  padding: 9px 12px;
  border: 1px solid #cbd6e3;
  border-radius: 8px;
  background: #ffffff;
}

.work-area {
  display: grid;
  gap: 18px;
}

.work-area .panel {
  margin-top: 0;
}

.muted {
  color: #66758a;
}

.inline-create {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr)) auto;
  gap: 10px;
  align-items: end;
  margin-bottom: 16px;
}

.channel-create {
  grid-template-columns: repeat(5, minmax(0, 1fr)) auto;
}

.row-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}

.row-actions form {
  margin: 0;
}

.copy-code {
  display: block;
  max-width: 420px;
  padding: 8px;
  overflow-x: auto;
  border-radius: 8px;
  color: #0f3a5f;
  background: #f7fbff;
  border: 1px solid #dbe8f6;
  white-space: nowrap;
}

.activity-list {
  display: grid;
  gap: 10px;
}

.activity-item {
  display: grid;
  gap: 4px;
  padding: 12px;
  border: 1px solid #e1e9f2;
  border-radius: 8px;
  background: #fbfdff;
}

.activity-item span,
.activity-item small,
.empty {
  color: #66758a;
}

.library-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 22px;
}

.library-hero h1 {
  margin: 4px 0 10px;
}

.eyebrow {
  margin: 0;
  color: #0f766e;
  font-weight: 800;
}

.library-summary {
  display: grid;
  place-items: center;
  min-width: 116px;
  min-height: 96px;
  border: 1px solid #cfe3ef;
  border-radius: 8px;
  background: #f7fbff;
}

.library-summary strong {
  font-size: 38px;
  line-height: 1;
}

.library-summary span {
  color: #66758a;
}

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

.template-card {
  display: grid;
  gap: 16px;
  padding: 22px;
  border: 1px solid #dfe7f1;
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 8px 20px rgba(20, 32, 55, 0.05);
}

.template-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.template-card h2,
.template-card h3,
.template-card p {
  margin: 0;
}

.template-card h2 {
  margin-top: 5px;
  font-size: 22px;
}

.template-card h3 {
  margin-bottom: 6px;
  font-size: 15px;
  color: #46566d;
}

.template-card small {
  color: #66758a;
}

.template-kind,
.badge {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 4px 9px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 800;
}

.template-kind {
  color: #0f5e57;
  background: #e8f7f4;
}

.badge {
  color: #7a4b00;
  background: #fff2d5;
}

.template-info {
  display: grid;
  gap: 4px;
}

.template-info p {
  color: #334155;
  line-height: 1.55;
}

.asset-list {
  display: grid;
  overflow: hidden;
  border: 1px solid #e1e9f2;
  border-radius: 8px;
}

.asset-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  padding: 10px 12px;
  border-bottom: 1px solid #e8eef6;
  background: #fbfdff;
}

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

.asset-row span {
  color: #46566d;
}

.asset-row strong {
  color: #172033;
  white-space: nowrap;
}

.warning-note {
  padding: 12px;
  border: 1px solid #f1dfb6;
  border-radius: 8px;
  background: #fffbeb;
}

hr {
  width: 100%;
  border: 0;
  border-top: 1px solid #e4ebf3;
}

@media (max-width: 760px) {
  .topbar {
    height: auto;
    align-items: flex-start;
    flex-direction: column;
    padding: 16px;
  }

  .nav {
    flex-wrap: wrap;
  }

  .dashboard-grid,
  .form-grid,
  .two-panels,
  .manager-layout,
  .inline-create,
  .channel-create,
  .template-grid {
    grid-template-columns: 1fr;
  }

  .library-hero,
  .template-card-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .page-list {
    position: static;
  }

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

  .panel {
    padding: 18px;
  }
}
