/*
 * KEYS V2 DevTools 模板适配层。
 * 基座参考：hannah-wright/saas-landing-page-template 的 DevTools HTML 模板（MIT）。
 * 本文件只保留模板结构、设计 token 和 KEYS 业务适配；不依赖外部 CDN。
 */

:root {
  --keys-subtle: #f6f7f9;
  --keys-mono: "JetBrains Mono", "Cascadia Code", Consolas, monospace;
  --keys-topbar-height: 78px;
}

html,
body.keys-app-body {
  width: 100%;
  height: 100%;
  min-height: 100%;
  overflow: hidden;
  background: #fafafa;
}

body.keys-app-body {
  color: var(--keys-ink);
  font-family: Inter, "Segoe UI", "Microsoft YaHei", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body.keys-app-body::before,
body.keys-app-body::after,
.keys-app::before,
.keys-app::after {
  display: none;
}

body.keys-app-body.keys-app-lock {
  overflow: hidden;
}

.keys-app,
.keys-app-main,
.keys-view,
.keys-page,
.keys-shell-container {
  height: auto;
  min-height: auto;
  max-height: none;
  overflow: visible;
}

.keys-app {
  height: 100dvh;
  min-height: 0;
  overflow: hidden;
  background: transparent;
}

.keys-app-main {
  height: calc(100dvh - var(--keys-topbar-height));
  min-height: 0;
  overflow: auto;
  padding: 0;
}

.keys-app-topbar.keys-template-topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  height: var(--keys-topbar-height);
  padding: 0;
  border-bottom: 1px solid var(--keys-line);
  background: #fff;
  box-shadow: none;
  backdrop-filter: none;
}

.keys-template-topbar-inner {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) auto minmax(220px, 1fr);
  width: min(var(--keys-content-max), calc(100% - 32px));
  height: 100%;
  margin: 0 auto;
  align-items: center;
  gap: 18px;
}

.keys-app-brand.keys-template-brand {
  justify-self: start;
  gap: 10px;
  color: var(--keys-ink);
  text-decoration: none;
}

.keys-app-brand.keys-template-brand .keys-app-brand-mark {
  display: inline-grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 8px;
  background: transparent;
  box-shadow: none;
}

.keys-app-brand.keys-template-brand .keys-app-brand-mark img {
  width: 26px;
  height: 26px;
  object-fit: contain;
}

.keys-app-brand-text strong {
  color: var(--keys-ink);
  font-size: 17px;
  letter-spacing: 0;
}

.keys-app-brand-text span {
  color: var(--keys-muted);
}

.keys-app-nav.keys-template-nav {
  grid-column: 2;
  justify-self: center;
  width: max-content;
  max-width: min(760px, 100%);
  justify-content: center;
  gap: 6px;
}

.keys-app-nav a,
.keys-nav-action,
.keys-center-entry,
.keys-icon-button {
  min-height: 40px;
  border-radius: 8px;
  color: #5f6673;
  background: transparent;
  border: 1px solid transparent;
  font-size: 14px;
  transition: background 160ms ease, color 160ms ease, border-color 160ms ease;
}

.keys-app-nav a:hover,
.keys-nav-action:hover,
.keys-center-entry:hover,
.keys-icon-button:hover,
.keys-app-nav a.is-active,
.keys-center-entry.is-active {
  color: var(--keys-brand);
  border-color: rgba(110, 15, 75, 0.18);
  background: var(--keys-brand-soft);
}

.keys-nav-action em {
  background: var(--keys-success);
  color: #fff;
}

.keys-template-actions {
  justify-self: end;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.keys-icon-button {
  width: 42px;
  height: 42px;
}

.keys-language-menu-wrap {
  position: relative;
}

.keys-language-button {
  display: inline-flex;
  min-height: 40px;
  flex-wrap: nowrap;
  align-items: center;
  gap: 7px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: #5f6673;
  padding: 0 12px;
  font-size: 14px;
  font-weight: 700;
  white-space: nowrap;
}

.keys-language-button .keys-language-flag {
  display: block;
  width: 22px;
  height: 15px;
  flex: 0 0 22px;
  overflow: hidden;
  border: 1px solid rgba(21, 22, 34, 0.12);
  border-radius: 2px;
  background: transparent;
}

.keys-language-button .keys-language-flag svg {
  display: block;
  width: 100%;
  height: 100%;
}

.keys-language-button:hover,
.keys-language-button[aria-expanded="true"] {
  border-color: rgba(110, 15, 75, 0.18);
  background: var(--keys-brand-soft);
  color: var(--keys-brand);
}

.keys-language-menu {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  z-index: 80;
  display: grid;
  min-width: 190px;
  gap: 6px;
  padding: 8px;
  border: 1px solid var(--keys-line);
  border-radius: 10px;
  background: #fff;
  box-shadow: var(--keys-shadow);
}

.keys-language-menu[hidden] {
  display: none;
}

.keys-language-menu button {
  display: grid;
  gap: 2px;
  min-height: 48px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: var(--keys-ink);
  padding: 8px 10px;
  text-align: left;
}

.keys-language-menu button small {
  color: var(--keys-muted);
}

.keys-language-menu button:hover,
.keys-language-menu button[aria-checked="true"] {
  border-color: rgba(110, 15, 75, 0.18);
  background: var(--keys-brand-soft);
  color: var(--keys-brand);
}

sl-card.keys-template-card {
  display: block;
  color: inherit;
}

sl-card.keys-template-card::part(base) {
  overflow: hidden;
  border: 1px solid var(--keys-line);
  border-radius: var(--keys-radius);
  background: #fff;
  box-shadow: none;
}

sl-card.keys-template-card::part(body) {
  padding: 24px;
}

sl-card.keys-app-card::part(base),
sl-card.keys-detail-panel::part(base),
sl-card.keys-auth-panel::part(base),
sl-card.keys-register-panel::part(base),
sl-card.keys-personal-status::part(base),
sl-card.keys-personal-actions::part(base),
sl-card.keys-personal-apps::part(base) {
  height: 100%;
}

sl-card.keys-app-card::part(body) {
  display: flex;
  min-height: 100%;
  flex-direction: column;
  gap: 16px;
}

sl-card.keys-detail-panel::part(body),
sl-card.keys-auth-panel::part(body),
sl-card.keys-register-panel::part(body),
sl-card.keys-personal-status::part(body),
sl-card.keys-personal-actions::part(body),
sl-card.keys-personal-apps::part(body),
sl-card.keys-account-guide::part(body),
sl-card.keys-account-choice-head::part(body) {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

sl-tag::part(base) {
  border-radius: 999px;
  font-weight: 700;
}

.keys-template-page {
  border-inline: 1px solid rgba(228, 231, 236, 0.72);
}

.keys-shell-container.keys-template-container {
  width: min(1200px, calc(100% - 48px));
  margin: 0 auto;
  padding: 42px 0 70px;
}

.keys-template-page-head {
  display: grid;
  max-width: 820px;
  margin: 0 0 28px;
  padding: 0;
  gap: 10px;
  background: transparent;
  border: 0;
  box-shadow: none;
}

.keys-template-page-head h1,
.keys-home-copy h1 {
  color: var(--keys-ink);
  font-weight: 800;
  letter-spacing: -0.02em;
}

.keys-template-page-head h1 {
  font-size: clamp(30px, 3vw, 42px);
  line-height: 1.05;
}

.keys-template-page-head p {
  max-width: 760px;
  color: var(--keys-muted);
  font-size: 17px;
  line-height: 1.75;
}

.keys-template-page-head > .keys-icon {
  display: none;
}

.keys-kicker {
  color: var(--keys-brand);
  font-family: Inter, "Segoe UI", "Microsoft YaHei", Arial, sans-serif;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: none;
}

.keys-template-card,
.keys-entry-card,
.keys-app-card,
.keys-detail-panel,
.keys-order-table-card,
.keys-form,
.keys-help-panel,
.keys-auth-panel,
.keys-register-panel,
.keys-doc-panel,
.keys-doc-article,
.keys-legal-article,
.keys-legal-card,
.keys-support-card,
.keys-info-card {
  border: 1px solid var(--keys-line);
  border-radius: var(--keys-radius);
  background: #fff;
  box-shadow: none;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

.keys-btn,
.keys-mini-link {
  min-height: var(--keys-control-height);
  border-radius: var(--keys-control-radius);
  font-weight: 700;
  letter-spacing: 0.02em;
}

.keys-btn {
  padding: 0 18px;
  border: 1px solid var(--keys-brand);
  background: var(--keys-brand);
  color: #fff;
  box-shadow: 0 2px 6px rgba(117, 27, 84, 0.16);
  transform: none;
  white-space: normal;
}

.keys-btn:hover {
  background: var(--keys-brand-strong);
  border-color: var(--keys-brand-strong);
  box-shadow: 0 4px 10px rgba(117, 27, 84, 0.18);
  transform: none;
}

.keys-btn.is-secondary,
.keys-btn.is-ghost,
.keys-mini-link {
  background: #fff;
  border: 1px solid var(--keys-line);
  color: var(--keys-brand);
  box-shadow: none;
}

.keys-btn.is-ghost {
  border-color: transparent;
  background: transparent;
  color: var(--keys-muted);
}

.keys-btn.is-danger {
  border-color: rgba(180, 35, 24, 0.34);
  background: #fff;
  color: var(--keys-danger);
  box-shadow: none;
}

.keys-btn.is-secondary:hover,
.keys-btn.is-ghost:hover,
.keys-mini-link:hover {
  border-color: rgba(117, 27, 84, 0.28);
  background: var(--keys-brand-soft);
  color: var(--keys-brand);
  transform: none;
}

.keys-btn.is-danger:hover {
  border-color: var(--keys-danger);
  background: rgba(180, 35, 24, 0.07);
  color: var(--keys-danger);
}

.keys-btn:focus-visible,
.keys-mini-link:focus-visible,
.keys-icon-button:focus-visible,
.keys-language-button:focus-visible,
.keys-center-entry:focus-visible,
.keys-nav-action:focus-visible,
.keys-app-nav a:focus-visible,
.keys-filter:focus-visible,
.keys-doc-tab:focus-visible,
.keys-personal-action:focus-visible {
  outline: 0;
  box-shadow: var(--keys-focus-ring);
}

.keys-btn:disabled,
.keys-mini-link:disabled,
.keys-icon-button:disabled,
.keys-personal-action:disabled,
.keys-personal-action.is-disabled {
  border-color: var(--keys-line);
  background: #eef1f5;
  color: #7d8796;
  box-shadow: none;
  cursor: not-allowed;
  opacity: 1;
  transform: none;
}

.keys-template-actions-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.keys-home-canvas {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 22px;
  align-items: stretch;
}

.keys-template-hero {
  min-height: 560px;
  padding: clamp(34px, 6vw, 70px);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  border: 1px solid var(--keys-line);
  border-radius: 0 0 18px 18px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(255, 255, 255, 0.82)),
    radial-gradient(circle at 50% 26%, rgba(110, 15, 75, 0.11), transparent 34%);
  box-shadow: none;
}

.keys-home-copy {
  max-width: 760px;
  margin: 0 auto;
  text-align: center;
}

.keys-home-copy h1 {
  margin: 18px auto 22px;
  font-size: clamp(48px, 8vw, 92px);
  line-height: 0.96;
  text-wrap: balance;
}

.keys-hero-lead {
  margin: 0 auto;
  max-width: 700px;
  color: var(--keys-muted);
  font-size: 19px;
  line-height: 1.8;
}

.keys-hero-actions {
  justify-content: center;
  margin-top: 30px;
}

.keys-template-terminal {
  width: min(520px, 100%);
  margin: 46px auto 0;
  overflow: hidden;
  border: 1px solid var(--keys-line);
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 8px 24px rgba(24, 26, 32, 0.08);
  text-align: left;
}

.keys-template-terminal-head {
  display: flex;
  align-items: center;
  gap: 7px;
  height: 38px;
  padding: 0 14px;
  border-bottom: 1px solid var(--keys-line);
  background: var(--keys-subtle);
}

.keys-template-terminal-head span {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: #d0d5dd;
}

.keys-template-terminal-head em {
  margin-left: 8px;
  color: var(--keys-muted);
  font-family: var(--keys-mono);
  font-size: 11px;
  font-style: normal;
}

.keys-home-status-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0;
}

.keys-home-status {
  padding: 18px;
  border-right: 1px solid var(--keys-line);
}

.keys-home-status:last-child {
  border-right: 0;
}

.keys-home-status strong {
  display: block;
  color: var(--keys-ink);
  font-size: 22px;
  font-weight: 800;
}

.keys-home-status span {
  display: block;
  margin-top: 4px;
  color: var(--keys-muted);
  font-size: 13px;
}

.keys-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.keys-list li {
  position: relative;
  padding: 10px 0 10px 24px;
  color: #344054;
  line-height: 1.6;
}

.keys-list li::before {
  content: "";
  position: absolute;
  top: 20px;
  left: 4px;
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: var(--keys-success);
}

.keys-template-route-grid {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(var(--keys-home-product-count, 4), minmax(0, 1fr));
  gap: 16px;
}

.keys-entry-card {
  min-height: 170px;
  padding: 22px;
  display: grid;
  align-content: start;
  gap: 14px;
  color: var(--keys-ink);
  text-decoration: none;
}

.keys-entry-card:hover {
  border-color: rgba(110, 15, 75, 0.32);
  transform: translateY(-2px);
}

.keys-entry-card h3 {
  margin: 0 0 8px;
  font-size: 19px;
}

.keys-entry-card p {
  margin: 0;
  color: var(--keys-muted);
  line-height: 1.65;
}

.keys-route-index {
  color: var(--keys-muted);
  font-family: var(--keys-mono);
  font-size: 11px;
  font-weight: 700;
}

.keys-template-toolbar {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) auto;
  gap: 18px;
  align-items: center;
  margin-bottom: 22px;
  padding: 18px;
  border: 1px solid var(--keys-line);
  border-radius: var(--keys-radius);
  background: #fff;
  box-shadow: var(--keys-shadow);
}

