/* LinkForge UI · Component treatments inspired by the Uiverse gallery.
 * Original implementation: shared tokens, restrained motion and clear focus.
 */

:root {
  color-scheme: light;
  font-family: Inter, "Segoe UI", "Microsoft YaHei", sans-serif;
  color: #202336;
  background: #f4f5fa;
  --surface: #ffffff;
  --surface-soft: #f7f8fc;
  --text: #202336;
  --muted: #747b91;
  --border: #e8eaf3;
  --accent: #7257eb;
  --accent-soft: #f0ecff;
  --shadow: 0 5px 24px #25295706;
}

* {
  box-sizing: border-box;
}
body {
  margin: 0;
  color: var(--text);
}
button,
input,
textarea,
select {
  font: inherit;
}
button,
input,
textarea,
select,
a {
  -webkit-tap-highlight-color: transparent;
}
button,
a {
  touch-action: manipulation;
}
button:focus-visible,
a:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible {
  outline: 3px solid #aa96ff80;
  outline-offset: 3px;
}

button {
  position: relative;
  overflow: hidden;
  isolation: isolate;
  cursor: pointer;
  padding: 11px 17px;
  border: 1px solid var(--border);
  border-radius: 11px;
  background: var(--surface);
  color: var(--text);
  font-size: 12px;
  font-weight: 550;
  line-height: 1.5;
  transition:
    transform 0.2s,
    box-shadow 0.2s,
    border-color 0.2s,
    background 0.2s;
}
button:hover {
  transform: translateY(-2px);
  border-color: #bfb0ff;
  box-shadow: 0 5px 13px #6f54dc12;
}
button:active {
  transform: translateY(0);
}
button:disabled {
  opacity: 0.58;
  cursor: progress;
  transform: none;
}
button.primary {
  border-color: transparent;
  color: white;
  background: linear-gradient(135deg, #8766f4, #6246d8);
  box-shadow:
    0 5px 13px #7450e82b,
    inset 0 1px #ffffff30;
}
button.primary::after {
  content: "";
  position: absolute;
  z-index: -1;
  inset: -90% -60%;
  transform: translateX(-80%) rotate(25deg);
  background: linear-gradient(90deg, transparent, #ffffff35, transparent);
  transition: transform 0.6s;
}
button.primary:hover {
  box-shadow: 0 8px 20px #7450e845;
}
button.primary:hover::after {
  transform: translateX(80%) rotate(25deg);
}
.danger {
  color: #cb5267;
}
.danger:hover {
  border-color: #efbac4;
  background: #fff4f6;
}

aside {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 5;
  width: 218px;
  padding: 32px 20px 24px;
  display: flex;
  flex-direction: column;
  color: #e9e9f4;
  background:
    radial-gradient(ellipse at 0 0, #34304f 0, transparent 58%), #1d1d2c;
  border-right: 1px solid #ffffff09;
}
.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  font-size: 23px;
  font-weight: 700;
  letter-spacing: -0.8px;
}
.brand > span:last-child {
  color: #b8a6ff !important;
}
.logo {
  width: 37px;
  height: 37px;
  display: grid;
  place-items: center;
  border: 1px solid #ffffff30;
  border-radius: 12px;
  background: linear-gradient(140deg, #a489ff, #7153df);
  box-shadow: 0 6px 17px #0a082d50;
  color: white;
  font-size: 26px;
}
.caption {
  margin: 13px 0 42px 49px;
  color: #85849c;
  font-size: 8px;
  letter-spacing: 2px;
  line-height: 1.8;
}
nav {
  display: grid;
  gap: 9px;
}
nav button {
  display: flex;
  align-items: center;
  text-align: left;
  color: #a9a8be;
  border: 1px solid transparent;
  background: transparent;
  padding: 13px 14px;
  font-size: 13px;
  font-weight: 500;
}
nav button:hover {
  color: white;
  background: #ffffff08;
  box-shadow: none;
  border-color: #ffffff10;
}
nav button.active {
  color: #f7f3ff;
  border-color: #b59aff22;
  background: linear-gradient(100deg, #8767e933, #8767e918);
  box-shadow: inset 3px 0 #aa8aff;
}
.navicon {
  width: 28px;
  display: inline-flex;
  align-items: center;
  font-size: 18px;
  color: #9e97bb;
}
nav .active .navicon {
  color: #bdacff;
}
.sidebottom {
  margin-top: auto;
  padding: 20px 10px 0;
  border-top: 1px solid #ffffff0b;
  color: #7f8199;
  font-size: 10px;
  line-height: 2.4;
}
.statusdot {
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #49bf9c;
  margin-right: 7px;
  box-shadow: 0 0 0 3px #49bf9c12;
}

main {
  margin-left: 218px;
  max-width: 1720px;
  padding: 0 35px 24px;
  min-height: 100vh;
  background-image: radial-gradient(#bdc0d527 0.7px, transparent 0.7px);
  background-size: 16px 16px;
}
.top {
  height: 78px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border);
  color: var(--muted);
  font-size: 11px;
}
.top #crumb {
  color: var(--text) !important;
}
.badge {
  border: 1px solid var(--border);
  border-radius: 30px;
  padding: 6px 11px;
  background: var(--surface);
  color: var(--muted);
  font-size: 10px;
  white-space: nowrap;
}
#theme {
  border-radius: 50%;
  width: 31px;
  height: 31px;
  display: grid;
  place-items: center;
  padding: 0 !important;
}
.intro {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 34px 0 28px;
}
.eyebrow {
  color: #9b8bbd;
  font-size: 9px;
  font-weight: 650;
  letter-spacing: 2.6px;
  margin-bottom: 10px;
}
h1 {
  margin: 0 0 10px;
  color: var(--text);
  font-size: clamp(24px, 2.5vw, 33px);
  letter-spacing: -1px;
  font-weight: 680;
  line-height: 1.4;
}
h2 {
  margin: 0 0 5px;
  font-size: 15px;
  font-weight: 650;
}
h3 {
  font-size: 13px;
}
p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.9;
}
#backup {
  padding: 10px 14px;
  background: var(--surface);
  flex-shrink: 0;
  font-size: 11px;
}
.stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 25px;
}
.stat {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 22px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 15px;
  box-shadow: var(--shadow);
  transition:
    transform 0.2s,
    border-color 0.2s;
}
.stat:hover {
  transform: translateY(-3px);
  border-color: #d5cbf4;
}
.stat small {
  color: var(--muted);
  font-size: 11px;
}
.stat strong {
  display: block;
  margin-top: 9px;
  font-size: 29px;
  line-height: 1.1;
  font-weight: 600;
  letter-spacing: -1px;
}
.glyph {
  display: grid;
  place-items: center;
  width: 43px;
  height: 43px;
  border: 1px solid #e9e0ff;
  border-radius: 13px;
  background: linear-gradient(140deg, #f7f2ff, #eee8ff);
  color: #9379ce;
  font-size: 22px;
}
.stat:nth-child(2) .glyph {
  background: #eff8f5;
  color: #69a995;
  border-color: #dceee7;
}
.stat:nth-child(3) .glyph {
  background: #fff7ec;
  color: #c69d63;
  border-color: #f5e6d1;
}
.grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 280px;
  gap: 21px;
  align-items: start;
}
.card {
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--surface);
  box-shadow: var(--shadow);
  overflow: hidden;
  margin-bottom: 22px;
}
.cardhead {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 21px 23px;
  border-bottom: 1px solid var(--border);
}
.body {
  padding: 22px 23px;
}
.step {
  display: inline-grid;
  place-items: center;
  width: 27px;
  height: 25px;
  margin-right: 9px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 10px;
  font-weight: 700;
  border: 1px solid #e6ddff;
  border-radius: 7px;
  vertical-align: middle;
}
.row {
  display: flex;
  align-items: center;
  gap: 9px;
  flex-wrap: wrap;
}
.between {
  justify-content: space-between;
}
.switch {
  display: flex;
  gap: 4px;
  padding: 5px;
  margin-bottom: 20px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface-soft);
}
.switch button {
  flex: 1;
  padding: 8px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  font-size: 11px;
  box-shadow: none;
  white-space: nowrap;
}
.switch button:hover {
  transform: none;
  color: var(--accent);
}
.switch button.active {
  background: var(--surface);
  color: var(--accent);
  box-shadow:
    0 2px 5px #28264b0a,
    0 0 0 1px #e6dffb;
}
label {
  display: block;
  margin-bottom: 9px;
  font-size: 11px;
  font-weight: 550;
  color: var(--text);
}
textarea,
input[type="text"],
input[type="search"],
select {
  width: 100%;
  padding: 12px 13px;
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 11px;
  background: var(--surface-soft);
  font-size: 12px;
  line-height: 1.6;
  transition:
    background 0.2s,
    border-color 0.2s,
    box-shadow 0.2s;
}
textarea:hover,
input[type="text"]:hover,
input[type="search"]:hover,
select:hover {
  border-color: #cec5ea;
}
textarea:focus,
input[type="text"]:focus,
input[type="search"]:focus,
select:focus {
  outline: none;
  border-color: #a58ae9;
  background: var(--surface);
  box-shadow: 0 0 0 3px #8c6ee713;
}
textarea::placeholder,
input::placeholder {
  color: #a1a5b5;
}
textarea {
  min-height: 150px;
  resize: vertical;
}
input[readonly] {
  color: var(--muted);
}
.help {
  font-size: 10px;
  color: var(--muted);
  line-height: 1.8;
  margin: 11px 0 18px;
}
.muted {
  color: var(--muted);
  font-size: 10px;
}
.services {
  display: grid;
  gap: 13px;
}
.checkrow {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.checkrow label {
  display: flex;
  align-items: center;
  margin: 0;
  font-size: 11px;
  font-weight: 500;
}
.checkrow input[type="checkbox"] {
  appearance: none;
  position: relative;
  flex-shrink: 0;
  width: 31px;
  height: 18px;
  margin: 0;
  border: 1px solid #dfe1ec;
  border-radius: 20px;
  background: #e7e9f1;
  cursor: pointer;
  transition: background 0.2s;
}
.checkrow input[type="checkbox"]::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: white;
  box-shadow: 0 1px 3px #28274426;
  transition: transform 0.2s;
}
.checkrow input[type="checkbox"]:checked {
  background: var(--accent);
  border-color: var(--accent);
}
.checkrow input[type="checkbox"]:checked::after {
  transform: translateX(13px);
}
input[type="checkbox"] {
  accent-color: var(--accent);
  cursor: pointer;
}
.serviceicon {
  display: inline-grid;
  place-items: center;
  width: 27px;
  height: 27px;
  margin-right: 9px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface-soft);
  color: #9685bb;
  font-size: 10px;
  font-weight: 650;
}
.tip {
  padding: 15px;
  margin-top: 20px;
  border: 1px solid #e9e0fb;
  border-radius: 12px;
  background: linear-gradient(140deg, #f6f1ff, #f4f6ff);
  color: #8b7da3;
  font-size: 10px;
  line-height: 1.9;
}
#cloudPanel {
  margin-top: 21px;
  padding: 22px;
}
#cloudPanel h3 {
  margin: 0 0 9px;
  color: #6f50b7;
}
#cloudPanel p {
  color: #8b7da3;
  font-size: 11px;
}
.tablewrap {
  max-height: 440px;
  overflow: auto;
}
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 11px;
}
th,
td {
  padding: 13px 19px;
  border-bottom: 1px solid var(--border);
}
th {
  text-align: left;
  background: var(--surface-soft);
  color: var(--muted);
  font-size: 10px;
  font-weight: 550;
  position: sticky;
  top: 0;
}
td input[type="text"] {
  min-width: 145px;
  padding: 7px;
}
tbody tr:hover {
  background: var(--surface-soft);
}
.tag {
  display: inline-flex;
  align-items: center;
  padding: 4px 8px;
  color: #8b70c0;
  background: var(--accent-soft);
  border: 1px solid #e7ddfa;
  border-radius: 6px;
  font-size: 9px;
  font-weight: 550;
}
.empty {
  padding: 42px 15px;
  color: var(--muted);
  text-align: center;
  font-size: 11px;
  line-height: 1.8;
}
.emptyicon {
  color: #b7a9d0;
  font-size: 28px;
  margin-bottom: 12px;
}
.output {
  min-height: 330px;
  background: #202132;
  border-color: #2d2d44;
  color: #d6cfe9;
  font:
    11px/1.9 Consolas,
    monospace;
  padding: 20px;
}
.output:focus {
  background: #202132;
  color: #e8dfff;
}
.section {
  display: none;
}
.section.active {
  display: block;
  animation: enter-section 0.25s ease-out;
}
.file {
  display: none;
}
.templateGrid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(215px, 1fr));
  gap: 18px;
}
.templateTile {
  position: relative;
  padding: 23px;
  overflow: hidden;
  isolation: isolate;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--surface);
  transition:
    transform 0.25s,
    border-color 0.25s,
    box-shadow 0.25s;
}
.templateTile::before {
  content: "";
  position: absolute;
  z-index: -1;
  top: -60px;
  right: -50px;
  width: 180px;
  height: 180px;
  background: radial-gradient(circle, #bd9df520, transparent 70%);
}
.templateTile:hover {
  transform: translateY(-5px);
  border-color: #c0abf4;
  box-shadow: 0 15px 25px #4431620b;
}
.templateTile.selected {
  background: linear-gradient(150deg, #fbf9ff, #f3effd);
  border-color: #b09adf;
  box-shadow: 0 0 0 3px #9172d90a;
}
.templateTile.selected::after {
  content: "✓";
  position: absolute;
  top: 20px;
  right: 20px;
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--accent);
  color: white;
  font-size: 11px;
}
.templateTile h3 {
  margin: 19px 0 10px;
  font-size: 18px;
  letter-spacing: -0.5px;
}
.templateTile p {
  min-height: 77px;
  font-size: 11px;
}
.templateTile .row {
  margin-top: 22px;
}
.templateTile button {
  font-size: 10px;
  padding: 9px 13px;
}
footer {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 4px 0 14px;
  color: #a0a4b5;
  font-size: 9px;
  line-height: 1.8;
}
#notice {
  position: fixed;
  z-index: 20;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%);
  display: none;
  max-width: 90%;
  padding: 14px 22px;
  border: 1px solid #ffffff20;
  border-radius: 12px;
  background: #29243e;
  color: #f5efff;
  box-shadow: 0 12px 40px #18102d22;
  font-size: 12px;
  line-height: 1.6;
}
dialog {
  width: min(460px, 90vw);
  max-height: 85vh;
  padding: 28px;
  border: 1px solid var(--border);
  border-radius: 19px;
  background: var(--surface);
  color: var(--text);
  box-shadow: 0 30px 100px #17122830;
}
dialog::backdrop {
  background: #14132365;
  backdrop-filter: blur(5px);
}
a {
  color: var(--accent);
}

