:root {
  color-scheme: light;
  --paper: #f3ede1;
  --paper-soft: #fff9ee;
  --ink: #10231c;
  --ink-muted: rgba(16, 35, 28, 0.66);
  --ink-faint: rgba(16, 35, 28, 0.38);
  --jade: #2f7d5d;
  --jade-dark: #173c31;
  --gold: #b38d55;
  --line: rgba(16, 35, 28, 0.16);
  --shadow: 0 20px 70px rgba(26, 41, 32, 0.16), 0 2px 12px rgba(26, 41, 32, 0.08);
  --serif: "Songti SC", "Noto Serif CJK SC", "STSong", "SimSun", Georgia, serif;
  --sans: ui-sans-serif, -apple-system, BlinkMacSystemFont, "SF Pro Text", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
  text-rendering: geometricPrecision;
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  font-family: var(--sans);
  background:
    linear-gradient(180deg, rgba(243, 237, 225, 0.3), rgba(243, 237, 225, 0.88)),
    url("/assets/ink-jade-bg.png") top right / cover no-repeat,
    var(--paper);
  overflow-x: hidden;
}

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

a {
  color: inherit;
  text-decoration: none;
}

.ambient {
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(circle at 24% 24%, rgba(255, 252, 242, 0.78), transparent 34%),
    radial-gradient(circle at 70% 38%, rgba(47, 125, 93, 0.08), transparent 36%),
    linear-gradient(90deg, rgba(243, 237, 225, 0.88), rgba(243, 237, 225, 0.2));
  mix-blend-mode: soft-light;
}

.site-shell {
  position: relative;
  z-index: 1;
  width: min(100%, 1280px);
  min-height: 100svh;
  margin: 0 auto;
  padding: max(26px, env(safe-area-inset-top)) clamp(22px, 5vw, 72px)
    max(24px, env(safe-area-inset-bottom));
  display: grid;
  grid-template-rows: auto 1fr auto auto;
}

.masthead {
  display: grid;
  gap: clamp(54px, 9vw, 96px);
  padding-top: clamp(22px, 5vw, 48px);
}

.seal {
  width: 42px;
  height: 42px;
  display: inline-grid;
  place-items: center;
  border: 1px solid rgba(23, 60, 49, 0.48);
  border-radius: 999px;
  color: var(--jade-dark);
  font-family: Georgia, serif;
  font-size: 27px;
  line-height: 1;
  letter-spacing: -0.08em;
  background: rgba(255, 251, 240, 0.28);
  box-shadow: inset 0 0 0 5px rgba(255, 251, 240, 0.2);
  transition:
    transform 180ms cubic-bezier(0.2, 0, 0, 1),
    box-shadow 180ms cubic-bezier(0.2, 0, 0, 1);
}

.seal:active {
  transform: scale(0.96);
}

.hero {
  max-width: 620px;
}

.domain {
  margin: 0 0 10px;
  color: rgba(23, 60, 49, 0.78);
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(26px, 8vw, 50px);
  letter-spacing: 0.16em;
  line-height: 1;
  overflow-wrap: normal;
}

h1 {
  margin: 0;
  font-family: var(--serif);
  font-size: clamp(58px, 19vw, 168px);
  font-weight: 500;
  line-height: 0.94;
  letter-spacing: 0.03em;
  text-wrap: balance;
}

.headline {
  position: relative;
  width: fit-content;
  margin: clamp(30px, 7vw, 48px) 0 0;
  padding-top: 22px;
  font-family: var(--serif);
  font-size: clamp(25px, 6.8vw, 43px);
  letter-spacing: 0.38em;
  line-height: 1.25;
}

.headline::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  width: min(58vw, 380px);
  height: 1px;
  background: linear-gradient(90deg, var(--jade), rgba(23, 60, 49, 0.14));
}

.headline::after {
  content: "";
  position: absolute;
  left: 0;
  top: -4px;
  width: 9px;
  height: 9px;
  border-radius: 999px;
  background: var(--jade);
  box-shadow: 0 0 0 5px rgba(47, 125, 93, 0.12);
}

.intro {
  max-width: 28em;
  margin: 20px 0 0;
  color: var(--ink-muted);
  font-family: var(--serif);
  font-size: clamp(15px, 3.8vw, 19px);
  line-height: 1.9;
  letter-spacing: 0.1em;
  text-wrap: pretty;
}

.index-panel {
  position: relative;
  margin-top: clamp(64px, 13vh, 130px);
  padding-left: clamp(70px, 17vw, 150px);
}

.rail {
  position: absolute;
  left: clamp(46px, 10vw, 84px);
  top: 7px;
  bottom: 28px;
  width: 1px;
  background: linear-gradient(
    180deg,
    transparent,
    rgba(23, 60, 49, 0.32) 8%,
    rgba(23, 60, 49, 0.28) 72%,
    transparent
  );
}

.link-list {
  display: grid;
}

.service-row {
  position: relative;
  min-height: clamp(142px, 28vw, 192px);
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 20px;
  padding: 26px 0 30px;
  border-bottom: 1px solid var(--line);
  opacity: 0;
  transform: translateY(14px);
  animation: rise 560ms cubic-bezier(0.2, 0, 0, 1) forwards;
  animation-delay: var(--delay, 0ms);
}