.keys-search {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 48px;
  padding: 0 14px;
  border: 1px solid var(--keys-line);
  border-radius: 8px;
  background: #fff;
}

.keys-search input {
  width: 100%;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--keys-ink);
  font: inherit;
}

.keys-filter-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.keys-filter {
  min-height: 38px;
  padding: 0 14px;
  border: 1px solid var(--keys-line);
  border-radius: 8px;
  background: #fff;
  color: var(--keys-muted);
  font-weight: 700;
}

.keys-filter.is-active,
.keys-filter:hover {
  border-color: rgba(110, 15, 75, 0.28);
  background: var(--keys-brand-soft);
  color: var(--keys-brand);
}

.keys-template-split {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(300px, 360px);
  gap: 22px;
  align-items: start;
}

.keys-template-card-grid,
.keys-app-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.keys-app-card {
  min-height: 260px;
  padding: 22px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

sl-card.keys-template-card,
sl-card.keys-app-card,
sl-card.keys-detail-panel,
sl-card.keys-auth-panel,
sl-card.keys-register-panel,
sl-card.keys-personal-status,
sl-card.keys-personal-actions,
sl-card.keys-personal-apps,
sl-card.keys-help-panel,
sl-card.keys-account-choice-head {
  display: block;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
}

.keys-app-card.is-selected {
  border-color: rgba(110, 15, 75, 0.42);
  box-shadow: none;
}

sl-card.keys-app-card.is-selected::part(base) {
  border-color: rgba(110, 15, 75, 0.42);
  box-shadow: none;
}

.keys-app-card-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.keys-app-card h3,
.keys-detail-panel h2 {
  margin: 8px 0 0;
  font-size: 20px;
}

.keys-app-card p,
.keys-detail-panel p {
  color: var(--keys-muted);
  line-height: 1.7;
}

.keys-app-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: auto;
}

.keys-app-meta span,
.keys-status,
.keys-badge {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 9px;
  border: 1px solid var(--keys-line);
  border-radius: 999px;
  background: #fff;
  color: var(--keys-muted);
  font-size: 12px;
  font-weight: 700;
}

.keys-status {
  border-color: rgba(15, 159, 110, 0.18);
  background: #ecfdf5;
  color: var(--keys-success);
}

.keys-card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.keys-detail-panel {
  position: sticky;
  top: 136px;
  padding: 22px;
}

.keys-detail-panel header {
  display: flex;
  gap: 12px;
  align-items: center;
}

.keys-detail-visual {
  width: 100%;
  margin: 14px 0;
  padding: 10px;
  border: 1px solid var(--keys-line);
  border-radius: 10px;
  background: #fff;
}

.keys-detail-visual img {
  display: block;
  width: 100%;
  max-height: 300px;
  object-fit: contain;
}

.keys-detail-list {
  display: grid;
  gap: 10px;
  margin: 16px 0;
}

.keys-detail-list div,
.keys-profile-grid div {
  display: grid;
  grid-template-columns: 110px minmax(0, 1fr);
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--keys-line);
  border-radius: 8px;
  background: var(--keys-subtle);
}

.keys-detail-list dt,
.keys-profile-grid span {
  color: var(--keys-muted);
  font-size: 12px;
  font-weight: 700;
}

.keys-detail-list dd,
.keys-profile-grid strong {
  margin: 0;
  color: var(--keys-ink);
  font-weight: 800;
}

.keys-account-status-banner {
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr);
  align-items: start;
  gap: 4px;
  margin: 16px 0;
  padding: 12px 14px;
  border: 1px solid var(--keys-line);
  border-radius: 8px;
  background: #fff;
}

.keys-account-status-banner strong {
  display: block;
  color: var(--keys-ink);
}

.keys-account-status-banner span {
  display: block;
  color: var(--keys-muted);
  font-size: 13px;
}

.keys-account-status-banner.is-good {
  border-color: color-mix(in srgb, var(--keys-success) 28%, transparent);
  background: color-mix(in srgb, var(--keys-success) 8%, white);
}

