:root {
  color-scheme: dark;
  /* ── PaperMod 暗色令牌（与 cipherhub.cloud 一致）── */
  --theme: #1d1e20;          /* 页面底色 */
  --entry: #2e2e33;          /* 卡片底色 */
  --primary: #dadadb;        /* 标题 */
  --secondary: #9b9c9d;      /* 次要文字 */
  --tertiary: #414244;       /* 深阶边框/底 */
  --content: #c4c4c5;        /* 正文 */
  --border: #333333;         /* 常规边框 */
  --code-bg: #37383e;
  --accent: #4a90d9;         /* 博客 Pagefind 蓝 */
  --accent-hi: #7ab3ef;      /* 暗底上更亮的链接蓝 */
  --accent-soft: rgba(74, 144, 217, 0.14);
  --diagram-bg: #26272b;     /* 时序图容器底，介于 theme 与 entry 之间 */
  --raise-bg: #34353b;       /* 图内浮起元素（参与者卡、消息标签） */
  --raise-border: #44454c;
  --radius: 8px;
  --radius-lg: 12px;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 10px 30px rgba(0, 0, 0, 0.45);
}

* { box-sizing: border-box; }

html, body { margin: 0; padding: 0; }

html { scrollbar-color: var(--tertiary) var(--theme); }

body {
  background: var(--theme);
  color: var(--content);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  line-height: 1.75;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
}

::selection { background: rgba(74, 144, 217, 0.35); }

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: var(--theme); }
::-webkit-scrollbar-thumb {
  background: var(--tertiary);
  border-radius: 5px;
  border: 2px solid var(--theme);
}
::-webkit-scrollbar-thumb:hover { background: #52545b; }

code {
  padding: 1px 6px;
  border-radius: 5px;
  background: var(--code-bg);
  color: var(--accent-hi);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  font-size: 0.92em;
  word-break: break-all;
}

button { font-family: inherit; }

button:focus-visible,
a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* ─── 顶栏（与博客一致的细栏）─────────────── */

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  background: var(--theme);
  border-bottom: 1px solid var(--border);
}

.topbar-inner {
  max-width: 1440px;
  margin: 0 auto;
  min-height: 60px;
  padding: 0 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.brand-home {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  text-decoration: none;
  border-radius: 8px;
}

.brand-logo {
  width: 34px;
  height: 34px;
  display: block;
  border-radius: 8px;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.08), 0 2px 8px rgba(0, 0, 0, 0.4);
  transition: transform 0.15s;
}

.brand-home:hover .brand-logo { transform: scale(1.05); }

.brand-name {
  font-size: 16px;
  font-weight: 600;
  color: var(--primary);
  letter-spacing: 0.01em;
  white-space: nowrap;
  transition: color 0.15s;
}

.brand-home:hover .brand-name { color: var(--accent-hi); }

