/*
文件名：style.css
所属软件：ModelRelay V0.1.0
著作权人：Charlie
说明：定义站点布局、排版和响应式样式。
*/

:root {
  color-scheme: light;
  --paper: #f8f6f0;
  --ink: #24231f;
  --muted: #665f55;
  --line: #ded8ce;
  --accent: #aa392e;
  --accent-dark: #8d2c23;
  --panel: #252522;
  --panel-line: #494842;
  --mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, Consolas, monospace;
  font-family:
    "Instrument Sans", "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  color: var(--ink);
  background: var(--paper);
}

* {
  box-sizing: border-box;
}
body {
  margin: 0;
}
a {
  color: inherit;
  text-decoration: none;
}
button,
input {
  font: inherit;
}
button {
  cursor: pointer;
}
:focus-visible {
  outline: 2px solid #cf5d4c;
  outline-offset: 3px;
}
[hidden] {
  display: none !important;
}

.container {
  width: min(1160px, calc(100% - 96px));
  margin-inline: auto;
}
.section-rule,
.site-header {
  border-block-start: 1px solid var(--line);
}
.site-header {
  border-block-start: 0;
  border-block-end: 1px solid var(--line);
}
.header-inner,
.footer-inner {
  min-height: 73px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  font-size: 23px;
  font-weight: 750;
  letter-spacing: -0.055em;
}
.brand-period {
  color: var(--accent);
}
.brand-mark {
  display: grid;
  grid-template-columns: repeat(2, 8px);
  gap: 3px;
  transform: rotate(-12deg);
}
.brand-mark i {
  width: 8px;
  height: 8px;
  border-radius: 2px;
  background: currentColor;
  color: var(--accent);
}
.brand-mark i:last-child {
  opacity: 0.46;
}
nav {
  display: flex;
  gap: 34px;
  font-size: 14px;
  color: var(--muted);
}
nav a:hover {
  color: var(--accent);
}
.header-inner .console-link {
  min-height: 34px;
  white-space: nowrap;
}

.hero {
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: center;
  gap: clamp(28px, 5vw, 80px);
  padding-block: clamp(58px, 7vw, 112px);
}
.hero h1 {
  margin: 0;
  font-size: clamp(42px, 5.4vw, 80px);
  font-weight: 740;
  line-height: 1.12;
  letter-spacing: -0.075em;
}
.hero h1 em {
  color: var(--accent);
  font-style: normal;
}
.hero-copy p {
  max-width: 24em;
  margin: 25px 0 28px;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.8;
}
.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.button {
  display: inline-flex;
  min-height: 45px;
  align-items: center;
  gap: 14px;
  padding: 0 16px;
  border: 1px solid transparent;
  border-radius: 7px;
  font-size: 14px;
  font-weight: 650;
}
.button-primary {
  background: var(--accent);
  color: #fff;
}
.button-primary:hover {
  background: var(--accent-dark);
}
.button-secondary {
  border-color: var(--line);
}
.button-secondary:hover {
  background: #ede8dd;
}