.keys-account-status-banner.is-expiring {
  border-color: color-mix(in srgb, var(--keys-warning) 30%, transparent);
  background: color-mix(in srgb, var(--keys-warning) 8%, white);
}

.keys-account-status-banner.is-expired,
.keys-account-status-banner.is-error {
  border-color: color-mix(in srgb, var(--keys-danger) 28%, transparent);
  background: color-mix(in srgb, var(--keys-danger) 7%, white);
}

.keys-account-status-banner.is-unknown {
  border-color: color-mix(in srgb, var(--keys-info) 25%, transparent);
  background: color-mix(in srgb, var(--keys-info) 6%, white);
}

.keys-account-status-icon {
  display: grid !important;
  width: 32px;
  height: 32px;
  place-items: center;
  border-radius: 50%;
  color: currentColor !important;
  background: color-mix(in srgb, currentColor 10%, white);
}

.keys-account-status-banner.is-good .keys-account-status-icon { color: var(--keys-success) !important; }
.keys-account-status-banner.is-expiring .keys-account-status-icon { color: var(--keys-warning) !important; }
.keys-account-status-banner.is-expired .keys-account-status-icon,
.keys-account-status-banner.is-error .keys-account-status-icon { color: var(--keys-danger) !important; }
.keys-account-status-banner.is-unknown .keys-account-status-icon { color: var(--keys-info) !important; }

.keys-account-status-icon svg {
  width: 18px;
  height: 18px;
}

.keys-pager {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin-top: 20px;
}

.keys-page-dot {
  width: 38px;
  height: 38px;
  border: 1px solid var(--keys-line);
  border-radius: 8px;
  background: #fff;
  color: var(--keys-muted);
  font-weight: 800;
}

.keys-page-dot.is-active {
  background: var(--keys-ink);
  border-color: var(--keys-ink);
  color: #fff;
}

.keys-listjs-pagination {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin: 20px 0 0;
  padding: 0;
  list-style: none;
}

.keys-listjs-pagination li a {
  display: inline-flex;
  min-width: 38px;
  min-height: 38px;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--keys-line);
  border-radius: 8px;
  background: #fff;
  color: var(--keys-muted);
  font-weight: 800;
  text-decoration: none;
}

.keys-listjs-pagination li.active a,
.keys-listjs-pagination li a:hover,
.keys-listjs-pagination li a:focus-visible {
  border-color: var(--keys-ink);
  background: var(--keys-ink);
  color: #fff;
}

.keys-download-empty {
  display: none;
  margin-top: 18px;
}

.keys-download-module.is-empty .keys-download-empty {
  display: block;
}

.keys-field-validator-error {
  margin-top: 6px;
  color: #b42318;
  font-size: 12px;
  font-weight: 700;
}

.keys-template-section-grid .keys-account-choice-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 26px;
}

.keys-account-choice-body {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 340px);
  gap: 20px;
  margin-top: 20px;
}

.keys-help-panel,
.keys-register-panel,
.keys-form,
.keys-auth-panel {
  padding: 24px;
}

.keys-auth-panel {
  position: relative;
}

.keys-account-auth-shell {
  grid-template-columns: minmax(420px, 1.35fr) minmax(280px, 0.65fr);
}

.keys-register-panel {
  background: var(--keys-surface-soft);
  box-shadow: none;
}

.keys-register-panel .keys-btn {
  width: fit-content;
}

.keys-auth-panel.is-busy {
  pointer-events: none;
}

.keys-form-head,
.keys-account-guide-head,
.keys-personal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 20px;
}

.keys-form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.keys-field,
.keys-auth-form label {
  display: grid;
  gap: 7px;
  color: #344054;
  font-weight: 700;
}

.keys-field input,
.keys-field select,
.keys-field textarea,
.keys-auth-form input {
  min-height: var(--keys-control-height);
  border: 1px solid var(--keys-line);
  border-radius: var(--keys-control-radius);
  background: #fff;
  color: var(--keys-ink);
  padding: 10px 12px;
}

.keys-field input:focus-visible,
.keys-field select:focus-visible,
.keys-field textarea:focus-visible,
.keys-auth-form input:focus-visible {
  border-color: var(--keys-brand);
  outline: 0;
  box-shadow: var(--keys-focus-ring);
}

.keys-field input:disabled,
.keys-field select:disabled,
.keys-field textarea:disabled,
.keys-auth-form input:disabled {
  border-color: var(--keys-line);
  background: #eef1f5;
  color: #7d8796;
  cursor: not-allowed;
}

.keys-field textarea {
  min-height: 104px;
}

.keys-auth-busy-mask {
  position: absolute;
  inset: 0;
  z-index: 3;
  display: grid;
  place-items: center;
  gap: 12px;
  border-radius: var(--keys-radius);
  background: rgba(255, 255, 255, 0.78);
  color: var(--keys-ink);
  text-align: center;
  backdrop-filter: blur(4px);
}

.keys-busy-spinner,
.keys-inline-spinner {
  display: inline-block;
  border-radius: 999px;
  border: 2px solid rgba(110, 15, 75, 0.18);
  border-top-color: var(--keys-brand);
  animation: keysSpin 780ms linear infinite;
}

.keys-busy-spinner {
  width: 34px;
  height: 34px;
}

.keys-inline-spinner {
  width: 16px;
  height: 16px;
  margin-right: 8px;
  vertical-align: -3px;
}

@keyframes keysSpin {
  to {
    transform: rotate(360deg);
  }
}

.keys-step-tabs {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 8px;
  margin: 18px 0;
}

.keys-step-tab,
.keys-account-flow li {
  border: 1px solid var(--keys-line);
  border-radius: 8px;
  background: #fff;
}

.keys-step-tab {
  min-height: 46px;
  padding: 10px 12px;
  color: var(--keys-muted);
}

.keys-step-tab.is-active {
  border-color: rgba(110, 15, 75, 0.28);
  background: var(--keys-brand-soft);
  color: var(--keys-brand);
}

.keys-account-flow {
  display: grid;
  gap: 8px;
  margin: 18px 0;
  padding: 0;
  list-style: none;
}

.keys-account-flow li {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
}

.keys-account-flow span {
  display: inline-grid;
  width: 30px;
  height: 30px;
  place-items: center;
  border-radius: 999px;
  background: var(--keys-subtle);
  color: var(--keys-muted);
  font-family: var(--keys-mono);
  font-size: 11px;
  font-weight: 800;
}

.keys-account-flow li.is-active {
  border-color: rgba(110, 15, 75, 0.28);
  background: var(--keys-brand-soft);
}

.keys-account-flow li.is-active span {
  background: var(--keys-brand);
  color: #fff;
}

.keys-account-option-index,
.keys-account-flow {
  display: none;
}

.keys-form-actions {
  display: grid;
  grid-template-columns: auto 1fr auto auto;
  gap: 10px;
  align-items: center;
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px solid var(--keys-line);
}

.keys-order-table-card {
  padding: 20px;
  overflow: hidden;
}

.keys-order-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--keys-line);
  border-radius: 10px;
}

.keys-order-table {
  width: 100%;
  border-collapse: collapse;
  background: #fff;
}

.keys-order-table th,
.keys-order-table td {
  padding: 16px;
  border-bottom: 1px solid var(--keys-line);
  color: #344054;
  text-align: left;
  vertical-align: top;
}

.keys-order-table thead th {
  background: var(--keys-subtle);
  color: var(--keys-ink);
}

.keys-order-section th {
  background: var(--keys-brand-soft);
  color: var(--keys-brand);
}

.keys-table-mark {
  display: inline-grid;
  width: 28px;
  height: 28px;
  place-items: center;
  border-radius: 999px;
  font-weight: 900;
}

.keys-table-mark.is-yes {
  background: #ecfdf5;
  color: var(--keys-success);
}

.keys-table-mark.is-no {
  background: #fef2f2;
  color: var(--keys-danger);
}

.keys-order-mobile-cards {
  display: none;
}

.keys-template-doc-layout,
.keys-doc-layout,
.keys-legal-layout {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr) 260px;
  gap: 20px;
  align-items: start;
}

.keys-doc-sidebar,
.keys-doc-rail,
.keys-legal-sidebar,
.keys-legal-rail {
  position: sticky;
  top: 136px;
  max-height: calc(100vh - 156px);
  overflow: auto;
}

.keys-doc-panel {
  padding: 16px;
}

.keys-doc-nav,
.keys-doc-bookmarks {
  display: grid;
  gap: 8px;
}

.keys-doc-tab,
.keys-doc-bookmark {
  display: flex;
  width: 100%;
  min-height: 44px;
  align-items: center;
  gap: 10px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: var(--keys-muted);
  padding: 9px 10px;
  text-align: left;
}

.keys-doc-tab:hover,
.keys-doc-bookmark:hover,
.keys-doc-tab.is-active,
.keys-doc-bookmark.is-active {
  border-color: rgba(110, 15, 75, 0.18);
  background: var(--keys-brand-soft);
  color: var(--keys-brand);
}