.brand-tag {
  color: var(--secondary);
  font-size: 13px;
  white-space: nowrap;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

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

.site-links a {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 13px;
  border: 1px solid var(--tertiary);
  border-radius: 999px;
  background: transparent;
  color: var(--primary);
  font-size: 13px;
  font-weight: 500;
  text-decoration: none;
  white-space: nowrap;
  transition: border-color 0.15s, color 0.15s, background 0.15s;
}

.site-links a::after {
  content: "↗";
  font-size: 11px;
  color: var(--secondary);
  transition: color 0.15s;
}

.site-links a:hover {
  border-color: var(--accent);
  color: var(--accent-hi);
  background: var(--accent-soft);
}

.site-links a:hover::after { color: var(--accent-hi); }

.lang-toggle {
  flex: none;
  min-width: 58px;
  padding: 5px 16px;
  border: 1px solid var(--tertiary);
  border-radius: 999px;
  background: transparent;
  color: var(--primary);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s, background 0.15s;
}

.lang-toggle:hover {
  border-color: var(--accent);
  color: var(--accent-hi);
  background: var(--accent-soft);
}

/* ─── Hero 标题区（呼应博客首页版式）───────── */

.hero {
  max-width: 900px;
  margin: 0 auto;
  padding: 48px 28px 10px;
  text-align: center;
}

.hero-title {
  margin: 0;
  font-family: "Charter", "Bitstream Charter", Cambria, Georgia, "Songti SC", serif;
  font-size: 34px;
  line-height: 1.3;
  font-weight: 700;
  color: var(--primary);
  letter-spacing: -0.01em;
}

.hero-lead {
  margin: 16px auto 0;
  max-width: 640px;
  color: var(--content);
  font-size: 16.5px;
  line-height: 1.75;
  text-wrap: balance;
}

.hero-lead code { font-size: 0.9em; }

.hero-topics {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin: 18px auto 0;
  padding: 0;
  max-width: 860px;
}

.hero-topic {
  display: inline-block;
  padding: 5px 14px;
  border: 1px solid var(--tertiary);
  border-radius: 999px;
  background: var(--entry);
  color: var(--secondary);
  font-size: 13px;
  line-height: 1.6;
  white-space: nowrap;
  text-decoration: none;
  transition: border-color 0.15s, color 0.15s, background 0.15s;
}

.hero-topic:hover {
  border-color: var(--accent);
  color: var(--accent-hi);
  background: rgba(74, 144, 217, 0.1);
}

.hero-hint {
  margin: 14px auto 0;
  color: var(--secondary);
  font-size: 13px;
  line-height: 1.8;
}

/* ─── 场景卡片 ─────────────────────────── */

#app {
  max-width: 1440px;
  margin: 0 auto;
  padding: 26px 28px 80px;
}

@keyframes riseIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

.scenario {
  margin: 0 0 18px;
  padding: 18px 22px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--entry);
  transition: border-color 0.2s, box-shadow 0.2s;
  animation: riseIn 0.4s cubic-bezier(0.22, 0.61, 0.36, 1) both;
}

.scenario:hover {
  border-color: var(--tertiary);
  box-shadow: var(--shadow-md);
}

.scenario:has(.scenario-body.open) {
  border-color: var(--tertiary);
}

.scenario-head {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  width: 100%;
  margin: 0;
  padding: 0;
  border: none;
  background: none;
  text-align: left;
  cursor: pointer;
}

.scenario-index {
  flex: none;
  margin-top: 3px;
  min-width: 42px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius);
  background: var(--accent-soft);
  border: 1px solid rgba(74, 144, 217, 0.35);
  color: var(--accent-hi);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 13.5px;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.scenario-head-text {
  flex: 1 1 auto;
  min-width: 0;
}

.scenario-title {
  display: block;
  font-size: 18.5px;
  line-height: 1.45;
  color: var(--primary);
  font-weight: 600;
  letter-spacing: -0.01em;
}

.scenario-sub {
  display: block;
  margin-top: 4px;
  color: var(--secondary);
  font-size: 14px;
  font-weight: 400;
}

.toggle-indicator {
  flex: none;
  width: 28px;
  height: 28px;
  margin-top: 5px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  line-height: 1;
  color: var(--secondary);
  border: 1px solid var(--tertiary);
  border-radius: 50%;
  background: transparent;
  transition: transform 0.22s cubic-bezier(0.22, 0.61, 0.36, 1), background 0.18s, color 0.18s, border-color 0.18s;
}

.scenario-head:hover .toggle-indicator {
  border-color: var(--accent);
  color: var(--accent-hi);
}

.scenario-head[aria-expanded="true"] .toggle-indicator {
  transform: rotate(90deg);
  background: var(--accent);
  color: #ffffff;
  border-color: var(--accent);
}

@keyframes bodyIn {
  from { opacity: 0; transform: translateY(-6px); }
  to { opacity: 1; transform: translateY(0); }
}

.scenario-body {
  display: none;
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px solid var(--border);
  overflow: visible;
}

.scenario-body.open {
  display: block;
  animation: bodyIn 0.3s cubic-bezier(0.22, 0.61, 0.36, 1) both;
}

.segment-title {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 22px 0 12px;
  font-size: 15px;
  font-weight: 600;
  color: var(--primary);
}