.route-panel,
.code-panel {
  min-width: 0;
  color: #f7f4e8;
  background: var(--panel);
  border: 1px solid #30302c;
  border-radius: 14px;
  overflow: hidden;
}
.route-panel {
  box-shadow: 0 16px 36px #2d211b1c;
}
.panel-header,
.panel-footer {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 14px 18px;
  font: 11px var(--mono);
}
.panel-header {
  color: #d1ccbd;
  border-bottom: 1px solid var(--panel-line);
  letter-spacing: 0.09em;
}
.panel-dots {
  display: flex;
  gap: 4px;
}
.panel-dots i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #77726a;
}
.panel-tag {
  margin-left: auto;
  color: #d1ccbd;
  letter-spacing: normal;
}
.route-flow {
  display: grid;
  grid-template-columns:
    minmax(74px, 1fr) 21px minmax(100px, 1.15fr)
    28px minmax(76px, 1fr);
  align-items: center;
  padding: 29px clamp(12px, 2vw, 26px);
  background-image: radial-gradient(#80766b55 1px, transparent 1px);
  background-position: center;
  background-size: 15px 15px;
}
.route-input,
.route-gateway,
.route-models span {
  display: flex;
  align-items: center;
  gap: 8px;
  border: 1px solid #59574f;
  background: #2f2e2a;
  border-radius: 7px;
  font-size: 12px;
  white-space: nowrap;
}
.route-input {
  min-height: 44px;
  justify-content: center;
}
.route-input span:first-child {
  color: #cbc1aa;
  font: 13px var(--mono);
}
.route-line {
  border-top: 1px solid #a27c70;
}
.route-gateway {
  justify-content: center;
  min-height: 60px;
  background: #432e29;
  border-color: #a56251;
}
.route-gateway .brand-mark {
  grid-template-columns: repeat(2, 5px);
  gap: 2px;
}
.route-gateway .brand-mark i {
  width: 5px;
  height: 5px;
  color: #f69c82;
  border-radius: 1px;
}
.route-gateway small {
  display: block;
  margin-top: 3px;
  color: #f0c4b2;
  font-size: 10px;
}
.route-branches {
  display: grid;
  grid-template-rows: repeat(3, 43px);
}
.route-branches i {
  align-self: center;
  height: 1px;
  background: #a27c70;
}
.route-branches i:first-child,
.route-branches i:last-child {
  width: 50%;
  justify-self: end;
  position: relative;
}
.route-branches i:first-child::before,
.route-branches i:last-child::before {
  position: absolute;
  content: "";
  height: 43px;
  border-left: 1px solid #a27c70;
}
.route-branches i:last-child::before {
  bottom: 0;
}
.route-models {
  display: grid;
  grid-auto-rows: 33px;
  gap: 10px;
}
.route-models span {
  padding-inline: 9px;
}
.route-dot {
  width: 7px;
  height: 7px;
  flex: 0 0 7px;
  border-radius: 50%;
}
.mint {
  background: #c4dfca;
  color: #284b34;
}
.peach {
  background: #f2c4ae;
  color: #703a28;
}
.lilac {
  background: #ded4f6;
  color: #51377e;
}
.blue {
  background: #d9e6f7;
  color: #234775;
}
.panel-footer {
  border-top: 1px solid var(--panel-line);
  color: #e3ded1;
}
.panel-footer span {
  color: #f5a590;
}
.panel-footer code,
.code-panel pre {
  font-family: var(--mono);
}

.section-inner {
  padding-block: 48px 56px;
}
h2 {
  margin: 0;
  font-size: clamp(27px, 3.4vw, 40px);
  font-weight: 740;
  letter-spacing: -0.055em;
}
.section-inner p {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.75;
}
.catalog {
  margin-top: 23px;
  background: #fcfaf5;
  border: 1px solid var(--line);
  border-radius: 11px;
  overflow: hidden;
}
.catalog-tools {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
}
.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 3px;
  flex-basis: 100%;
}
.filters button,
.code-header button {
  border: 0;
  background: transparent;
  border-radius: 5px;
  font-size: 13px;
  font-weight: 620;
}
.filters button {
  min-height: 33px;
  padding-inline: 9px;
  color: var(--muted);
}
.filters button:hover {
  background: #f0eae1;
}
.filters button[aria-pressed="true"] {
  background: #f3e2d9;
  color: #852e25;
}
.search-field {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 10px;
  min-height: 36px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 6px;
}
.search-field:focus-within {
  outline: 2px solid #cf5d4c;
  outline-offset: 2px;
}
.search-icon {
  position: relative;
  width: 12px;
  height: 12px;
  border: 1.5px solid var(--muted);
  border-radius: 50%;
  flex: 0 0 auto;
}
.search-icon::after {
  position: absolute;
  content: "";
  width: 5px;
  border-bottom: 1.5px solid var(--muted);
  transform: rotate(45deg);
  inset: 9px auto auto 8px;
}
.search-field input {
  width: min(218px, 100%);
  padding: 7px 2px;
  border: 0;
  background: transparent;
  color: var(--ink);
  font-size: 13px;
  outline: 0;
}
.table-scroll {
  max-height: 33rem;
  overflow: auto;
}
table {
  width: 100%;
  min-width: 735px;
  border-collapse: collapse;
  text-align: left;
  font-size: 14px;
}
thead {
  background: #f0ede5;
  color: var(--muted);
}
thead th {
  position: sticky;
  top: 0;
  background: #f0ede5;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}
td,
th {
  padding: 11px 16px;
}
tbody tr + tr {
  border-top: 1px solid var(--line);
}
tbody th {
  width: 28%;
  font-weight: 680;
  overflow-wrap: anywhere;
}
tbody td {
  color: var(--muted);
}
tbody td:last-child {
  white-space: nowrap;
}
.model-price {
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
tbody th small,
tbody td:last-child span {
  display: block;
}
tbody th small {
  color: var(--muted);
  font-weight: 400;
}
.price-note,
#model-count {
  color: var(--muted);
  font-size: 13px;
}
#model-count {
  margin: 0;
}
.catalog .empty-message {
  margin: 0;
  padding: 22px 16px;
}