.keys-doc-article,
.keys-legal-article {
  padding: clamp(22px, 4vw, 44px);
}

.keys-doc-article-head {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 24px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--keys-line);
}

.keys-doc-content,
.keys-legal-content {
  color: #344054;
  font-size: 16px;
  line-height: 1.78;
}

.keys-doc-content h1,
.keys-doc-content h2,
.keys-doc-content h3,
.keys-legal-content h1,
.keys-legal-content h2,
.keys-legal-content h3 {
  color: var(--keys-ink);
  letter-spacing: -0.01em;
}

.keys-doc-content img,
.keys-legal-content img {
  max-width: 100%;
  border-radius: 10px;
  border: 1px solid var(--keys-line);
}

.keys-doc-mobile-tools,
.keys-doc-backdrop,
.keys-doc-panel-close {
  display: none;
}

.keys-mobile-panel {
  position: fixed;
  inset: 116px 16px auto;
  z-index: 50;
  border: 1px solid var(--keys-line);
  border-radius: 12px;
  background: #fff;
  box-shadow: var(--keys-shadow);
}

.keys-mobile-panel[hidden] {
  display: none;
}

.keys-mobile-link {
  color: var(--keys-ink);
}

@media (max-width: 1180px) {
  .keys-template-card-grid,
  .keys-app-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .keys-template-route-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .keys-template-doc-layout,
  .keys-doc-layout,
  .keys-legal-layout {
    grid-template-columns: minmax(0, 1fr);
  }

  .keys-doc-sidebar,
  .keys-doc-rail,
  .keys-legal-sidebar,
  .keys-legal-rail {
    position: static;
    max-height: none;
  }
}

@media (max-width: 920px) {
  .keys-app-topbar.keys-template-topbar {
    top: 0;
  }

  .keys-template-topbar-inner,
  .keys-shell-container.keys-template-container {
    width: min(100% - 28px, 1200px);
  }

  .keys-template-topbar-inner {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 12px;
  }

  .keys-template-actions {
    grid-column: 2;
  }

  .keys-app-nav {
    display: none;
  }

  .keys-home-canvas,
  .keys-template-split,
  .keys-account-choice-body {
    grid-template-columns: minmax(0, 1fr);
  }

  .keys-detail-panel {
    position: static;
  }

  .keys-template-toolbar {
    grid-template-columns: minmax(0, 1fr);
  }

  .keys-filter-row {
    justify-content: flex-start;
  }

  .keys-form-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 640px) {
  .keys-app-topbar.keys-template-topbar {
    height: 70px;
  }

  .keys-app-main {
    min-height: calc(100vh - 70px);
  }

  .keys-shell-container.keys-template-container {
    padding: 28px 0 46px;
  }

  .keys-template-page-head h1,
  .keys-home-copy h1 {
    font-size: clamp(28px, 9vw, 38px);
  }

  .keys-template-hero {
    min-height: auto;
    padding: 30px 18px;
  }

  .keys-template-terminal {
    margin-top: 28px;
  }

  .keys-home-status-strip {
    grid-template-columns: minmax(0, 1fr);
  }

  .keys-home-status {
    border-right: 0;
    border-bottom: 1px solid var(--keys-line);
  }

  .keys-home-status:last-child {
    border-bottom: 0;
  }

  .keys-template-route-grid,
  .keys-template-card-grid,
  .keys-app-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .keys-template-section-grid .keys-account-choice-head,
  .keys-form-head,
  .keys-account-guide-head,
  .keys-personal-head,
  .keys-doc-article-head {
    display: grid;
  }

  .keys-form-actions {
    grid-template-columns: minmax(0, 1fr);
  }

  .keys-form-actions span {
    display: none;
  }

  .keys-order-table-wrap {
    display: none;
  }

  .keys-order-mobile-cards {
    display: grid;
    gap: 14px;
  }

  .keys-order-plan-card {
    padding: 18px;
    border: 1px solid var(--keys-line);
    border-radius: 10px;
    background: #fff;
  }
}

/* 覆盖旧 V2 CSS 的残留限制，避免模板结构被旧 App 壳裁切。 */
.keys-template-page {
  border-inline: 0;
  overflow: visible !important;
}

.keys-view.keys-template-page,
.keys-view.keys-page.keys-template-page,
.keys-downloads-view,
.keys-account-view,
.keys-center-view,
.keys-doc-view,
.keys-order-view,
.keys-legal-view {
  height: auto !important;
  min-height: auto !important;
  max-height: none !important;
  overflow: visible !important;
}

.keys-app-nav.keys-template-nav a,
.keys-app-nav.keys-template-nav .keys-nav-action,
.keys-center-entry {
  width: auto;
  max-width: none;
  padding: 0 12px;
}

.keys-app-nav.keys-template-nav a span,
.keys-app-nav.keys-template-nav .keys-nav-action span,
.keys-center-entry span {
  display: inline;
  max-width: none;
  overflow: visible;
  text-overflow: clip;
  white-space: nowrap;
}

.keys-template-card.keys-app-card,
.keys-template-card.keys-entry-card {
  height: auto;
  max-height: none;
  overflow: visible;
}

.keys-template-card.keys-app-card {
  padding-bottom: 24px;
}

.keys-account-diagram {
  display: none;
}

.keys-account-checklist,
.keys-account-note {
  border: 1px solid var(--keys-line);
  border-radius: 8px;
  background: var(--keys-subtle);
  padding: 14px;
}

.keys-account-checklist h4 {
  margin: 0 0 8px;
  color: var(--keys-ink);
  font-size: 13px;
}

.keys-account-checklist ul {
  margin: 0;
  padding-left: 18px;
}

.keys-account-note {
  margin: 12px 0;
}

.keys-account-guide-foot {
  color: var(--keys-muted);
  line-height: 1.7;
}

/* 下载中心是任务页，首屏优先露出完整卡片操作。 */
.keys-downloads-view .keys-shell-container {
  padding-top: 30px;
}

.keys-downloads-view .keys-template-page-head {
  margin-bottom: 20px;
}

.keys-downloads-view .keys-template-page-head h1 {
  font-size: clamp(30px, 3vw, 42px);
}

.keys-downloads-view .keys-template-toolbar {
  margin-bottom: 18px;
  padding: 16px;
}

.keys-downloads-view .keys-app-card {
  min-height: 340px;
  gap: 12px;
}

.keys-home-view .keys-home-copy h1 {
  font-size: clamp(46px, 7vw, 84px);
  line-height: 0.98;
}

/* 使用说明、法律法规统一为左目录 + 右正文阅读器，外层固定，正文独立滚动。 */
.keys-view.keys-page.keys-template-page.keys-docsify-view {
  height: calc(100dvh - var(--keys-topbar-height)) !important;
  min-height: calc(100dvh - var(--keys-topbar-height)) !important;
  max-height: calc(100dvh - var(--keys-topbar-height)) !important;
  overflow: hidden !important;
}

.keys-docsify-view .keys-shell-container.keys-template-container {
  width: calc(100% - 24px);
  max-width: none;
  height: calc(100dvh - var(--keys-topbar-height));
  padding: 12px 0;
  overflow: hidden !important;
}

.keys-docsify-shell {
  display: grid;
  grid-template-columns: minmax(210px, 236px) minmax(0, 1fr);
  height: 100%;
  min-height: 0;
  gap: 12px;
  align-items: stretch;
}

.keys-docsify-nav {
  position: static;
  display: grid;
  align-content: start;
  height: 100%;
  min-height: 0;
  gap: 20px;
  padding: 18px;
  overflow: auto;
}

.keys-docsify-nav .keys-kicker {
  margin: 0 0 10px;
  color: var(--keys-brand);
}

.keys-docsify-nav .keys-doc-nav {
  display: grid;
  gap: 8px;
}

.keys-docsify-nav .keys-doc-tab {
  width: 100%;
  min-height: 46px;
  justify-content: flex-start;
  border-radius: var(--keys-control-radius);
}

.keys-docsify-stage {
  padding: 0;
  overflow: hidden;
  height: 100%;
  min-height: 0;
}

.keys-docsify-frame {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 0;
  border: 0;
  background: #fff;
}

.keys-support-stage,
.keys-legal-stage {
  overflow: auto;
}

.keys-support-stage .keys-doc-article,
.keys-legal-stage .keys-legal-article {
  min-height: 100%;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  background: transparent;
}

.keys-legal-reader-shell .keys-legal-sidebar {
  position: static;
  max-height: none;
}