.segment-title:first-of-type { margin-top: 4px; }

.segment-pill {
  flex: none;
  padding: 2px 10px;
  border-radius: 999px;
  background: var(--accent-soft);
  border: 1px solid rgba(74, 144, 217, 0.3);
  color: var(--accent-hi);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.03em;
}

.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
  margin: 0 0 14px;
}

.legend-item {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 13px;
  color: var(--secondary);
}

.legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 3px;
  flex: none;
}

/* ─── 时序图 ───────────────────────────── */

.diagram {
  padding: 20px 18px 26px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--diagram-bg);
}

.diagram + .segment-title { margin-top: 26px; }

.diagram-head {
  display: flex;
  position: sticky;
  top: 61px;
  z-index: 10;
  background: var(--diagram-bg);
  border-radius: 10px 10px 0 0;
}

.diagram-head-clone { border-radius: 10px 10px 0 0; }
.diagram-head-placeholder { display: block; }

.participant {
  flex: 1 1 0;
  min-width: 100px;
  margin: 0 4px;
  padding: 10px 8px 11px;
  border: 1px solid var(--raise-border);
  border-top: 3px solid var(--tertiary);
  border-radius: var(--radius);
  background: var(--raise-bg);
  text-align: center;
  word-break: break-word;
  box-shadow: var(--shadow-sm);
}

.participant-name {
  font-size: 14px;
  font-weight: 600;
  line-height: 1.45;
  color: var(--primary);
}

.diagram-body {
  position: relative;
  margin-top: 18px;
}

.lifelines {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  right: 0;
  pointer-events: none;
  z-index: 0;
}

.lifeline {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 0;
  border-left: 1px dashed #3d3e45;
}

.messages {
  position: relative;
  z-index: 1;
}

.msg-row {
  position: relative;
  padding: 6px 0 10px;
}

.msg {
  position: relative;
  display: block;
  padding: 2px 0 0;
  border: none;
  border-bottom: 2px solid #8a8d96;
  background: none;
  cursor: pointer;
  transition: border-bottom-color 0.15s;
}

