/* Fraunces and Outfit are used under the SIL Open Font License. */
@font-face {
  font-family: "Wy Display";
  src: url("/fonts/fraunces-500.woff2") format("woff2");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: "Wy Sans";
  src: url("/fonts/outfit-400.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: "Wy Sans";
  src: url("/fonts/outfit-500.woff2") format("woff2");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  --bg: #0c0b09;
  --ink: #f3efe6;
  --muted: #a39a8e;
  --faint: #746d63;
  --line: rgba(243, 239, 230, 0.16);
  --metal: #c6a36a;
  --metal-2: #ead7b4;
  --danger: #e4b4a6;
  --ok: #e0cbA6;
  color-scheme: dark;
}

* { box-sizing: border-box; }

html { background: var(--bg); }

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background:
    radial-gradient(880px 420px at 8% -8%, rgba(198, 163, 106, 0.09), transparent 58%),
    var(--bg);
  font-family: "Wy Sans", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  font-size: 16px;
  line-height: 1.65;
  font-weight: 400;
}

[hidden] { display: none !important; }

a { color: inherit; }

::selection { background: var(--metal); color: #16130e; }

:focus-visible {
  outline: 1px solid var(--metal);
  outline-offset: 3px;
}

.top {
  position: relative;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: nowrap;
  gap: 24px;
  padding: 22px 40px;
  border-bottom: 1px solid var(--line);
}

.brand-row {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
  min-width: 0;
}

.brand {
  color: inherit;
  font-family: "Wy Display", "Songti SC", "STSong", "SimSun", serif;
  font-size: 22px;
  font-weight: 500;
  letter-spacing: -0.03em;
  line-height: 1;
  text-decoration: none;
}

.free-tag {
  display: inline-flex;
  align-items: center;
  height: 20px;
  padding: 0 8px;
  border: 1px solid rgba(232, 196, 122, 0.55);
  border-radius: 999px;
  background: rgba(232, 196, 122, 0.14);
  color: #f0d7a2;
  font-family: "Wy Sans", "PingFang SC", "Microsoft YaHei", sans-serif;
  font-size: 11px;
  font-weight: 600;
  line-height: 1;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.top-nav {
  display: flex;
  align-items: center;
  flex-wrap: nowrap;
  justify-content: flex-end;
  gap: 8px 22px;
}

.lang-switch {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  margin-left: 4px;
}

.lang-switch button {
  height: 22px;
  padding: 0 6px;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 12px;
  line-height: 1;
  cursor: pointer;
}

.lang-switch button[aria-pressed="true"] {
  color: var(--ink);
  background: rgba(232, 196, 122, 0.16);
}

.desk-actions[hidden],
.desk-btn[hidden] {
  display: none !important;
}

.desk-actions {
  display: none;
  grid-template-columns: 3fr 1fr 1fr;
  gap: 8px;
  align-items: stretch;
  width: min(480px, calc(100% - 220px));
  margin-left: auto;
}

.desk-actions.is-guest {
  grid-template-columns: 3fr 1fr;
}

.desk-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  height: 36px;
  min-height: 36px;
  margin: 0;
  padding: 0 8px;
  border: 1px solid rgba(232, 196, 122, 0.5);
  border-radius: 8px;
  background: transparent;
  color: #f3efe6;
  font-family: "Wy Sans", "PingFang SC", "Microsoft YaHei", sans-serif;
  font-size: 14px;
  font-weight: 500;
  line-height: 1;
  letter-spacing: 0;
  text-align: center;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
}

.desk-btn:hover {
  border-color: #f0c36a;
  color: #fff;
  background: rgba(232, 196, 122, 0.12);
}

body.is-desktop .nav-toggle,
body.is-desktop .top-nav {
  display: none !important;
}

body.is-desktop .desk-actions {
  display: grid;
}

body.is-desktop .top {
  gap: 16px;
}

.top-nav a {
  color: var(--muted);
  font-size: 14px;
  text-decoration: none;
  white-space: nowrap;
}

.top-nav a:hover { color: var(--ink); }

.top-nav a[aria-current="page"] {
  color: var(--ink);
  box-shadow: inset 0 -2px 0 var(--metal);
}

.nav-toggle {
  display: none;
  margin-left: auto;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 2px;
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-size: 14px;
  line-height: 1.2;
  cursor: pointer;
}

.nav-toggle:hover { border-color: var(--metal); color: var(--metal-2); }

.home,
.sheet,
.tool {
  width: min(1120px, calc(100% - 80px));
  margin: 0 auto;
  padding: 72px 0 108px;
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(280px, 0.8fr);
  gap: 80px;
  align-items: end;
}

h1, h2, .who, .canvas-title {
  font-family: "Wy Display", "Songti SC", "STSong", "SimSun", serif;
  font-weight: 500;
  letter-spacing: -0.03em;
}

h1 {
  margin: 0;
  font-size: clamp(52px, 7vw, 92px);
  line-height: 0.96;
}

h2 {
  margin: 72px 0 8px;
  font-size: 28px;
}

.lede {
  max-width: 36em;
  margin: 22px 0 0;
  color: var(--muted);
  font-size: 17px;
}

.eyebrow {
  margin: 0 0 14px;
  color: var(--metal);
  font-size: 12px;
  letter-spacing: 0.16em;
}

.who {
  margin: 0;
  font-size: 28px;
  line-height: 1.25;
}

label {
  display: block;
  margin-top: 20px;
  color: var(--muted);
  font-size: 13px;
}

input, select {
  display: block;
  width: 100%;
  margin-top: 6px;
  padding: 10px 0;
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  background: transparent;
  color: var(--ink);
  font: inherit;
}

input:focus, select:focus {
  outline: none;
  border-bottom-color: var(--metal);
}

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

button, .solid {
  font-family: "Wy Sans", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  font-size: 14px;
  font-weight: 500;
  line-height: 1.2;
}

button {
  padding: 12px 16px;
  border: 1px solid var(--line);
  border-radius: 2px;
  background: transparent;
  color: var(--ink);
  cursor: pointer;
}

button:hover { border-color: var(--metal); color: var(--metal-2); }

button:disabled { opacity: 0.45; cursor: progress; }

button.quiet {
  padding-left: 0;
  padding-right: 0;
  border-color: transparent;
  color: var(--faint);
}

.solid {
  display: inline-flex;
  align-items: center;
  padding: 12px 16px;
  border-radius: 2px;
  background: var(--ink);
  color: #14120f;
  text-decoration: none;
}

.solid:hover { background: var(--metal-2); }

.hint {
  margin: 18px 0 0;
  color: var(--faint);
  font-size: 13px;
  line-height: 1.6;
}

.status {
  min-height: 1.5em;
  margin: 12px 0 0;
  font-size: 14px;
  white-space: pre-wrap;
}

.status.is-ok { color: var(--metal-2); }

.status.is-error { color: var(--danger); }

.routes { margin-top: 28px; }

.route {
  display: grid;
  grid-template-columns: minmax(140px, 240px) minmax(0, 1fr);
  gap: 28px;
  align-items: baseline;
  padding: 22px 0;
  border-top: 1px solid var(--line);
  color: inherit;
  text-decoration: none;
}

.route span {
  font-family: "Wy Display", "Songti SC", "STSong", "SimSun", serif;
  font-size: 30px;
  letter-spacing: -0.03em;
}

.route small {
  color: var(--muted);
  font-size: 14px;
}

.route:hover span { color: var(--metal-2); }

.sheet { width: min(680px, calc(100% - 80px)); }

.sheet h1 { font-size: clamp(42px, 6vw, 68px); }

.studio + .studio { margin-top: 56px; }

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

.studio-head h1 { font-size: clamp(36px, 5vw, 60px); }

.meta { margin: 0; color: var(--faint); font-size: 13px; }

.canvas {
  min-height: 460px;
  padding: 8px 28px 28px;
  border: 1px solid var(--line);
  border-radius: 2px;
}

.canvas.empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 48px 24px;
  text-align: center;
}

