/* ProtoMass 站点共用样式 */
:root {
  --theme: rgb(242, 186, 2);
  --theme-ink: #1a1d21;
  --bg: #fff;
  --card: #fff;
  --text: #1a1d21;
  --muted: #5c6570;
  --line: #e0d6c4;
  --danger: #cf222e;
  --ok: #1a7f37;
  --warn: #9a6700;
  --font: "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  --brand-font: "华文中宋", "STZhongsong", "SimSun", serif;
  --content-max: 960px;
}

* {
  box-sizing: border-box;
}

html {
  scrollbar-gutter: stable;
}

html,
body {
  height: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
}

/* —— 共用顶部（封面品牌 + 四项导航） —— */
.site-top {
  flex-shrink: 0;
  width: 100%;
  padding: 40px 24px 32px;
  background: var(--theme);
  color: #fff;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 28px;
}

.site-top-brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
  text-decoration: none;
  color: inherit;
  transition: transform 0.22s ease;
}

.site-top-brand:hover {
  transform: translateY(-3px);
}

.site-brand {
  margin: 0;
  display: grid;
  /* 4 字 2×2：边距 : 字距 : 边距 = 1 : 2 : 1（与 browser SplashOverlay 一致） */
  grid-template-columns: 1fr auto 2fr auto 1fr;
  grid-template-rows: 1fr auto 2fr auto 1fr;
  place-items: center;
  width: 160px;
  height: 160px;
  padding: 0;
  background: #fff;
  color: var(--theme);
  font-family: var(--brand-font);
  font-size: 1.65rem;
  font-weight: 400;
  line-height: 1;
  view-transition-name: pm-brand;
}

.site-brand span:nth-child(1) {
  grid-column: 2;
  grid-row: 2;
}

.site-brand span:nth-child(2) {
  grid-column: 4;
  grid-row: 2;
}

.site-brand span:nth-child(3) {
  grid-column: 2;
  grid-row: 4;
}

.site-brand span:nth-child(4) {
  grid-column: 4;
  grid-row: 4;
}

.site-tagline {
  margin: 0;
  width: 160px;
  display: flex;
  justify-content: space-between;
  color: #fff;
  font-family: var(--brand-font);
  font-size: 1rem;
  font-weight: 400;
  line-height: 1.4;
  view-transition-name: pm-tagline;
}

.site-top-nav {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  width: 100%;
  max-width: var(--content-max);
}

.site-top-nav a {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 72px;
  padding: 16px 10px;
  background: transparent;
  color: #fff;
  text-decoration: none;
  text-align: center;
  border: none;
  transition: transform 0.22s ease;
}

.site-top-nav a[href="/intro/"] {
  view-transition-name: pm-nav-intro;
}

.site-top-nav a[href="/guide/"] {
  view-transition-name: pm-nav-guide;
}

.site-top-nav a[href="/downloads/"] {
  view-transition-name: pm-nav-downloads;
}

.site-top-nav a[href="/about/"] {
  view-transition-name: pm-nav-about;
}

.site-top-nav a:hover {
  transform: translateY(-3px);
}

.site-top-nav a.is-active {
  box-shadow: inset 0 -3px 0 #fff;
}

.site-top-nav a strong {
  font-size: 1.05rem;
  font-weight: 650;
  letter-spacing: 0.06em;
}

.site-top-nav a span {
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.78);
  font-weight: 400;
}

/* 封面：整页金色，顶部垂直居中 */
body.is-portal {
  background: var(--theme);
  color: #fff;
}

body.is-portal .site-top {
  flex: 1;
  justify-content: center;
  padding: 48px 24px 40px;
}

body.is-portal .site-brand {
  width: 200px;
  height: 200px;
  font-size: 2.2rem;
}

body.is-portal .site-tagline {
  width: 200px;
  font-size: clamp(1rem, 2.2vw, 1.25rem);
}

body.is-portal .site-top-nav {
  max-width: var(--content-max);
}

body.is-portal .site-top-nav a {
  min-height: 88px;
}