.msg.dashed { border-bottom-style: dashed; border-bottom-color: #5c5e66; }

.msg:hover { border-bottom-color: var(--accent); }

.msg.arrow-right::after {
  content: "";
  position: absolute;
  right: -9px;
  bottom: -6px;
  border-left: 9px solid #8a8d96;
  border-top: 6px solid transparent;
  border-bottom: 6px solid transparent;
  transition: border-left-color 0.15s;
}

.msg.arrow-left::before {
  content: "";
  position: absolute;
  left: -9px;
  bottom: -6px;
  border-right: 9px solid #8a8d96;
  border-top: 6px solid transparent;
  border-bottom: 6px solid transparent;
  transition: border-right-color 0.15s;
}

.msg.dashed.arrow-right::after { border-left-color: #5c5e66; }
.msg.dashed.arrow-left::before { border-right-color: #5c5e66; }

.msg:hover.arrow-right::after { border-left-color: var(--accent); }
.msg:hover.arrow-left::before { border-right-color: var(--accent); }

.msg-label {
  display: flex;
  align-items: center;
  gap: 8px;
  width: max-content;
  max-width: min(320px, 100%);
  margin: 0 auto 12px;
  padding: 6px 12px;
  border: 1px solid var(--raise-border);
  border-radius: var(--radius);
  background: var(--raise-bg);
  color: var(--content);
  font-size: 14px;
  line-height: 1.5;
  white-space: normal;
  word-break: break-word;
  text-align: left;
  box-shadow: var(--shadow-sm);
  transition: border-color 0.15s, box-shadow 0.15s, transform 0.15s;
}

.msg:hover .msg-label {
  border-color: var(--accent);
  box-shadow: 0 6px 18px rgba(74, 144, 217, 0.22);
  transform: translateY(-2px);
}

.step-no {
  flex: none;
  min-width: 22px;
  height: 22px;
  padding: 0 5px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: var(--accent);
  color: #ffffff;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 11.5px;
  font-weight: 700;
}

.msg-self {
  display: flex;
  align-items: center;
  gap: 8px;
  width: max-content;
  max-width: min(320px, 90%);
  transform: translateX(-50%);
  padding: 7px 13px;
  border: 1px solid var(--raise-border);
  border-radius: var(--radius);
  background: var(--raise-bg);
  color: var(--content);
  font-size: 14px;
  line-height: 1.5;
  text-align: left;
  cursor: pointer;
  white-space: normal;
  word-break: break-word;
  box-shadow: var(--shadow-sm);
  transition: border-color 0.15s, box-shadow 0.15s;
}

.msg-self::before {
  content: "↺";
  color: #2dd4bf;
  font-weight: 700;
  flex: none;
}

.msg-self:hover {
  border-color: var(--accent);
  box-shadow: 0 6px 18px rgba(74, 144, 217, 0.22);
}

.msg-both {
  display: flex;
  align-items: center;
  gap: 8px;
  width: max-content;
  max-width: min(460px, 92%);
  margin: 0 auto;
  padding: 7px 13px;
  border: 1px solid var(--raise-border);
  border-radius: var(--radius);
  background: var(--raise-bg);
  color: var(--content);
  font-size: 14px;
  line-height: 1.5;
  text-align: left;
  cursor: pointer;
  white-space: normal;
  word-break: break-word;
  box-shadow: var(--shadow-sm);
}

.msg-both::before {
  content: "⇄";
  color: #2dd4bf;
  font-weight: 700;
  flex: none;
}

.msg-both:hover {
  border-color: var(--accent);
  box-shadow: 0 6px 18px rgba(74, 144, 217, 0.22);
}

.msg-note {
  display: block;
  width: 100%;
  margin: 8px 0;
  padding: 11px 16px;
  border: 1px solid rgba(251, 191, 36, 0.35);
  border-left: 4px solid #d9a514;
  border-radius: var(--radius);
  background: rgba(217, 165, 20, 0.1);
  color: #e8c15a;
  font-size: 14px;
  font-weight: 600;
  text-align: center;
  cursor: pointer;
  word-break: break-word;
  transition: background 0.15s, border-color 0.15s;
}

.msg-note:hover {
  background: rgba(217, 165, 20, 0.18);
  border-color: rgba(251, 191, 36, 0.55);
}

/* ─── 注释与相关阅读 ────────────────────── */

.scenario-note {
  margin: 16px 0 0;
  padding: 12px 16px;
  border-left: 3px solid var(--accent);
  border-radius: var(--radius);
  background: var(--accent-soft);
  color: var(--content);
  font-size: 14px;
}

.scenario-note + .scenario-note { margin-top: 10px; }

.related {
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px dashed var(--tertiary);
  display: flex;
  align-items: flex-start;
  gap: 12px;
  flex-wrap: wrap;
}

.related-label {
  flex: none;
  margin-top: 6px;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--secondary);
  letter-spacing: 0.06em;
}

.related-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.related-link {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 13px;
  border: 1px solid var(--tertiary);
  border-radius: 999px;
  background: transparent;
  color: var(--accent-hi);
  font-size: 13.5px;
  font-weight: 500;
  text-decoration: none;
  transition: border-color 0.15s, background 0.15s;
}

.related-link::after {
  content: "↗";
  font-size: 12px;
  color: var(--secondary);
  transition: color 0.15s;
}

.related-link:hover {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.related-link:hover::after { color: var(--accent-hi); }

/* ─── 详情面板 ─────────────────────────── */

.detail-overlay {
  position: fixed;
  inset: 0;
  z-index: 30;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(3px);
}

.detail-panel {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  z-index: 31;
  width: min(640px, 100vw);
  background: var(--entry);
  border-left: 1px solid var(--border);
  box-shadow: -18px 0 48px rgba(0, 0, 0, 0.5);
  transform: translateX(100%);
  transition: transform 0.28s cubic-bezier(0.22, 0.61, 0.36, 1);
}

.detail-panel.open { transform: translateX(0); }

.detail-panel-inner {
  height: 100%;
  display: flex;
  flex-direction: column;
}

.detail-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  padding: 22px 24px 18px;
  background: var(--diagram-bg);
  border-bottom: 1px solid var(--border);
}

.detail-head-text {
  min-width: 0;
}

.detail-scenario {
  display: inline-block;
  margin-bottom: 8px;
  padding: 3px 11px;
  border-radius: 999px;
  background: var(--accent-soft);
  border: 1px solid rgba(74, 144, 217, 0.3);
  color: var(--accent-hi);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.detail-head h2 {
  margin: 0;
  font-size: 18px;
  line-height: 1.5;
  color: var(--primary);
}

.detail-close {
  flex: none;
  width: 34px;
  height: 34px;
  border: 1px solid var(--tertiary);
  border-radius: var(--radius);
  background: transparent;
  color: var(--secondary);
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s, background 0.15s;
}

.detail-close:hover {
  border-color: var(--accent);
  color: var(--accent-hi);
  background: var(--accent-soft);
}

.detail-body {
  overflow-y: auto;
  padding: 22px 24px 36px;
}

.detail-field { margin-bottom: 22px; }

.detail-field h3 {
  display: flex;
  align-items: center;
  gap: 7px;
  margin: 0 0 8px;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--accent-hi);
  letter-spacing: 0.08em;
}

.detail-field h3 svg {
  width: 15px;
  height: 15px;
  flex: none;
}

.detail-field p {
  margin: 0;
  font-size: 15px;
  color: var(--content);
}

.detail-example p {
  padding: 11px 14px;
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius);
  background: var(--diagram-bg);
}

.keyparams {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: 0 0 0 1px var(--border);
}

.keyparams th,
.keyparams td {
  border: 1px solid var(--border);
  padding: 9px 12px;
  text-align: left;
  vertical-align: top;
}

.keyparams th {
  background: var(--diagram-bg);
  color: var(--primary);
  font-weight: 600;
  text-align: center;
  border-bottom-width: 2px;
}

.keyparams tbody tr:nth-child(even) { background: rgba(255, 255, 255, 0.02); }

.keyparams td:first-child {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  color: var(--accent-hi);
  white-space: nowrap;
}

/* ─── 页脚 ─────────────────────────────── */

.footer {
  border-top: 1px solid var(--border);
  background: var(--theme);
}

.footer-inner {
  max-width: 1440px;
  margin: 0 auto;
  padding: 20px 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  flex-wrap: wrap;
  color: var(--secondary);
  font-size: 13.5px;
}

.footer-links {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.footer-links a {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 15px;
  border: 1px solid var(--tertiary);
  border-radius: 999px;
  background: transparent;
  color: var(--primary);
  font-size: 13.5px;
  font-weight: 500;
  text-decoration: none;
  transition: border-color 0.15s, color 0.15s, background 0.15s;
}

.footer-links a::after {
  content: "↗";
  font-size: 12px;
  color: var(--secondary);
  transition: color 0.15s;
}

.footer-links a:hover {
  border-color: var(--accent);
  color: var(--accent-hi);
  background: var(--accent-soft);
}

.footer-links a:hover::after { color: var(--accent-hi); }

/* ─── 分类区块 ─────────────────────────── */

.category { scroll-margin-top: 76px; }

.category-head { margin: 40px 0 14px; }

.category:first-child .category-head { margin-top: 26px; }

.category-title {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 0;
  font-family: "Charter", "Bitstream Charter", Cambria, Georgia, "Songti SC", serif;
  font-size: 23px;
  font-weight: 700;
  color: var(--primary);
  letter-spacing: 0.01em;
  white-space: nowrap;
}

.category-title::after {
  content: "";
  flex: 1;
  border-top: 1px solid var(--border);
}

.category-blurb {
  margin: 8px 0 0;
  max-width: 860px;
  color: var(--secondary);
  font-size: 13.5px;
  line-height: 1.75;
}

/* ─── 变体切换（分段控件） ───────────────── */

.variant-bar {
  display: flex;
  justify-content: flex-end;
  margin: 2px 0 14px;
}

.variant-toggle {
  display: inline-flex;
  gap: 3px;
  padding: 3px;
  border: 1px solid var(--tertiary);
  border-radius: 999px;
  background: var(--entry);
}

.variant-option {
  padding: 5px 16px;
  border: none;
  border-radius: 999px;
  background: transparent;
  color: var(--secondary);
  font-size: 12.5px;
  font-weight: 600;
  line-height: 1.5;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}

.variant-option:hover { color: var(--primary); }

.variant-option.active {
  background: var(--accent);
  color: #ffffff;
  cursor: default;
}

/* ─── 动手验证卡片 ─────────────────────── */

.try-it {
  margin: 2px 0 14px;
  padding: 12px 16px;
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius);
  background: var(--diagram-bg);
}

.try-it-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}