.canvas-title {
  margin: 0;
  font-size: clamp(32px, 4vw, 48px);
}

.files {
  width: 100%;
  margin: 0;
  padding: 0;
  list-style: none;
}

.files li {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 18px;
  align-items: baseline;
  padding: 18px 0;
  border-bottom: 1px solid var(--line);
}

.files .name {
  font-family: "Wy Display", "Songti SC", "STSong", "SimSun", serif;
  font-size: 26px;
}

.files .fmt, .files time { color: var(--muted); font-size: 13px; }

.gate { max-width: 640px; }

.gate .solid { margin-top: 28px; }

body.bridge {
  display: grid;
  place-items: center;
  padding: 32px;
}

body.bridge p {
  margin: 0;
  font-family: "Wy Display", "Songti SC", "STSong", "SimSun", serif;
  font-size: clamp(28px, 4vw, 42px);
  letter-spacing: -0.03em;
}

body.page-home {
  background:
    radial-gradient(920px 520px at 12% -12%, rgba(231, 194, 122, 0.28), transparent 58%),
    radial-gradient(640px 420px at 100% 0%, rgba(90, 140, 180, 0.16), transparent 52%),
    #171513;
  color: #f8f3ea;
}

body.page-home .top {
  background: rgba(28, 25, 22, 0.92);
  border-bottom-color: rgba(255, 255, 255, 0.14);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.38);
}

