:root {
  --bg: #06101c;
  --panel: rgba(22, 31, 50, 0.92);
  --panel-soft: rgba(30, 43, 65, 0.72);
  --panel-line: rgba(154, 175, 202, 0.18);
  --text: #f4fbff;
  --muted: #b7c4d6;
  --soft: #7f91a8;
  --mint: #66e3cf;
  --mint-deep: #3ebba9;
  --code: #0d1625;
  --shadow: 0 28px 90px rgba(0, 0, 0, 0.48);
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  min-height: 100%;
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--text);
  background:
    linear-gradient(135deg, rgba(80, 227, 194, 0.14), transparent 34%),
    linear-gradient(320deg, rgba(74, 104, 161, 0.18), transparent 42%),
    linear-gradient(180deg, #061522 0%, #07101d 48%, #050a14 100%);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", Arial, sans-serif;
  letter-spacing: 0;
}

button,
a,
input,
textarea,
summary {
  font: inherit;
}

.page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 32px 18px;
}

.installer {
  position: relative;
  width: min(780px, 100%);
  overflow: hidden;
  padding: 42px;
  border: 1px solid var(--panel-line);
  border-radius: 26px;
  background:
    linear-gradient(120deg, rgba(41, 78, 80, 0.62) 0%, rgba(24, 33, 52, 0.88) 46%, rgba(24, 29, 48, 0.94) 100%);
  box-shadow: var(--shadow), inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.admin-shell {
  width: min(880px, 100%);
}

.installer::before {
  position: absolute;
  inset: 0;
  pointer-events: none;
  content: "";
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.08), transparent 28%, transparent 74%, rgba(255, 255, 255, 0.04));
}

.install-head,
.steps,
.bookmark-zone,
.manager {
  position: relative;
}

.step-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 16px;
  padding: 8px 13px;
  border: 1px solid rgba(102, 227, 207, 0.26);
  border-radius: 999px;
  color: var(--mint);
  background: rgba(102, 227, 207, 0.08);
  font-size: 13px;
  font-weight: 900;
}

.step-label span {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--mint);
  box-shadow: 0 0 16px rgba(102, 227, 207, 0.9);
}

h1 {
  max-width: 680px;
  margin: 0;
  font-size: 50px;
  line-height: 1.14;
  font-weight: 950;
}

.lead {
  max-width: 700px;
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.7;
}

.manager-link {
  position: relative;
  display: inline-flex;
  margin-top: 14px;
  color: var(--mint);
  text-decoration: none;
  font-size: 13px;
  font-weight: 850;
}

.manager-link:hover {
  text-decoration: underline;
}

.inline-link {
  margin-top: 12px;
}

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

.step-card {
  min-height: 194px;
  padding: 20px;
  border: 1px solid var(--panel-line);
  border-radius: 18px;
  background: linear-gradient(145deg, rgba(34, 55, 73, 0.64), rgba(29, 34, 55, 0.72));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.step-title {
  display: flex;
  align-items: center;
  gap: 10px;
}

.number {
  display: inline-grid;
  width: 32px;
  height: 32px;
  place-items: center;
  border-radius: 50%;
  color: #07372f;
  background: linear-gradient(180deg, #83f4df, var(--mint));
  font-size: 16px;
  font-weight: 950;
  box-shadow: 0 8px 22px rgba(102, 227, 207, 0.22);
}

.step-card h2 {
  margin: 0;
  font-size: 18px;
  line-height: 1.35;
}

.step-card p {
  margin: 17px 0 0;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.75;
}

.shortcuts {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
}

kbd {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 6px 12px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 999px;
  color: #f7fbff;
  background: rgba(9, 17, 31, 0.64);
  box-shadow: inset 0 -1px 0 rgba(255, 255, 255, 0.08);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 12px;
  font-weight: 800;
}

.bookmark-zone {
  display: grid;
  margin-top: 18px;
  padding: 22px 20px 26px;
  border: 1px dashed rgba(102, 227, 207, 0.34);
  border-radius: 20px;
  background: rgba(9, 17, 31, 0.36);
}

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

.zone-head h2 {
  margin: 0;
  font-size: 19px;
}

.zone-head span {
  color: var(--soft);
  font-size: 13px;
  font-weight: 850;
}

.bookmark-list {
  display: grid;
  gap: 12px;
}

.bookmark-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  padding: 16px;
  border: 1px solid rgba(154, 175, 202, 0.18);
  border-radius: 16px;
  background: rgba(17, 28, 46, 0.72);
}

.bookmark-copy h3 {
  margin: 0;
  font-size: 17px;
  line-height: 1.35;
}

.bookmark-copy p {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.65;
}

.bookmark-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  justify-items: end;
  gap: 10px;
  min-width: 220px;
}

.install-actions .bookmarklet {
  grid-column: 1 / -1;
}