.try-it-title {
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: 0.03em;
  color: var(--accent-hi);
}

.try-it-copy {
  flex: none;
  padding: 4px 14px;
  border: 1px solid var(--tertiary);
  border-radius: 999px;
  background: transparent;
  color: var(--primary);
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s, background 0.15s;
}

.try-it-copy:hover {
  border-color: var(--accent);
  color: var(--accent-hi);
  background: var(--accent-soft);
}

.try-it-copy.copied {
  border-color: #2dd4bf;
  color: #2dd4bf;
}

.try-it-link {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  flex: none;
  padding: 4px 14px;
  border: 1px solid var(--accent);
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent-hi);
  font-size: 12.5px;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
  transition: border-color 0.15s, color 0.15s, background 0.15s;
}

.try-it-link::after {
  content: "↗";
  font-size: 11px;
  color: var(--accent-hi);
  transition: color 0.15s;
}

.try-it-link:hover {
  border-color: var(--accent-hi);
  background: var(--accent);
  color: #ffffff;
}

.try-it-link:hover::after { color: #ffffff; }

.try-it-command {
  display: block;
  padding: 9px 12px;
  border-radius: 6px;
  background: var(--code-bg);
  color: var(--primary);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 13px;
  line-height: 1.6;
  white-space: nowrap;
  overflow-x: auto;
}

.try-it-note {
  margin: 8px 0 0;
  color: var(--secondary);
  font-size: 13px;
  line-height: 1.7;
}

/* ─── 响应式与动效偏好 ──────────────────── */

@media (max-width: 720px) {
  .topbar-inner { padding: 0 14px; flex-wrap: wrap; row-gap: 8px; padding-top: 10px; padding-bottom: 10px; }
  .brand-tag { display: none; }
  .hero { padding: 32px 16px 8px; }
  .hero-title { font-size: 26px; }
  .hero-lead { font-size: 14.5px; }
  .hero-topic { font-size: 12px; white-space: normal; }
  .hero-hint { font-size: 12.5px; }
  .topbar-actions { gap: 6px; }
  .site-links a { padding: 4px 10px; font-size: 12px; }
  #app { padding: 18px 12px 64px; }
  .scenario { padding: 16px 14px; }
  .scenario-index { min-width: 38px; height: 30px; font-size: 12.5px; }
  .scenario-title { font-size: 16.5px; }
  .diagram { padding: 14px 8px 18px; }
  .participant { min-width: 84px; margin: 0 2px; padding: 8px 5px 9px; }
  .participant-name { font-size: 12.5px; }
  .msg-label, .msg-self, .msg-both { font-size: 13px; max-width: 230px; }
  .detail-panel {
    top: auto;
    right: 0;
    left: 0;
    width: 100%;
    height: 78vh;
    transform: translateY(100%);
    border-left: none;
    border-top: 1px solid var(--border);
    border-radius: 16px 16px 0 0;
  }
  .detail-panel.open { transform: translateY(0); }
}

@media (prefers-reduced-motion: reduce) {
  .scenario,
  .scenario-body.open {
    animation: none;
  }
  .toggle-indicator,
  .msg-label,
  .msg-self,
  .lang-toggle {
    transition: none;
  }
}