.docs-grid {
  display: grid;
  grid-template-columns: minmax(210px, 0.65fr) minmax(0, 1fr);
  gap: clamp(20px, 6vw, 80px);
  align-items: start;
}
.docs-grid > div:first-child {
  max-width: 25em;
}
.docs-note {
  margin-top: 20px;
  padding-left: 11px;
  border-left: 2px solid #c45f4e;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.65;
}
.docs-link {
  display: inline-block;
  margin-top: 16px;
}
.docs-link,
.cc-switch-guide a {
  color: var(--accent-dark);
  text-decoration: underline;
  text-underline-offset: 3px;
}
.cc-switch-guide {
  padding-bottom: clamp(32px, 5vw, 56px);
  scroll-margin-top: 24px;
}
.cc-switch-guide h3,
.client-guide h4 {
  margin: 0;
}
.cc-switch-guide h3 {
  font-size: clamp(20px, 4vw, 28px);
}
.cc-switch-guide p,
.client-guide li {
  line-height: 1.65;
}
.client-guides {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 285px), 1fr));
  gap: 14px;
}
.client-guide {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 10px;
}
.client-guide ol {
  margin-bottom: 0;
  padding-left: 1.35em;
}
.client-guide li + li {
  margin-top: 10px;
}
.client-guide p {
  margin: 14px 0 0;
  color: var(--muted);
  font-size: 14px;
}
.client-guide code {
  font: 0.9em var(--mono);
  overflow-wrap: anywhere;
}
.code-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  padding: 9px 12px;
  border-bottom: 1px solid var(--panel-line);
}
.code-options {
  display: flex;
  gap: 4px;
}
.code-header button {
  padding: 7px 10px;
  color: #d7d1c3;
}
.code-header button[aria-pressed="true"],
.code-header button:hover {
  background: #42403a;
  color: #fff;
}
.code-panel pre {
  margin: 0;
  padding: 15px 16px 18px;
  overflow-x: auto;
  color: #f3d8b6;
  font-size: 12px;
  line-height: 1.75;
}
.footer-inner {
  color: var(--muted);
  font-size: 12px;
}
.footer-inner .brand {
  font-size: 18px;
  color: var(--ink);
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

@media (max-width: 880px) {
  .container {
    width: calc(100% - 56px);
  }
}

@media (max-width: 780px) {
  .container {
    width: calc(100% - 36px);
  }
  .header-inner {
    min-height: 63px;
    gap: 10px;
  }
  .header-inner .brand {
    font-size: 19px;
    gap: 7px;
  }
  nav {
    gap: 13px;
    font-size: 12px;
  }
  .header-inner .console-link {
    padding-inline: 9px;
    gap: 5px;
    font-size: 12px;
  }
  .hero {
    grid-template-columns: 1fr;
    padding-block: 45px 38px;
  }
  .hero h1 {
    font-size: clamp(37px, 9vw, 55px);
  }
  .hero-copy p {
    margin-block: 16px 20px;
  }
  .section-inner {
    padding-block: 32px 40px;
  }
  .docs-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 365px) {
  nav a:last-child {
    display: none;
  }
  .route-flow {
    grid-template-columns:
      minmax(58px, 1fr) 12px minmax(90px, 1.1fr)
      16px minmax(66px, 1fr);
  }
  .route-input,
  .route-gateway {
    gap: 4px;
  }
  td,
  th {
    padding-inline: 10px;
  }
}