body.is-portal .site-footer {
  color: rgba(255, 255, 255, 0.92);
}

/* —— 主页 ↔ 子页共用元素过渡（Chrome / Edge） —— */
@view-transition {
  navigation: auto;
}

/* 与 root 同速，避免背景先动完 */
::view-transition-group(pm-brand),
::view-transition-group(pm-tagline),
::view-transition-group(pm-nav-intro),
::view-transition-group(pm-nav-guide),
::view-transition-group(pm-nav-downloads),
::view-transition-group(pm-nav-about),
::view-transition-group(root) {
  animation-duration: 0.55s;
  animation-timing-function: cubic-bezier(0.22, 1, 0.36, 1);
}

::view-transition-old(root),
::view-transition-new(root) {
  animation-duration: 0.55s;
  animation-timing-function: cubic-bezier(0.22, 1, 0.36, 1);
}

::view-transition-old(pm-brand),
::view-transition-new(pm-brand),
::view-transition-old(pm-tagline),
::view-transition-new(pm-tagline),
::view-transition-old(pm-nav-intro),
::view-transition-new(pm-nav-intro),
::view-transition-old(pm-nav-guide),
::view-transition-new(pm-nav-guide),
::view-transition-old(pm-nav-downloads),
::view-transition-new(pm-nav-downloads),
::view-transition-old(pm-nav-about),
::view-transition-new(pm-nav-about) {
  height: 100%;
  overflow: clip;
}

@media (prefers-reduced-motion: reduce) {
  @view-transition {
    navigation: none;
  }

  .site-brand,
  .site-tagline,
  .site-top-nav a[href="/intro/"],
  .site-top-nav a[href="/guide/"],
  .site-top-nav a[href="/downloads/"],
  .site-top-nav a[href="/about/"] {
    view-transition-name: none;
  }
}

.page-title {
  margin: 0 0 6px;
  font-size: 1.35rem;
  font-weight: 650;
}

.page-lead {
  margin: 0 0 18px;
  color: var(--muted);
  font-size: 0.92rem;
}

.ops-links {
  margin: 0 0 16px;
  font-size: 0.85rem;
  color: var(--muted);
}

.ops-links a {
  color: var(--text);
  font-weight: 600;
  text-decoration: underline;
  text-decoration-color: var(--theme);
  text-underline-offset: 3px;
}

.site-main {
  flex: 1;
  width: calc(100% - 48px);
  max-width: var(--content-max);
  margin: 0 auto;
  padding: 24px 0 32px;
}

.site-main.wide,
.site-main.xwide,
.site-main.narrow {
  max-width: var(--content-max);
}

.site-main.guide-doc {
  max-width: 1080px;
}

/* —— 产品入口：左右双卡片 —— */
.entry-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  align-items: stretch;
}

.entry-card {
  display: flex;
  flex-direction: column;
  margin-bottom: 0;
  height: 100%;
  border-left: 1px solid var(--line);
  border-top: 4px solid var(--theme);
}

.entry-card h2 .entry-rec {
  display: inline-block;
  margin-left: 8px;
  padding: 1px 7px;
  vertical-align: middle;
  font-size: 0.68rem;
  font-weight: 650;
  letter-spacing: 0.04em;
  line-height: 1.4;
  color: var(--ok);
  background: #eaf7ee;
  border: 1px solid #b7dfc3;
  border-radius: 3px;
}

.site-main a.entry-card-link {
  color: inherit;
  font-weight: inherit;
  text-decoration: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}

.site-main a.entry-card-link:hover {
  color: inherit;
  text-decoration: none;
  border-color: var(--theme);
  box-shadow: 0 4px 16px rgba(26, 29, 33, 0.08);
  transform: translateY(-2px);
}

.site-main a.entry-card-link:hover .entry-card-go {
  color: var(--theme);
}

.entry-card .entry-media {
  margin-top: auto;
}

.entry-card-go {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  margin-top: 10px;
  color: var(--muted);
  font-size: 1.05rem;
  font-weight: 500;
  line-height: 1;
  transition: color 0.15s ease;
}