.bookmark-actions .button {
  width: 100%;
  min-height: 36px;
  padding: 8px 12px;
  font-size: 13px;
}

.bookmarklet {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 208px;
  min-height: 58px;
  padding: 15px 28px;
  border-radius: 999px;
  color: #ffffff;
  background: linear-gradient(135deg, #72ead7, #43bca9 62%, #38a390);
  box-shadow: 0 18px 44px rgba(66, 201, 180, 0.28), inset 0 1px 0 rgba(255, 255, 255, 0.32);
  text-decoration: none;
  font-size: 18px;
  font-weight: 950;
  cursor: grab;
}

.bookmarklet:active {
  cursor: grabbing;
}

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

.bookmark-zone .status {
  min-height: 24px;
  margin: 14px 0 0;
  color: var(--soft);
  font-size: 13px;
  line-height: 1.7;
  text-align: center;
}

.identity {
  display: inline-flex;
  align-items: center;
  justify-self: center;
  gap: 9px;
  margin-top: 12px;
  color: var(--soft);
  font-size: 12px;
  font-weight: 800;
}

.identity::before,
.identity::after {
  width: 54px;
  height: 1px;
  content: "";
  background: linear-gradient(90deg, transparent, rgba(183, 196, 214, 0.28));
}

.identity::after {
  background: linear-gradient(90deg, rgba(183, 196, 214, 0.28), transparent);
}

.identity img {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
}

.empty-state {
  margin: 0;
  padding: 18px;
  border: 1px solid rgba(154, 175, 202, 0.18);
  border-radius: 16px;
  color: var(--muted);
  background: rgba(17, 28, 46, 0.72);
  text-align: center;
}

.auth-card,
.manager-box {
  position: relative;
  margin-top: 18px;
  padding: 20px;
  border: 1px solid var(--panel-line);
  border-radius: 18px;
  background: rgba(9, 17, 31, 0.36);
}

.auth-card h2,
.manager-box h2 {
  margin: 0 0 14px;
  font-size: 20px;
}

.admin-panel {
  position: relative;
  display: grid;
  gap: 14px;
  margin-top: 18px;
}

.admin-top-actions {
  margin-bottom: 0;
}

.admin-actions {
  align-self: stretch;
}

.status {
  min-height: 24px;
  margin: 12px 0 0;
  color: var(--soft);
  font-size: 13px;
  line-height: 1.7;
}

.manager {
  margin-top: 14px;
  color: var(--muted);
}

.manager summary {
  display: inline-flex;
  cursor: pointer;
  color: var(--mint);
  font-size: 13px;
  font-weight: 850;
}

.manager[open] {
  padding: 16px;
  border: 1px solid var(--panel-line);
  border-radius: 16px;
  background: rgba(9, 17, 31, 0.38);
}

.manager-form,
.config-tools {
  display: grid;
  gap: 12px;
  margin-top: 14px;
}

.config-tools {
  padding-top: 14px;
  border-top: 1px solid rgba(154, 175, 202, 0.18);
}

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

label span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 850;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 14px 0 12px;
}

.button {
  min-height: 42px;
  padding: 10px 15px;
  border: 1px solid rgba(183, 196, 214, 0.28);
  border-radius: 999px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.07);
  cursor: pointer;
  font-weight: 850;
}

.button.primary {
  color: #063a31;
  border-color: transparent;
  background: var(--mint);
}

.button.danger {
  color: #fecaca;
  border-color: rgba(248, 113, 113, 0.36);
}

input,
textarea {
  width: 100%;
  border: 1px solid rgba(183, 196, 214, 0.18);
  border-radius: 12px;
  padding: 12px 13px;
  color: #dce7f5;
  background: var(--code);
  outline: none;
}

textarea {
  min-height: 118px;
  resize: vertical;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 12px;
  line-height: 1.6;
}

input:focus,
textarea:focus {
  border-color: rgba(102, 227, 207, 0.46);
  box-shadow: 0 0 0 3px rgba(102, 227, 207, 0.08);
}

@media (max-width: 760px) {
  .installer {
    padding: 30px 22px;
    border-radius: 22px;
  }

  h1 {
    font-size: 39px;
  }

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

  .bookmark-card {
    grid-template-columns: 1fr;
  }

  .bookmark-actions {
    justify-items: stretch;
    min-width: 0;
  }
}

@media (max-width: 480px) {
  .page {
    align-items: start;
    padding: 14px;
  }

  .installer {
    padding: 24px 16px;
    border-radius: 18px;
  }

  h1 {
    font-size: 30px;
  }

  .title-tail {
    display: block;
  }

  .lead,
  .step-card p {
    font-size: 14px;
  }

  .step-card {
    min-height: 0;
    padding: 18px;
  }

  .bookmarklet {
    width: 100%;
    min-width: 0;
    font-size: 17px;
  }

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

  .identity::before,
  .identity::after {
    width: 24px;
  }

  .actions {
    display: grid;
  }
}