@media (max-width: 960px) {
  .keys-view.keys-page.keys-template-page.keys-docsify-view {
    height: calc(100dvh - var(--keys-topbar-height)) !important;
    min-height: 0 !important;
    max-height: calc(100dvh - var(--keys-topbar-height)) !important;
    overflow: hidden !important;
  }

  .keys-docsify-view .keys-shell-container.keys-template-container {
    display: grid;
    grid-template-rows: auto minmax(0, 1fr);
    width: calc(100% - 20px);
    height: 100%;
    min-height: 0;
    padding: 10px 0;
    overflow: hidden !important;
  }

  .keys-docsify-shell {
    grid-template-columns: minmax(0, 1fr);
    height: 100%;
    min-height: 0;
  }

  .keys-docsify-nav {
    position: fixed;
    top: calc(var(--keys-topbar-height) + 8px);
    bottom: 8px;
    left: 8px;
    z-index: 96;
    width: min(390px, calc(100vw - 16px));
    height: auto;
    padding: 52px 18px 18px;
    border-color: var(--keys-line);
    background: #fff;
    transform: translateX(calc(-100% - 16px));
    transition: transform 180ms ease;
    box-shadow: var(--keys-shadow);
  }

  .keys-doc-view.is-doc-nav-open .keys-docsify-nav {
    position: fixed;
    top: calc(var(--keys-topbar-height) + 8px);
    right: auto;
    bottom: 8px;
    left: 8px;
    z-index: 96;
    display: grid;
    max-height: none;
    transform: translateX(0);
  }

  .keys-docsify-nav .keys-doc-nav {
    grid-template-columns: minmax(0, 1fr);
  }

  .keys-docsify-nav .keys-doc-panel-close {
    display: grid;
    position: absolute;
    top: 12px;
    right: 12px;
    width: 40px;
    height: 40px;
    place-items: center;
    border: 1px solid var(--keys-line);
    border-radius: var(--keys-control-radius);
    background: #fff;
    color: var(--keys-ink);
  }

  .keys-docsify-nav .keys-doc-panel-close svg {
    width: 20px;
    height: 20px;
    stroke: currentColor;
  }

  .keys-docsify-view .keys-doc-mobile-tools {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    margin-bottom: 8px;
  }

  .keys-docsify-view .keys-doc-mobile-tools .keys-mini-link {
    width: 100%;
    min-height: var(--keys-control-height);
    justify-content: flex-start;
  }

  .keys-docsify-view .keys-doc-backdrop {
    display: block;
    position: fixed;
    inset: var(--keys-topbar-height) 0 0;
    z-index: 95;
    border: 0;
    background: rgba(21, 22, 34, 0.42);
    opacity: 0;
    pointer-events: none;
    transition: opacity 180ms ease;
  }

  .keys-doc-view.is-doc-nav-open .keys-doc-backdrop {
    opacity: 1;
    pointer-events: auto;
  }
}

@media (max-width: 640px) {
  :root {
    --keys-topbar-height: 64px;
  }

  .keys-docsify-frame {
    height: 100%;
    min-height: 0;
  }
}

/* 企业级组件收口：个人中心操作入口与记录采用稳定层级，不与普通按钮混用。 */
.keys-personal-action {
  min-height: 116px;
  border: 1px solid var(--keys-line);
  border-radius: var(--keys-radius-lg);
  background: var(--keys-surface-soft);
  box-shadow: none;
  transform: none;
}

.keys-personal-action:hover {
  border-color: var(--keys-line-strong);
  background: #fff;
  box-shadow: none;
  transform: none;
}

.keys-personal-action.is-primary {
  border-color: color-mix(in srgb, var(--keys-brand) 32%, var(--keys-line));
  background: var(--keys-brand-soft);
}

.keys-personal-action.is-primary .keys-icon {
  background: var(--keys-brand);
  color: #fff;
}

.keys-personal-action.is-secondary .keys-icon {
  background: #fff;
  color: var(--keys-brand);
  border: 1px solid color-mix(in srgb, var(--keys-brand) 22%, var(--keys-line));
}

.keys-personal-action.is-risk .keys-icon {
  background: color-mix(in srgb, var(--keys-danger) 9%, white);
  color: var(--keys-danger);
}

.keys-personal-action.is-disabled,
.keys-personal-action:disabled {
  opacity: 1;
}

.keys-application-list article {
  grid-template-columns: minmax(150px, 1.45fr) minmax(110px, 0.8fr) minmax(110px, 0.8fr) minmax(150px, 1fr);
  border-radius: var(--keys-radius);
}

.keys-application-field {
  display: grid;
  min-width: 0;
  gap: 3px;
}

.keys-application-field > small {
  color: var(--keys-faint);
  font-size: 11px;
  letter-spacing: 0.02em;
}

.keys-application-field > strong,
.keys-application-field > span {
  min-width: 0;
  overflow-wrap: anywhere;
}

@media (max-width: 1366px) {
  .keys-template-topbar-inner {
    grid-template-columns: minmax(170px, 1fr) auto minmax(200px, 1fr);
    width: calc(100% - 24px);
    gap: 10px;
  }

  .keys-app-nav {
    gap: 2px;
  }

  .keys-app-nav a,
  .keys-app-nav button {
    padding-inline: 9px;
    font-size: 13px;
  }
}