.entry-media {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 180px;
  background: #f7f4ee;
  border: 1px dashed var(--line);
}

.entry-media img {
  display: block;
  width: 100%;
  height: auto;
  max-height: 240px;
  object-fit: cover;
}

.entry-media-placeholder {
  color: var(--muted);
  font-size: 0.85rem;
  letter-spacing: 0.04em;
}

@media (max-width: 720px) {
  .entry-grid {
    grid-template-columns: 1fr;
  }
}

/* —— 产品指南：左侧两级目录 + 右侧正文 —— */
.guide-layout {
  display: grid;
  grid-template-columns: 200px minmax(0, 1fr);
  gap: 32px;
  align-items: start;
}

.guide-toc {
  position: sticky;
  top: 16px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 4px 0;
  max-height: calc(100vh - 32px);
  overflow: auto;
  scrollbar-gutter: stable;
}

.guide-toc .toc-group {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.guide-toc .toc-group .toc-l2 {
  display: none;
}

.guide-toc .toc-group.is-active .toc-l2 {
  display: block;
}

.guide-toc a {
  display: block;
  color: var(--muted);
  text-decoration: none;
  line-height: 1.35;
  border-left: 2px solid transparent;
  transition: color 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}

.guide-toc a:hover {
  color: var(--text);
}

.guide-toc a.is-active {
  color: var(--theme-ink);
  border-left-color: var(--theme);
  font-weight: 650;
}

.guide-toc .toc-l1 {
  margin-top: 10px;
  padding: 6px 10px 6px 12px;
  font-size: 0.92rem;
  font-weight: 650;
  color: var(--text);
}

.guide-toc .toc-group:first-child .toc-l1 {
  margin-top: 0;
}

.guide-toc .toc-group.is-active .toc-l1 {
  color: var(--theme-ink);
  border-left-color: var(--theme);
}

.guide-toc .toc-l2 {
  padding: 4px 10px 4px 24px;
  font-size: 0.82rem;
}

.guide-body {
  min-width: 0;
}

.guide-section {
  margin-bottom: 0;
  padding-bottom: 0;
  border-bottom: none;
  scroll-margin-top: 20px;
}

.guide-section:not(.is-active) {
  display: none;
}

.guide-section>h2 {
  margin: 0 0 8px;
  font-size: 1.35rem;
  font-weight: 650;
}

.guide-section>.section-lead {
  margin: 0 0 20px;
  color: var(--muted);
  font-size: 0.92rem;
}

.guide-section>h3 {
  margin: 22px 0 10px;
  font-size: 1.05rem;
  font-weight: 650;
  scroll-margin-top: 20px;
}

.guide-section>h3:first-of-type {
  margin-top: 0;
}

.guide-section ol,
.guide-section ul {
  margin: 0 0 12px;
  padding-left: 1.25rem;
  color: var(--text);
  font-size: 0.92rem;
}

.guide-section li {
  margin: 0.35em 0;
}

.guide-section p {
  margin: 0 0 12px;
  color: var(--text);
  font-size: 0.92rem;
}

/* —— 简单正文页（下载中心 / 关于我们）：小标题 + 内容，无卡片 —— */
.plain-doc .doc-section {
  margin-bottom: 28px;
}

.plain-doc .doc-section:last-child {
  margin-bottom: 0;
}

.plain-doc .doc-section > h2 {
  margin: 0 0 10px;
  font-size: 1.05rem;
  font-weight: 650;
  scroll-margin-top: 20px;
}

.plain-doc .doc-section > h3 {
  margin: 22px 0 10px;
  font-size: 1.05rem;
  font-weight: 650;
}

.plain-doc .doc-section p,
.plain-doc .doc-section ul,
.plain-doc .doc-section ol {
  margin: 0 0 12px;
  padding-left: 0;
  color: var(--text);
  font-size: 0.92rem;
  line-height: 1.55;
}

.plain-doc .doc-section ul,
.plain-doc .doc-section ol {
  padding-left: 1.25rem;
}

.plain-doc .doc-section li {
  margin: 0.35em 0;
}

.plain-doc .doc-section table {
  margin-top: 4px;
}

@media (max-width: 820px) {
  .guide-layout {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .guide-toc {
    position: static;
    max-height: none;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 6px 10px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--line);
  }

  .guide-toc .toc-group {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 6px 10px;
  }

  .guide-toc .toc-group .toc-l2 {
    display: none;
  }

  .guide-toc .toc-group.is-active .toc-l2 {
    display: block;
  }

  .guide-toc .toc-l1,
  .guide-toc .toc-l2 {
    margin: 0;
    padding: 4px 8px;
    border-left: none;
    border-bottom: 2px solid transparent;
  }

  .guide-toc a.is-active,
  .guide-toc .toc-group.is-active .toc-l1 {
    border-left-color: transparent;
    border-bottom-color: var(--theme);
  }
}

.site-footer {
  flex-shrink: 0;
  padding: 16px 24px 24px;
  color: var(--muted);
  font-size: 0.8rem;
  letter-spacing: 0.04em;
  text-align: center;
}

@media (max-width: 820px) {
  .site-top-nav {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 480px) {
  .site-top {
    padding: 28px 16px 24px;
  }

  .site-top-nav {
    grid-template-columns: 1fr;
  }

  .site-top-nav a {
    min-height: 64px;
  }
}


.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-left: 4px solid var(--theme);
  padding: 18px 20px;
  margin-bottom: 14px;
}

.card h2 {
  margin: 0 0 10px;
  font-size: 1.05rem;
  font-weight: 650;
}

.card p {
  margin: 0 0 10px;
  color: var(--text);
  font-size: 0.92rem;
  line-height: 1.45;
}

.card p:last-child {
  margin-bottom: 0;
}

.card ul,
.card ol {
  margin: 0 0 10px;
  padding-left: 1.25rem;
  color: var(--text);
  font-size: 0.92rem;
  line-height: 1.45;
}

.card li {
  margin: 0.35em 0;
}

.card .fig {
  margin-top: 8px;
}

.site-main a:not(.btn):not(.tile):not(.entry-card-link) {
  color: var(--text);
  font-weight: 600;
  text-decoration: underline;
  text-decoration-color: var(--theme);
  text-underline-offset: 3px;
}

.site-main a:not(.btn):not(.tile):not(.entry-card-link):hover {
  color: var(--theme-ink);
  text-decoration-thickness: 2px;
}

a.btn,
button,
.file-btn {
  font: inherit;
  display: inline-block;
  margin-right: 8px;
  padding: 8px 14px;
  border: 1px solid var(--theme);
  background: var(--theme);
  color: var(--theme-ink);
  text-decoration: none;
  font-weight: 600;
  cursor: pointer;
}

a.btn.secondary,
button.secondary,
.file-btn.secondary {
  background: #fff;
  color: var(--text);
  border-color: var(--line);
}

a.btn:hover,
button:hover:not(:disabled),
.file-btn:hover {
  filter: brightness(1.05);
}

button:disabled {
  opacity: 0.55;
  cursor: default;
}

code,
.path {
  font-family: Consolas, "Courier New", monospace;
  font-size: 0.88em;
  background: #f0ebe0;
  padding: 1px 5px;
}

.muted {
  color: var(--muted);
  font-size: 0.9rem;
}

.todo,
.note {
  background: #fff4cc;
  border: 1px solid #f0d66a;
  color: #6b5a00;
  padding: 10px 12px;
  font-size: 0.9rem;
}

ol,
ul {
  margin: 0;
  padding-left: 1.2em;
  line-height: 1.65;
}

li {
  margin-bottom: 6px;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
}

/* 下载中心多表共用列宽，保证两组表格竖线对齐 */
table.dl-cols {
  table-layout: fixed;
}

table.dl-cols th:nth-child(1),
table.dl-cols td:nth-child(1) {
  width: 54%;
  word-break: break-all;
}

table.dl-cols th:nth-child(2),
table.dl-cols td:nth-child(2) {
  width: 32%;
}

table.dl-cols th:nth-child(3),
table.dl-cols td:nth-child(3) {
  width: 14%;
  white-space: nowrap;
}

th,
td {
  border-bottom: 1px solid var(--line);
  padding: 10px 6px;
  text-align: left;
  vertical-align: top;
}

th {
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 600;
}

.badge {
  display: inline-block;
  padding: 2px 8px;
  font-size: 0.75rem;
  font-weight: 600;
  background: #f0ebe0;
  color: var(--muted);
}

.badge.ready,
.badge.ok {
  background: #eaf7ee;
  color: var(--ok);
}

.badge.fail {
  background: #ffeef0;
  color: var(--danger);
}

.badge.skip {
  background: #f0ebe0;
  color: var(--muted);
}

.badge.run {
  background: #fff4cc;
  color: var(--warn);
}

.fig {
  margin: 12px auto 4px;
  /* 默认通栏；窄图可在 .fig 上设 width / --fig-w，容器与图片均水平居中 */
}

.fig img {
  display: block;
  width: var(--fig-w, 100%);
  max-width: 100%;
  height: auto;
  margin-left: auto;
  margin-right: auto;
}

.fig-cap {
  font-size: 0.8rem;
  color: var(--muted);
  margin-bottom: 10px;
  text-align: center;
}

/* 表单 / 运维共用 */
.row {
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: 8px 12px;
  align-items: center;
  margin-bottom: 10px;
}

.row label,
.row>span {
  color: var(--muted);
  font-size: 0.85rem;
}

.actions,
.cred-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}