body.page-home .top-nav a { color: #f0e6d6; }
body.page-home .top-nav a:hover { color: #fff; }
body.page-home .top-nav a[aria-current="page"] {
  color: #fff;
  box-shadow: inset 0 -2px 0 #f0c36a;
}

body.page-home .lede,
body.page-home .route small { color: #f0e4d2; }

body.page-home .panel {
  padding: 22px 22px 18px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 18px;
  background: linear-gradient(180deg, #3a342e 0%, #2a261f 100%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.2),
    0 14px 28px rgba(0, 0, 0, 0.38),
    0 32px 70px rgba(0, 0, 0, 0.42);
}

body.page-home .field-group {
  margin-top: 16px;
  padding: 14px 14px 16px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 14px;
  background: #1c1916;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.06),
    0 10px 22px rgba(0, 0, 0, 0.32);
}

body.page-home .group-title {
  margin: 0;
  color: #fff;
  font-size: 15px;
  font-weight: 650;
}

body.page-home .eyebrow { color: #f0c36a; }

body.page-home label {
  color: #f7f1e6;
  font-size: 14px;
  font-weight: 600;
}

body.page-home .field-group input {
  margin-top: 8px;
  padding: 12px 12px;
  border: 1px solid #b7ab9a;
  border-radius: 10px;
  background: #0f0e0c;
  color: #fff;
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.55), 0 0 0 1px rgba(255, 255, 255, 0.04);
}

body.page-home .field-group input:focus {
  border-color: #f0c36a;
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.55), 0 0 0 3px rgba(240, 195, 106, 0.35);
}

body.page-home .hint { color: #efe4d2; }

body.page-home .status.is-ok { color: #ffe3a3; }
body.page-home .status.is-error { color: #ffb1a1; }

body.page-home .primary,
body.page-home .solid {
  border: 0;
  border-radius: 10px;
  background: #f0c36a;
  color: #1b140b;
  font-weight: 700;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.45),
    0 8px 16px rgba(0, 0, 0, 0.35);
}

body.page-home .primary:hover,
body.page-home .solid:hover {
  background: #ffd78a;
  color: #1b140b;
}

body.page-home #send,
body.page-home #login {
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 10px;
  background: #4a433b;
  color: #fff;
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.28);
}

body.page-home #send:hover,
body.page-home #login:hover {
  border-color: #f0c36a;
  color: #fff;
}

body.page-home .routes {
  margin-top: 28px;
  padding: 6px 22px 10px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 16px;
  background: #241f1b;
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.34);
}

body.page-home .route { border-top-color: rgba(255, 255, 255, 0.14); }
body.page-home .route span { color: #fff; }

.block { margin-top: 48px; }
.block h2 { margin: 0 0 10px; font-size: clamp(28px, 4vw, 36px); }
.steps { margin: 12px 0 0; padding-left: 1.2em; color: var(--muted); }
.steps li { margin: 6px 0; }
.snippet {
  margin: 14px 0 0;
  padding: 14px 16px;
  max-width: 100%;
  overflow-x: auto;
  border: 1px solid var(--line);
  background: rgba(0, 0, 0, 0.28);
  color: var(--ink);
  font-family: ui-monospace, "Cascadia Code", "Sarasa Mono SC", Consolas, monospace;
  font-size: 13px;
  line-height: 1.55;
  white-space: pre-wrap;
  word-break: break-word;
}
.sheet-copy { width: min(880px, calc(100% - 80px)); }
.bridge-stage {
  display: grid;
  place-items: center;
  min-height: calc(100vh - 92px);
  padding: 32px;
}
.bridge-stage p {
  margin: 0;
  font-family: "Wy Display", "Songti SC", "STSong", "SimSun", serif;
  font-size: clamp(28px, 4vw, 42px);
  letter-spacing: -0.03em;
}

@media (max-width: 860px) {
  .top { padding: 18px 20px; }
  .home, .sheet, .tool, .sheet-copy { width: min(1120px, calc(100% - 40px)); padding-top: 40px; }
  .hero-grid { grid-template-columns: 1fr; gap: 42px; align-items: start; }
  .route, .files li { grid-template-columns: 1fr; gap: 4px; }
  .studio-head { display: block; }
  .canvas { min-height: 320px; padding-left: 16px; padding-right: 16px; }
}

@media (max-width: 720px) {
  .nav-toggle { display: inline-flex; }
  .top-nav {
    display: none;
    position: absolute;
    z-index: 30;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 6px 20px 14px;
    background: #14120f;
    border-bottom: 1px solid var(--line);
  }
  .top-nav.is-open { display: flex; }
  .top-nav a { padding: 10px 0; }
  body.page-home .top-nav { background: #1c1916; }
  html, body { overflow-x: hidden; }
}