@media (max-width: 1080px) {
  :root {
    --keys-topbar-height: 70px;
  }

  .keys-app-nav,
  .keys-center-entry {
    display: none;
  }

  .keys-mobile-menu {
    display: inline-grid;
  }

  .keys-template-topbar-inner {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .keys-account-auth-shell {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 720px) {
  :root {
    --keys-topbar-height: 64px;
  }

  .keys-app-brand-text span {
    display: none;
  }

  .keys-personal-actions,
  .keys-application-list article {
    grid-template-columns: minmax(0, 1fr);
  }

  .keys-application-list article {
    gap: 12px;
  }

  .keys-application-field {
    grid-template-columns: minmax(88px, 0.45fr) minmax(0, 1fr);
    align-items: baseline;
  }

  .keys-personal-action {
    min-height: 0;
  }

  .keys-form-actions .keys-btn,
  .keys-auth-form .keys-btn {
    width: 100%;
  }
}

/* 2026-07-22：恢复文档目录、修复订购滚轮，并将下载中心收口为企业级横向列表。 */
@media (min-width: 961px) {
  .keys-docsify-view .keys-docsify-nav {
    position: static !important;
    display: grid !important;
    width: auto !important;
    height: 100% !important;
    max-height: none !important;
    visibility: visible !important;
    opacity: 1 !important;
    transform: none !important;
  }

  .keys-docsify-view .keys-doc-mobile-tools,
  .keys-docsify-view .keys-doc-backdrop {
    display: none !important;
  }
}

.keys-order-table-wrap {
  overscroll-behavior-x: contain;
  overscroll-behavior-y: auto;
}

.keys-downloads-view .keys-shell-container {
  max-width: min(1680px, calc(100% - 32px));
}

.keys-download-list-shell {
  min-width: 0;
  border: 1px solid var(--keys-line);
  border-radius: var(--keys-radius-lg);
  background: #fff;
  box-shadow: none;
  overflow: hidden;
}

.keys-download-list-head,
.keys-download-row {
  display: grid;
  grid-template-columns: minmax(160px, 1.15fr) minmax(220px, 1.8fr) minmax(170px, 1fr) minmax(140px, 0.85fr) minmax(112px, 0.7fr);
  gap: 18px;
  align-items: center;
}

.keys-download-list-head {
  min-height: 46px;
  padding: 0 20px;
  border-bottom: 1px solid var(--keys-line);
  background: var(--keys-surface-soft);
  color: var(--keys-muted);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.keys-download-row {
  min-height: 112px;
  padding: 18px 20px;
  border-bottom: 1px solid var(--keys-line);
  background: #fff;
  transition: background-color 150ms ease;
}

.keys-download-row:last-child {
  border-bottom: 0;
}

.keys-download-row:hover {
  background: color-mix(in srgb, var(--keys-brand) 3%, white);
}

.keys-download-cell {
  min-width: 0;
}

.keys-download-name {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
}

.keys-download-name .keys-icon {
  width: 42px;
  height: 42px;
  border: 1px solid color-mix(in srgb, var(--keys-brand) 18%, var(--keys-line));
  border-radius: var(--keys-control-radius);
  background: var(--keys-brand-soft);
  color: var(--keys-brand);
}

.keys-download-name h3 {
  margin: 0;
  color: var(--keys-ink);
  font-family: Inter, "Segoe UI", "Microsoft YaHei", Arial, sans-serif;
  font-size: 16px;
  font-weight: 600;
  line-height: 1.35;
}

.keys-download-featured {
  display: inline-flex;
  margin-top: 5px;
  color: var(--keys-success);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.keys-download-summary {
  margin: 0;
  color: var(--keys-muted);
  font-size: 14px;
  line-height: 1.55;
  overflow-wrap: anywhere;
}

.keys-download-version-cell {
  display: grid;
  gap: 3px;
  color: var(--keys-muted);
  font-size: 12px;
}

.keys-download-version-cell strong {
  color: var(--keys-ink);
  font-family: var(--keys-mono);
  font-size: 13px;
  font-weight: 600;
  overflow-wrap: anywhere;
}

.keys-download-version-cell small {
  color: var(--keys-faint);
  line-height: 1.4;
  overflow-wrap: anywhere;
}

.keys-download-primary-action .keys-btn,
.keys-download-more .keys-btn {
  width: 100%;
  min-width: 0;
  padding-inline: 12px;
  text-align: center;
}

.keys-download-action-empty {
  color: var(--keys-faint);
}

.keys-download-dialog {
  width: min(760px, calc(100vw - 32px));
  max-height: min(820px, calc(100dvh - 32px));
  padding: 0;
  border: 1px solid var(--keys-line);
  border-radius: var(--keys-radius-lg);
  background: #fff;
  color: var(--keys-ink);
  box-shadow: var(--keys-shadow);
  overflow: hidden;
}

.keys-download-dialog::backdrop {
  background: rgba(21, 22, 34, 0.52);
  backdrop-filter: blur(2px);
}

.keys-download-dialog-surface {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  max-height: min(820px, calc(100dvh - 32px));
}

.keys-download-dialog-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  padding: 22px 24px 18px;
  border-bottom: 1px solid var(--keys-line);
}

.keys-download-dialog-head .keys-kicker {
  margin: 0 0 5px;
  color: var(--keys-brand);
}

.keys-download-dialog-head h2 {
  margin: 0;
  font-family: Inter, "Segoe UI", "Microsoft YaHei", Arial, sans-serif;
  font-size: clamp(24px, 3vw, 32px);
  font-weight: 600;
  letter-spacing: -0.01em;
}

.keys-download-dialog-body {
  min-height: 0;
  padding: 22px 24px;
  overflow: auto;
  overscroll-behavior: contain;
}

.keys-download-dialog-summary {
  max-width: 65ch;
  color: var(--keys-muted);
  line-height: 1.6;
}

.keys-download-dialog .keys-detail-visual {
  max-width: 560px;
  margin: 18px auto;
}

.keys-download-dialog-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
  padding: 16px 24px;
  border-top: 1px solid var(--keys-line);
  background: var(--keys-surface-soft);
}

@media (max-width: 1180px) {
  .keys-download-list-head {
    display: none;
  }

  .keys-download-row {
    grid-template-columns: minmax(180px, 1fr) minmax(0, 1.7fr) minmax(170px, 0.9fr);
    align-items: start;
  }

  .keys-download-primary-action,
  .keys-download-more {
    display: flex;
    align-items: center;
  }

  .keys-download-primary-action::before,
  .keys-download-more::before {
    content: attr(data-label);
    flex: 0 0 82px;
    color: var(--keys-faint);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.02em;
  }
}

@media (max-width: 760px) {
  .keys-downloads-view .keys-shell-container {
    max-width: calc(100% - 20px);
  }

  .keys-download-list-shell {
    border-radius: var(--keys-radius);
  }

  .keys-download-row {
    grid-template-columns: minmax(0, 1fr);
    gap: 14px;
    padding: 18px 16px;
  }

  .keys-download-summary,
  .keys-download-version-cell,
  .keys-download-primary-action,
  .keys-download-more {
    display: grid;
    grid-template-columns: 88px minmax(0, 1fr);
    align-items: start;
    gap: 10px;
  }

  .keys-download-summary::before,
  .keys-download-version-cell::before,
  .keys-download-primary-action::before,
  .keys-download-more::before {
    content: attr(data-label);
    color: var(--keys-faint);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.02em;
  }

  .keys-download-primary-action .keys-btn,
  .keys-download-more .keys-btn {
    width: 100%;
  }

  .keys-download-dialog {
    width: calc(100vw - 16px);
    max-height: calc(100dvh - 16px);
    border-radius: var(--keys-radius);
  }

  .keys-download-dialog-surface {
    max-height: calc(100dvh - 16px);
  }

  .keys-download-dialog-head,
  .keys-download-dialog-body,
  .keys-download-dialog-actions {
    padding-inline: 16px;
  }

  .keys-download-dialog-actions {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
  }

  .keys-download-dialog-actions .keys-btn {
    width: 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  .keys-download-row {
    transition: none;
  }
}

/* 公告中心：以服务事件时间轴表达状态变化，保持 KEYS 现有酒红色品牌层级。 */
.keys-announcement-view { max-width: 1120px; margin: 0 auto; }
.keys-announcement-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; padding: clamp(22px, 4vw, 44px) 0 28px; border-bottom: 1px solid #e6e1e5; }
.keys-announcement-head h1 { margin: 3px 0 8px; font-size: clamp(30px, 5vw, 54px); letter-spacing: -.04em; }
.keys-announcement-head p:last-child { margin: 0; color: #746b73; }
.keys-announcement-signal { position: relative; width: 112px; height: 46px; background: linear-gradient(90deg, transparent, rgba(110,15,75,.08)); }
.keys-announcement-signal::before { content: ""; position: absolute; right: 10px; bottom: 10px; width: 82px; height: 1px; background: linear-gradient(90deg, transparent, #6e0f4b); }
.keys-announcement-signal i { position: absolute; right: 3px; top: 4px; width: 13px; height: 13px; border-radius: 50%; background: #6e0f4b; box-shadow: 0 0 0 8px rgba(110,15,75,.1); }
.keys-announcement-list { display: grid; padding: 22px 0; }
.keys-announcement-row { position: relative; display: grid; grid-template-columns: 24px minmax(0, 1fr) 30px; gap: 16px; align-items: center; min-height: 112px; padding: 16px 18px 16px 4px; border: 0; border-bottom: 1px solid #e6e1e5; background: transparent; color: inherit; text-align: left; cursor: pointer; }
.keys-announcement-row:hover { background: rgba(110,15,75,.035); }
.keys-announcement-rail { align-self: stretch; position: relative; }
.keys-announcement-rail::after { content: ""; position: absolute; left: 7px; top: 34px; bottom: -34px; width: 1px; background: #ded7dc; }
.keys-announcement-row:last-child .keys-announcement-rail::after { display: none; }
.keys-announcement-rail i { position: absolute; left: 3px; top: 22px; width: 9px; height: 9px; border-radius: 50%; background: #6e0f4b; box-shadow: 0 0 0 5px rgba(110,15,75,.1); }
.keys-announcement-row-copy { display: grid; min-width: 0; gap: 7px; }
.keys-announcement-meta { display: flex; align-items: center; gap: 10px; color: #746b73; font-size: 12px; }
.keys-announcement-meta b, .keys-announcement-type { padding: 4px 9px; border-radius: 999px; background: rgba(110,15,75,.09); color: #6e0f4b; font-size: 12px; }
.keys-announcement-meta b.is-update { background: rgba(22,105,142,.1); color: #16698e; }
.keys-announcement-meta b.is-incident-maintenance { background: rgba(172,49,73,.1); color: #ac3149; }
.keys-announcement-row-copy > strong { overflow: hidden; font-size: 18px; text-overflow: ellipsis; white-space: nowrap; }
.keys-announcement-row-copy > small { overflow: hidden; color: #746b73; font-size: 14px; text-overflow: ellipsis; white-space: nowrap; }
.keys-announcement-arrow svg { width: 20px; }
.keys-announcement-pager { display: flex; align-items: center; justify-content: center; gap: 20px; padding: 12px 0 28px; }
.keys-announcement-dialog, .keys-public-message-dialog { width: min(620px, calc(100vw - 32px)); max-height: 82vh; padding: 0; border: 0; border-radius: 18px; box-shadow: 0 28px 80px rgba(37,20,31,.26); }
.keys-announcement-dialog::backdrop, .keys-public-message-dialog::backdrop { background: rgba(22,13,19,.5); backdrop-filter: blur(4px); }
.keys-announcement-dialog [data-announcement-dialog-content] { padding: 26px; }
.keys-announcement-dialog header { display: flex; justify-content: space-between; gap: 24px; }
.keys-announcement-dialog h2 { margin: 12px 0 6px; font-size: 26px; }
.keys-announcement-dialog time { color: #746b73; font-size: 13px; }
.keys-announcement-content { max-height: 48vh; overflow: auto; margin-top: 24px; color: #332c31; line-height: 1.85; white-space: pre-wrap; }
.keys-announcement-dialog footer { display: flex; justify-content: flex-end; margin-top: 24px; }
.keys-public-message-surface { position: relative; overflow: hidden; padding: 32px; }
.keys-public-message-surface h2 { margin: 32px 0 10px; font-size: 26px; }
.keys-public-message-surface p { margin: 0 0 24px; color: #746b73; line-height: 1.75; white-space: pre-wrap; }
.keys-public-message-signal { position: absolute; top: 0; left: 0; right: 0; height: 7px; background: linear-gradient(90deg, #6e0f4b, #b14b89 62%, transparent); }
.keys-announcement-entry { text-decoration: none; }
@media (max-width: 720px) {
  .keys-announcement-head { align-items: center; }
  .keys-announcement-signal { width: 64px; }
  .keys-announcement-row { grid-template-columns: 18px minmax(0,1fr) 20px; gap: 10px; padding-right: 6px; }
}

/* 2026-07-22：账号申请、个人主页、顶栏语言与法律文档目录优化。 */
.keys-language-flag {
  display: inline-grid;
  width: 22px;
  height: 22px;
  place-items: center;
  border-radius: 50%;
  background: var(--keys-surface-soft);
  font-size: 16px;
  line-height: 1;
}

.keys-language-menu button {
  grid-template-columns: 26px minmax(0, 1fr);
  align-items: center;
  column-gap: 9px;
}

.keys-language-menu button > span:last-child {
  display: grid;
  gap: 2px;
}

.keys-account-view .keys-shell-container {
  max-width: min(1680px, calc(100% - 32px));
}

.keys-account-list-shell {
  min-width: 0;
  border: 1px solid var(--keys-line);
  border-radius: var(--keys-radius-lg);
  background: #fff;
  box-shadow: var(--keys-shadow-tight);
  overflow: hidden;
}

.keys-account-list-head,
.keys-account-option {
  display: grid;
  grid-template-columns: minmax(210px, 1.1fr) minmax(320px, 2.4fr) minmax(126px, 0.7fr);
  gap: 18px;
  align-items: center;
}

.keys-account-list-head {
  min-height: 46px;
  padding: 0 20px;
  border-bottom: 1px solid var(--keys-line);
  background: var(--keys-surface-soft);
  color: var(--keys-muted);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.keys-account-option-grid {
  display: block;
}

.keys-account-option {
  width: 100%;
  min-height: 108px;
  padding: 18px 20px;
  border: 0;
  border-bottom: 1px solid var(--keys-line);
  border-radius: 0;
  background: #fff;
  color: var(--keys-ink);
  text-align: left;
}

.keys-account-option:last-child {
  border-bottom: 0;
}

.keys-account-option:hover {
  background: color-mix(in srgb, var(--keys-brand) 3%, white);
}

.keys-account-option.is-disabled {
  background: #f5f6f8;
  color: #737b88;
}

.keys-account-option-name {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
}

.keys-account-option-name > span:last-child {
  display: grid;
  min-width: 0;
  gap: 3px;
}

.keys-account-option-name em {
  width: fit-content;
  color: var(--keys-brand);
  font-family: var(--keys-mono);
  font-size: 11px;
  font-style: normal;
  font-weight: 700;
  letter-spacing: 0.06em;
}

.keys-account-option-name small {
  color: var(--keys-faint);
  font-size: 12px;
  line-height: 1.4;
}

.keys-account-option-name .keys-icon {
  width: 42px;
  height: 42px;
  border: 1px solid color-mix(in srgb, var(--keys-brand) 18%, var(--keys-line));
  border-radius: var(--keys-control-radius);
  background: var(--keys-brand-soft);
  color: var(--keys-brand);
}

.keys-account-option.is-disabled .keys-icon {
  border-color: var(--keys-line);
  background: #e9ebef;
  color: #7d8796;
}

.keys-account-option p {
  margin: 0;
  color: var(--keys-muted);
  font-size: 14px;
  line-height: 1.55;
}

.keys-account-option > .keys-btn {
  width: 100%;
  min-width: 0;
  padding-inline: 12px;
  text-align: center;
}

.keys-account-option > .keys-btn.is-disabled {
  border-color: var(--keys-line);
  background: #e8eaee;
  color: #596271;
  box-shadow: none;
}

.keys-field[hidden] {
  display: none !important;
}

.keys-account-auth-shell {
  display: grid;
  grid-template-columns: minmax(0, 560px);
  justify-content: center;
}

.keys-auth-register-hint {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--keys-line);
  color: var(--keys-muted);
  font-size: 13px;
}

.keys-profile-hero {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 20px;
  padding: 26px;
  border: 1px solid var(--keys-line);
  border-radius: var(--keys-radius-lg);
  background: #fff;
  box-shadow: var(--keys-shadow-tight);
}

.keys-profile-identity {
  display: flex;
  align-items: center;
  gap: 16px;
}

.keys-profile-avatar {
  display: grid;
  flex: 0 0 58px;
  width: 58px;
  height: 58px;
  place-items: center;
  border-radius: 50%;
  background: var(--keys-brand-soft);
  color: var(--keys-brand);
}

.keys-profile-avatar svg {
  width: 26px;
  height: 26px;
}

.keys-profile-identity h2 {
  margin: 2px 0 3px;
  font-size: clamp(24px, 3vw, 32px);
  letter-spacing: -0.01em;
}

.keys-profile-identity > div > span {
  color: var(--keys-muted);
  font-family: var(--keys-mono);
  font-size: 13px;
}

.keys-profile-logout {
  align-self: start;
}

.keys-profile-hero .keys-account-status-banner {
  grid-column: 1 / -1;
  margin: 0;
}

.keys-profile-summary {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  border-top: 1px solid var(--keys-line);
  padding-top: 20px;
}

.keys-profile-summary > div {
  display: grid;
  min-width: 0;
  gap: 4px;
  padding: 2px 20px;
  border-right: 1px solid var(--keys-line);
}

.keys-profile-summary > div:first-child {
  padding-left: 0;
}

.keys-profile-summary > div:last-child {
  border-right: 0;
}

.keys-profile-summary span,
.keys-personal-section-head > span {
  color: var(--keys-faint);
  font-size: 12px;
  letter-spacing: 0.02em;
}

.keys-profile-summary strong {
  overflow-wrap: anywhere;
  color: var(--keys-ink);
  font-size: 16px;
  font-weight: 600;
}

.keys-personal-main-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(360px, 0.9fr);
  gap: 20px;
}

.keys-personal-status,
.keys-personal-actions,
.keys-personal-apps {
  padding: 24px;
}

.keys-personal-section-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.keys-personal-section-head h3 {
  margin: 3px 0 0;
}

.keys-personal-action-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.keys-personal-action-grid .keys-personal-action {
  min-height: 126px;
}

.keys-legal-reader-shell.has-rail {
  grid-template-columns: minmax(210px, 236px) minmax(0, 1fr) minmax(210px, 250px);
}

.keys-legal-rail {
  position: static;
  height: 100%;
  max-height: none;
  min-height: 0;
  overflow: auto;
  border: 1px solid var(--keys-line);
  border-radius: var(--keys-radius-lg);
  background: #fff;
}

@media (max-width: 1366px) {
  .keys-template-topbar-inner {
    grid-template-columns: minmax(190px, 1fr) auto minmax(190px, 1fr);
  }

  .keys-account-list-head,
  .keys-account-option {
    grid-template-columns: minmax(190px, 1fr) minmax(260px, 2fr) minmax(112px, 0.7fr);
    gap: 14px;
  }
}

@media (max-width: 1080px) {
  .keys-template-topbar-inner {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .keys-personal-main-grid {
    grid-template-columns: minmax(0, 1fr);
  }

}

@media (max-width: 960px) {
  .keys-legal-reader-shell.has-rail {
    grid-template-columns: minmax(0, 1fr);
  }

  .keys-legal-view .keys-doc-mobile-tools {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .keys-account-list-head {
    display: none;
  }

  .keys-account-option {
    grid-template-columns: minmax(190px, 1fr) minmax(0, 1.7fr) minmax(112px, 0.7fr);
    align-items: start;
  }

  .keys-legal-reader-shell .keys-legal-rail {
    position: fixed;
    top: calc(var(--keys-topbar-height) + 8px);
    right: 8px;
    bottom: 8px;
    left: auto;
    z-index: 96;
    width: min(390px, calc(100vw - 16px));
    height: auto;
    padding-top: 44px;
    transform: translateX(calc(100% + 16px));
    transition: transform 180ms ease;
  }

  .keys-legal-view.is-doc-rail-open .keys-legal-rail {
    transform: translateX(0);
  }

  .keys-legal-view.is-doc-rail-open .keys-doc-backdrop {
    opacity: 1;
    pointer-events: auto;
  }
}

@media (max-width: 720px) {
  .keys-account-view .keys-shell-container {
    max-width: calc(100% - 20px);
  }

  .keys-account-option {
    grid-template-columns: minmax(0, 1fr);
    gap: 13px;
    padding: 18px 16px;
  }

  .keys-profile-hero {
    grid-template-columns: minmax(0, 1fr);
    padding: 20px 16px;
  }

  .keys-profile-logout {
    position: absolute;
    right: 16px;
  }

  .keys-profile-summary {
    grid-template-columns: minmax(0, 1fr);
    gap: 0;
  }

  .keys-profile-summary > div,
  .keys-profile-summary > div:first-child {
    padding: 12px 0;
    border-right: 0;
    border-bottom: 1px solid var(--keys-line);
  }

  .keys-profile-summary > div:last-child {
    border-bottom: 0;
  }

  .keys-personal-action-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .keys-personal-status,
  .keys-personal-actions,
  .keys-personal-apps {
    padding: 18px 16px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .keys-account-option,
  .keys-legal-rail {
    transition: none;
  }
}

/* 2026-07-22：首页改为 V1 产品资产驱动的单屏门面，不再显示假终端与指标卡。 */
.keys-home-view {
  height: calc(100dvh - var(--keys-topbar-height));
  min-height: calc(100dvh - var(--keys-topbar-height));
  padding: 0;
  overflow: hidden;
}

.keys-home-view .keys-home-canvas {
  display: grid;
  grid-template-rows: minmax(0, 1fr);
  width: 100%;
  max-width: none;
  height: calc(100dvh - var(--keys-topbar-height));
  min-height: calc(100dvh - var(--keys-topbar-height));
  margin: 0 auto;
  padding: 0;
  gap: 0;
}

.keys-home-product-stage {
  position: relative;
  display: block;
  height: 100%;
  min-height: calc(100dvh - var(--keys-topbar-height));
  overflow: hidden;
  border: 0;
  border-radius: 0;
  background: #1b1d23;
  box-shadow: none;
}

.keys-home-product-stage::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  background: linear-gradient(90deg, rgba(14, 16, 21, 0.9) 0%, rgba(14, 16, 21, 0.76) 34%, rgba(14, 16, 21, 0.22) 64%, rgba(14, 16, 21, 0.04) 100%);
  pointer-events: none;
}

.keys-home-product-copy {
  position: absolute;
  inset: 0 auto 0 0;
  z-index: 2;
  display: flex;
  width: min(760px, 54%);
  min-width: 520px;
  min-height: 0;
  flex-direction: column;
  justify-content: center;
  padding: clamp(42px, 4.5vw, 82px) clamp(32px, 5vw, 96px) 126px;
  background: transparent;
}

.keys-home-product-copy .keys-kicker {
  margin: 0 0 12px;
  color: rgba(255, 255, 255, 0.76);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.keys-home-product-copy h1 {
  max-width: 9ch;
  margin: 0;
  color: #fff;
  font-family: Inter, "Segoe UI", "Microsoft YaHei", Arial, sans-serif;
  font-size: clamp(52px, 5.1vw, 84px);
  font-weight: 600;
  line-height: 0.98;
  letter-spacing: -0.025em;
  text-wrap: balance;
}

.keys-home-lead {
  max-width: 48ch;
  margin: 20px 0 0;
  color: rgba(255, 255, 255, 0.82);
  font-size: clamp(16px, 1.3vw, 21px);
  font-weight: 500;
  line-height: 1.5;
}

.keys-home-product-tabs {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 3;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  max-width: none;
  margin: 0;
  gap: 0;
  overflow: hidden;
  border-top: 1px solid rgba(255, 255, 255, 0.22);
  border-bottom: 0;
  background: #111318;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  scrollbar-width: none;
}

.keys-home-product-tabs::-webkit-scrollbar {
  display: none;
}

.keys-home-product-tab {
  position: relative;
  display: flex;
  min-width: 0;
  min-height: 76px;
  padding: 0 clamp(18px, 2.5vw, 44px);
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  border: 0;
  border-right: 1px solid rgba(255, 255, 255, 0.16);
  background: transparent;
  color: rgba(255, 255, 255, 0.72);
  font: 550 14px/1.2 Inter, "Segoe UI", "Microsoft YaHei", Arial, sans-serif;
  letter-spacing: 0.02em;
  cursor: pointer;
}

.keys-home-product-tab:first-child {
  padding-left: clamp(24px, 5vw, 96px);
}

.keys-home-product-tab:last-child {
  border-right: 0;
}

.keys-home-product-tab svg {
  width: 17px;
  height: 17px;
  flex: 0 0 auto;
  opacity: 0.58;
  transition: transform 160ms ease, opacity 160ms ease;
}

.keys-home-product-tab:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
}

.keys-home-product-tab.is-active {
  background: #fff;
  color: var(--keys-ink);
}

.keys-home-product-tab.is-active svg,
.keys-home-product-tab:hover svg {
  opacity: 1;
  transform: translateX(3px);
}

.keys-home-product-tab:focus-visible {
  z-index: 1;
  outline: 3px solid var(--keys-focus-ring);
  outline-offset: -3px;
  border-radius: var(--keys-control-radius) var(--keys-control-radius) 0 0;
}

.keys-home-product-details {
  min-height: 120px;
  padding-top: 24px;
}

.keys-home-product-detail[hidden],
.keys-home-product-visual[hidden] {
  display: none !important;
}

.keys-home-product-detail h2 {
  max-width: 24ch;
  margin: 0;
  color: #fff;
  font-family: Inter, "Segoe UI", "Microsoft YaHei", Arial, sans-serif;
  font-size: clamp(20px, 2vw, 28px);
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: -0.01em;
}

.keys-home-product-detail p {
  max-width: 62ch;
  margin: 9px 0 0;
  color: rgba(255, 255, 255, 0.72);
  font-size: 14px;
  line-height: 1.6;
}

.keys-home-product-link {
  display: inline-flex;
  min-height: 38px;
  margin-top: 8px;
  align-items: center;
  gap: 6px;
  color: #fff;
  font-size: 13px;
  font-weight: 550;
  letter-spacing: 0.02em;
  text-decoration: none;
}

.keys-home-product-link svg {
  width: 16px;
  height: 16px;
  transition: transform 150ms ease;
}

.keys-home-product-link:hover svg {
  transform: translateX(3px);
}

.keys-home-product-link:focus-visible {
  outline: 3px solid var(--keys-focus-ring);
  outline-offset: 3px;
  border-radius: 3px;
}

.keys-home-product-copy .keys-hero-actions {
  margin-top: 20px;
}

.keys-home-product-media {
  position: absolute;
  inset: 0;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  border: 0;
  background: #1b1d23;
}

.keys-home-product-visual {
  width: 100%;
  height: 100%;
  margin: 0;
  place-items: center;
  animation: keys-home-product-enter 150ms ease-out both;
}

.keys-home-product-visual.is-contain {
  display: grid;
  padding: clamp(38px, 6vw, 96px) clamp(28px, 5vw, 82px) 112px 48%;
}

.keys-home-product-visual.is-contain img {
  width: 100%;
  max-width: 850px;
  max-height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 24px 34px rgba(25, 27, 34, 0.16));
}

.keys-home-product-visual.is-cover {
  display: block;
}

.keys-home-product-visual.is-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

@keyframes keys-home-product-enter {
  from { opacity: 0; }
  to { opacity: 1; }
}

@media (max-width: 1180px) {
  .keys-home-product-copy {
    width: min(660px, 62%);
    min-width: 460px;
    padding-inline: 42px;
  }

}

@media (max-width: 960px) {
  .keys-home-view {
    overflow: auto;
    overscroll-behavior: contain;
  }

  .keys-home-view .keys-home-canvas {
    height: auto;
    min-height: 100%;
  }

  .keys-home-product-stage {
    min-height: 720px;
  }

  .keys-home-product-copy {
    width: min(640px, 72%);
    min-width: 0;
    min-height: 0;
    padding: 48px 36px 124px;
  }

  .keys-home-product-media {
    min-height: 0;
    border: 0;
  }

}

@media (max-width: 640px) {
  .keys-home-view .keys-home-canvas {
    width: 100%;
    padding: 0;
    gap: 0;
  }

  .keys-home-product-stage {
    display: grid;
    min-height: 0;
    border-radius: 0;
    background: #1b1d23;
  }

  .keys-home-product-stage::before {
    display: none;
  }

  .keys-home-product-media {
    position: relative;
    height: 250px;
    grid-row: 1;
  }

  .keys-home-product-copy {
    position: relative;
    inset: auto;
    width: 100%;
    min-height: 0;
    padding: 28px 20px 24px;
    grid-row: 2;
    background: #1b1d23;
  }

  .keys-home-product-copy h1 {
    max-width: 12ch;
    font-size: clamp(38px, 12vw, 52px);
  }

  .keys-home-product-tabs {
    position: relative;
    grid-row: 3;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    background: #24272e;
  }

  .keys-home-product-tab {
    min-height: 56px;
    padding-inline: 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.14);
    font-size: 12px;
  }

  .keys-home-product-tab:first-child {
    padding-left: 16px;
  }

  .keys-home-product-tab:nth-child(2n) {
    border-right: 0;
  }

  .keys-home-product-detail h2 {
    font-size: 21px;
  }

  .keys-home-product-copy .keys-hero-actions {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
  }

  .keys-home-product-copy .keys-hero-actions .keys-btn {
    width: 100%;
  }

  .keys-home-product-visual.is-contain {
    padding: 22px;
  }

}

@media (max-height: 760px) and (min-width: 961px) {
  .keys-home-view .keys-home-canvas {
    padding-block: 10px;
    gap: 8px;
  }

  .keys-home-product-copy {
    padding-top: 26px;
    padding-bottom: 92px;
  }

  .keys-home-product-copy h1 {
    font-size: clamp(40px, 4.5vw, 62px);
  }

  .keys-home-lead {
    margin-top: 10px;
  }

  .keys-home-product-tabs {
    margin-top: 0;
  }

  .keys-home-product-details {
    min-height: 118px;
    padding-top: 12px;
  }

  .keys-home-product-copy .keys-hero-actions {
    margin-top: 8px;
  }

  .keys-home-product-tab {
    min-height: 56px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .keys-home-product-visual {
    animation: none;
  }

  .keys-home-product-tab svg,
  .keys-home-product-link svg {
    transition: none;
  }
}