.meta {
  color: var(--muted);
  font-size: 0.85rem;
  margin: 0 0 12px;
  line-height: 1.45;
  word-break: break-all;
}

.msg {
  margin: 10px 0;
  font-size: 0.9rem;
  min-height: 1.2em;
  padding: 8px 12px;
  border: 1px solid transparent;
  display: none;
}

.msg.show {
  display: block;
}

.msg.err {
  color: var(--danger);
  background: #ffeef0;
  border-color: #ffc7cd;
}

.msg.ok {
  color: var(--ok);
  background: #eaf7ee;
  border-color: #b7e0c2;
}

input[type=text],
input[type=password],
input[type=number],
input[type=datetime-local],
textarea,
select {
  width: 100%;
  font: inherit;
  padding: 7px 10px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--text);
}

textarea {
  min-height: 160px;
  font-family: Consolas, monospace;
  font-size: 0.85rem;
}

.links {
  display: grid;
  gap: 8px;
}

.links a {
  display: block;
  padding: 12px 14px;
  border: 1px solid var(--line);
  text-decoration: none !important;
  color: var(--text) !important;
  background: #fff;
  font-weight: 400 !important;
}

.links a:hover {
  border-color: var(--theme);
}

.links a strong {
  display: block;
  margin-bottom: 2px;
}

.links a span {
  color: var(--muted);
  font-size: 0.85rem;
}

.chk {
  display: flex;
  align-items: center;
  gap: 8px;
}

.summary {
  padding: 10px 12px;
  border: 1px solid transparent;
  margin-bottom: 12px;
  font-size: 0.9rem;
  display: none;
}

.summary.show {
  display: block;
}

.summary.ok {
  color: var(--ok);
  background: #eaf7ee;
  border-color: #b7e0c2;
}

.summary.fail {
  color: var(--danger);
  background: #ffeef0;
  border-color: #ffc7cd;
}

.detail {
  color: var(--muted);
  font-size: 0.8rem;
  margin-top: 4px;
  word-break: break-all;
}

button.busy {
  opacity: 0.7;
  pointer-events: none;
}

button.flash-ok,
.file-btn.flash-ok {
  background: var(--ok) !important;
  border-color: var(--ok) !important;
  color: #fff !important;
}

button.flash-err {
  background: var(--danger) !important;
  border-color: var(--danger) !important;
  color: #fff !important;
}