/* A real alternate palette, without inverting page content. */
body.dark {
  color-scheme: dark;
  --surface: #242536;
  --surface-soft: #292a3d;
  --text: #e7e6f1;
  --muted: #a2a2b8;
  --border: #35364c;
  --accent: #a38af5;
  --accent-soft: #3a3054;
  background: #1d1e2d;
}
.dark .templateTile.selected {
  background: #302a43;
  border-color: #8771bb;
}
.dark .tip {
  background: #302a43;
  border-color: #433755;
  color: #c0acd8;
}
.dark #cloudPanel p,
.dark #cloudPanel h3 {
  color: #c0acd8;
}
.dark .glyph {
  background: #352e49;
  border-color: #48385e;
}
.dark .stat:nth-child(2) .glyph {
  background: #243f3a;
  border-color: #335b50;
}
.dark .stat:nth-child(3) .glyph {
  background: #41392e;
  border-color: #5c4c34;
}

@keyframes enter-section {
  from {
    opacity: 0.5;
    transform: translateY(5px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
@media (min-width: 1500px) {
  main {
    padding-left: 60px;
    padding-right: 60px;
  }
  .grid {
    grid-template-columns: minmax(0, 1fr) 320px;
  }
}
@media (max-width: 1100px) {
  aside {
    width: 192px;
    padding: 26px 15px 22px;
  }
  main {
    margin-left: 192px;
    padding-left: 25px;
    padding-right: 25px;
  }
  .brand {
    font-size: 21px;
  }
  .grid {
    grid-template-columns: minmax(0, 1fr) 260px;
    gap: 17px;
  }
  .cardhead,
  .body {
    padding: 18px;
  }
}
@media (max-width: 980px) {
  .grid {
    grid-template-columns: 1fr;
  }
  .services {
    grid-template-columns: 1fr 1fr;
    column-gap: 28px;
  }
  .intro {
    align-items: start;
  }
  .stat {
    padding: 17px;
  }
  .glyph {
    width: 32px;
    height: 32px;
    font-size: 18px;
  }
}
@media (max-width: 700px) {
  aside {
    position: relative;
    width: 100%;
    padding: 18px 17px 13px;
  }
  .brand {
    font-size: 22px;
  }
  .caption,
  .sidebottom {
    display: none;
  }
  nav {
    display: flex;
    overflow: auto;
    gap: 5px;
    padding-top: 15px;
    scrollbar-width: none;
  }
  nav button {
    flex-shrink: 0;
    padding: 10px 11px;
    font-size: 11px;
    border-radius: 9px;
  }
  nav button.active {
    box-shadow: inset 0 -2px #aa8aff;
  }
  .navicon {
    width: 21px;
    font-size: 15px;
  }
  main {
    margin-left: 0;
    padding: 0 16px 20px;
  }
  .top {
    height: 59px;
  }
  .top .badge {
    font-size: 8px;
    padding: 5px 8px;
  }
  .intro {
    gap: 12px;
    padding: 25px 0 22px;
  }
  h1 {
    font-size: 24px;
  }
  .intro p {
    font-size: 10px;
  }
  .eyebrow {
    font-size: 7px;
    letter-spacing: 1.8px;
  }
  #backup {
    font-size: 10px;
    padding: 9px;
  }
  .stats {
    gap: 8px;
    margin-bottom: 20px;
  }
  .stat {
    padding: 15px 13px;
    border-radius: 12px;
  }
  .stat small {
    font-size: 9px;
  }
  .stat strong {
    font-size: 26px;
  }
  .glyph {
    display: none;
  }
  .card {
    border-radius: 13px;
    margin-bottom: 18px;
  }
  .cardhead {
    flex-wrap: wrap;
  }
  h2 {
    font-size: 14px;
  }
  .templateGrid {
    grid-template-columns: 1fr;
  }
  .templateTile p {
    min-height: auto;
  }
  footer {
    display: block;
    line-height: 2;
  }
  td,
  th {
    padding: 11px;
  }
  #cloudPanel {
    padding: 16px;
  }
  .body > .row input {
    min-width: 100px;
  }
}
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }
}