.service-row:last-child {
  border-bottom-color: rgba(16, 35, 28, 0.08);
}

.service-row:focus-visible {
  outline: 2px solid rgba(47, 125, 93, 0.7);
  outline-offset: 10px;
  border-radius: 18px;
}

.service-row::before {
  content: "";
  position: absolute;
  inset: 14px -14px;
  z-index: -1;
  border-radius: 30px;
  background: rgba(255, 252, 241, 0);
  box-shadow: none;
  transition:
    background-color 220ms cubic-bezier(0.2, 0, 0, 1),
    box-shadow 220ms cubic-bezier(0.2, 0, 0, 1),
    transform 220ms cubic-bezier(0.2, 0, 0, 1);
}

.service-row:hover::before,
.service-row:focus-visible::before {
  background: rgba(255, 252, 241, 0.5);
  box-shadow: var(--shadow);
  transform: translateY(-2px);
}

.service-row:active::before {
  transform: scale(0.96);
}

.number {
  position: absolute;
  left: calc(-1 * clamp(70px, 17vw, 150px));
  top: 50%;
  transform: translateY(-50%);
  width: clamp(46px, 10vw, 86px);
  color: rgba(23, 60, 49, 0.88);
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(43px, 11vw, 72px);
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.node {
  position: absolute;
  left: calc(-1 * clamp(24px, 7vw, 66px));
  top: 50%;
  width: 19px;
  height: 19px;
  transform: translate(-50%, -50%);
  border: 1px solid rgba(23, 60, 49, 0.5);
  border-radius: 999px;
  background: rgba(245, 239, 225, 0.8);
  box-shadow:
    inset 0 0 0 5px rgba(47, 125, 93, 0.18),
    0 2px 9px rgba(23, 60, 49, 0.2);
}

.service-main {
  min-width: 0;
  display: grid;
  gap: 9px;
}

.service-title {
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(45px, 12vw, 80px);
  font-weight: 600;
  line-height: 0.98;
  letter-spacing: -0.045em;
}

.service-subtitle {
  font-family: var(--serif);
  font-size: clamp(20px, 5.2vw, 30px);
  letter-spacing: 0.28em;
}

.service-domain {
  display: inline-flex;
  min-height: 32px;
  align-items: center;
  gap: 11px;
  color: var(--ink-muted);
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(12px, 3.35vw, 18px);
  letter-spacing: 0.035em;
  overflow-wrap: anywhere;
}

.status-dot {
  width: 10px;
  height: 10px;
  flex: 0 0 auto;
  border-radius: 999px;
  background: var(--jade);
  box-shadow: 0 0 0 5px rgba(47, 125, 93, 0.11);
}

.arrow {
  width: clamp(58px, 15vw, 76px);
  height: clamp(58px, 15vw, 76px);
  display: grid;
  place-items: center;
  border-radius: 999px;
  color: var(--jade-dark);
  background: rgba(255, 252, 241, 0.55);
  box-shadow:
    0 16px 32px rgba(26, 41, 32, 0.14),
    inset 0 0 0 1px rgba(23, 60, 49, 0.13);
  transition:
    transform 180ms cubic-bezier(0.2, 0, 0, 1),
    background-color 180ms cubic-bezier(0.2, 0, 0, 1);
}

.arrow svg {
  width: 31px;
  height: 31px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.service-row:hover .arrow,
.service-row:focus-visible .arrow {
  transform: translateX(5px);
  background: rgba(255, 252, 241, 0.78);
}

.skeleton {
  pointer-events: none;
}

.skeleton h2,
.skeleton p {
  margin: 0;
}

.add-entry {
  width: fit-content;
  min-height: 42px;
  margin: 22px 0 0 auto;
  padding: 0 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 0;
  border-radius: 999px;
  color: rgba(23, 60, 49, 0.48);
  background: rgba(255, 252, 241, 0.12);
  font-family: var(--serif);
  font-size: 13px;
  letter-spacing: 0.16em;
  cursor: pointer;
  box-shadow: inset 0 0 0 1px rgba(23, 60, 49, 0.08);
  transition:
    transform 180ms cubic-bezier(0.2, 0, 0, 1),
    color 180ms cubic-bezier(0.2, 0, 0, 1),
    background-color 180ms cubic-bezier(0.2, 0, 0, 1),
    box-shadow 180ms cubic-bezier(0.2, 0, 0, 1);
}

.add-entry:hover,
.add-entry:focus-visible {
  color: rgba(23, 60, 49, 0.82);
  background: rgba(255, 252, 241, 0.46);
  box-shadow: inset 0 0 0 1px rgba(23, 60, 49, 0.14);
}

.add-entry:active {
  transform: scale(0.96);
}

.add-mark {
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(23, 60, 49, 0.2);
  border-radius: 999px;
  font-family: Georgia, serif;
  font-size: 18px;
  line-height: 1;
  letter-spacing: 0;
}

.site-footer {
  margin-top: clamp(56px, 9vh, 96px);
  width: fit-content;
  margin-inline: auto;
  padding: 8px 14px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 13px;
  color: rgba(16, 35, 28, 0.58);
  background: rgba(255, 252, 241, 0.22);
  border-radius: 999px;
  box-shadow: inset 0 0 0 1px rgba(255, 252, 241, 0.16);
  font-family: var(--serif);
  font-size: clamp(13px, 3.2vw, 16px);
  letter-spacing: 0.24em;
  text-align: center;
}

.footer-dot {
  width: 5px;
  height: 5px;
  border-radius: 999px;
  background: currentColor;
}

.config-dialog {
  width: min(calc(100% - 32px), 560px);
  padding: 0;
  border: 0;
  border-radius: 28px;
  color: var(--ink);
  background: transparent;
}

.config-dialog::backdrop {
  background: rgba(8, 20, 16, 0.46);
  backdrop-filter: blur(8px);
}

.dialog-card {
  padding: 24px;
  border-radius: 28px;
  background: rgba(255, 250, 238, 0.94);
  box-shadow: 0 30px 90px rgba(8, 20, 16, 0.34);
}

.dialog-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
}

.dialog-kicker {
  margin: 0 0 8px;
  color: var(--jade);
  font-size: 13px;
  letter-spacing: 0.18em;
}

.dialog-card h2 {
  margin: 0;
  font-family: var(--serif);
  font-size: 28px;
  font-weight: 500;
}

.icon-button {
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 999px;
  color: var(--ink);
  background: rgba(23, 60, 49, 0.08);
  font-size: 27px;
  cursor: pointer;
}

.dialog-copy {
  color: var(--ink-muted);
  line-height: 1.8;
  text-wrap: pretty;
}

code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

pre {
  margin: 18px 0;
  padding: 18px;
  overflow-x: auto;
  border-radius: 18px;
  background: rgba(16, 35, 28, 0.92);
  color: #f7f0e5;
  font-size: 13px;
  line-height: 1.7;
}

.copy-button {
  width: 100%;
  min-height: 48px;
  border: 0;
  border-radius: 999px;
  color: #fffaf0;
  background: var(--jade-dark);
  font-size: 15px;
  letter-spacing: 0.08em;
  cursor: pointer;
  transition:
    transform 180ms cubic-bezier(0.2, 0, 0, 1),
    background-color 180ms cubic-bezier(0.2, 0, 0, 1);
}

.copy-button:active {
  transform: scale(0.96);
}

@keyframes rise {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (min-width: 760px) {
  body {
    background-size: cover;
  }

  .site-shell {
    grid-template-columns: minmax(500px, 0.96fr) minmax(520px, 0.9fr);
    grid-template-rows: 1fr auto;
    column-gap: clamp(42px, 6vw, 82px);
    align-items: center;
  }

  .masthead {
    align-self: start;
  }

  .domain {
    max-width: none;
    font-size: clamp(38px, 4vw, 50px);
    letter-spacing: 0.13em;
    white-space: nowrap;
  }

  h1 {
    font-size: clamp(118px, 11vw, 154px);
  }

  .index-panel {
    margin-top: 0;
    padding-left: 118px;
    align-self: center;
  }

  .rail {
    left: 74px;
  }

  .number {
    left: -118px;
    width: 78px;
    font-size: clamp(56px, 4.8vw, 70px);
  }

  .node {
    left: -44px;
  }

  .service-row {
    min-height: 210px;
    gap: 28px;
  }

  .service-title {
    font-size: clamp(62px, 5.6vw, 80px);
  }

  .service-domain {
    max-width: 24ch;
    font-size: 18px;
    letter-spacing: 0.04em;
    overflow-wrap: normal;
    word-break: normal;
  }

  .add-entry {
    grid-column: 2;
    justify-self: end;
  }

  .site-footer {
    grid-column: 1 / -1;
  }
}

@media (max-width: 430px) {
  body {
    background-position: 54% top;
    background-size: auto 100%;
  }

  .site-shell {
    padding-inline: 24px;
  }

  .masthead {
    gap: 50px;
  }

  .domain {
    font-size: clamp(25px, 7vw, 30px);
  }

  h1 {
    font-size: clamp(64px, 20vw, 82px);
  }

  .index-panel {
    margin-top: 58px;
    padding-left: 76px;
  }

  .rail {
    left: 52px;
  }

  .service-row {
    min-height: 150px;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 14px;
  }

  .number {
    left: -76px;
    width: 52px;
  }

  .node {
    left: -24px;
  }

  .arrow {
    width: 58px;
    height: 58px;
  }

  .site-footer {
    color: rgba(243, 237, 225, 0.82);
  }
}

@media (max-width: 360px) {
  .site-shell {
    padding-inline: 18px;
  }

  .index-panel {
    padding-left: 62px;
  }

  .rail {
    left: 42px;
  }

  .number {
    left: -62px;
    font-size: 39px;
  }

  .node {
    left: -20px;
  }

  .service-title {
    font-size: 40px;
  }

  .service-domain {
    font-size: 13px;
  }

  .arrow {
    width: 50px;
    height: 50px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 1ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: 1ms !important;
  }
}