.export-check {
  margin-bottom: 24px;
  padding: 24px;
  border: 1px solid var(--border);
  border-radius: 20px;
  background: linear-gradient(125deg, var(--surface), var(--accent-soft));
  box-shadow: var(--shadow);
}
.check-heading {
  display: flex;
  align-items: center;
  gap: 14px;
}
.check-heading h2 {
  margin: 0 0 6px;
  font-size: 16px;
}
.check-heading p,
.client-guide p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.8;
}
.check-icon {
  display: grid;
  place-items: center;
  flex: 0 0 38px;
  height: 38px;
  color: #087b60;
  background: #dff5ec;
  border-radius: 12px;
  font-size: 22px;
}
.version-pill {
  margin-left: auto;
  white-space: nowrap;
  font-size: 10px;
  color: var(--accent);
  border: 1px solid var(--border);
  border-radius: 30px;
  padding: 7px 10px;
}
.check-details {
  max-height: 260px;
  overflow: auto;
}
.check-node {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-top: 1px solid var(--border);
  padding: 14px 0;
}
.check-node:first-child {
  margin-top: 20px;
}
.check-node strong {
  display: block;
  font-size: 12px;
  overflow-wrap: anywhere;
}
.check-node small {
  display: block;
  color: var(--muted);
  font-size: 10px;
  margin-top: 5px;
}
.check-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: flex-end;
}
.check-tags em {
  font-style: normal;
  font-size: 10px;
  white-space: nowrap;
  padding: 5px 9px;
  border-radius: 6px;
  color: #087b60;
  background: #dff5ec;
}
.check-tags em.check-warning {
  color: #94600e;
  background: #fff1d9;
}
.client-guide {
  border-top: 1px solid var(--border);
  padding-top: 15px;
  margin-top: 14px;
}
.client-guide strong {
  font-size: 12px;
  margin-right: 14px;
}
.client-guide span {
  color: var(--accent);
  font-size: 12px;
}
.client-guide p {
  margin-top: 7px;
}
.output {
  tab-size: 2;
  line-height: 1.8;
}
@media (max-width: 760px) {
  .export-check {
    padding: 18px;
  }
  .version-pill {
    display: none;
  }
  .check-node {
    align-items: flex-start;
    flex-direction: column;
  }
  .check-tags {
    justify-content: flex-start;
  }
  .client-guide span {
    display: block;
    margin-top: 8px;
  }
}
