/* SimAsst 内置教程共用样式（相对本 HTML 目录引用） */
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sans-serif;
  margin: 20px 40px;
  line-height: 1.65;
  color: #2c3e50;
  max-width: 960px;
}
h1 { color: #1f2933; border-bottom: 2px solid #e0e6ed; padding-bottom: 10px; }
h2 { color: #276ef1; margin-top: 28px; }
h3 { color: #334e68; margin-top: 18px; }
.section { margin-bottom: 26px; }
ul, ol { margin-top: 6px; }
li { margin: 4px 0; }
.tip {
  background: #f5fbff;
  border-left: 4px solid #2e90fa;
  padding: 8px 12px;
  margin: 10px 0;
  font-size: 13px;
}
.warn {
  background: #fffbeb;
  border-left: 4px solid #f59e0b;
  padding: 8px 12px;
  margin: 10px 0;
  font-size: 13px;
}
.kbd {
  display: inline-block;
  padding: 1px 6px;
  border-radius: 3px;
  border: 1px solid #cbd2d9;
  background: #f5f7fa;
  font-size: 12px;
  font-family: Consolas, "Courier New", monospace;
}
.small { font-size: 12px; color: #7b8794; }
.toc {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  padding: 12px 18px;
  margin: 16px 0;
}
.toc a { color: #2563eb; text-decoration: none; }
.toc a:hover { text-decoration: underline; }
a { color: #2563eb; }
code {
  background: #eef2f7;
  padding: 1px 5px;
  border-radius: 3px;
  font-size: 0.92em;
}
pre.flow {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  padding: 10px 12px;
  border-radius: 6px;
  font-size: 12px;
  line-height: 1.5;
  overflow-x: auto;
}
table.data {
  border-collapse: collapse;
  margin-top: 8px;
  font-size: 13px;
  width: 100%;
}
table.data th, table.data td {
  border: 1px solid #d8e2ec;
  padding: 6px 10px;
  text-align: left;
  vertical-align: top;
}
table.data th { background: #f5f7fa; }
.steps { counter-reset: step; list-style: none; padding-left: 0; }
.steps > li {
  counter-increment: step;
  margin: 10px 0 10px 0;
  padding-left: 2.2em;
  position: relative;
}
.steps > li::before {
  content: counter(step);
  position: absolute;
  left: 0;
  top: 0;
  width: 1.6em;
  height: 1.6em;
  line-height: 1.6em;
  text-align: center;
  border-radius: 50%;
  background: #276ef1;
  color: #fff;
  font-size: 12px;
  font-weight: bold;
}
.fig {
  margin: 20px 0 22px 0;
  padding: 0;
  display: block;
  clear: both;
}
.fig img {
  max-width: 100%;
  width: auto;
  height: auto;
  border: 1px solid #d8e2ec;
  border-radius: 8px;
  display: block;
  margin: 0 auto 8px auto;
  background: #f8fafc;
}
.fig figcaption {
  display: block;
  clear: both;
  margin: 0 0 4px 0;
  padding: 0 8px;
  font-size: 12px;
  line-height: 1.45;
  color: #64748b;
  text-align: center;
}
.nav-top { margin-bottom: 12px; }


/* 官网教程页 — 布局与导航（叠加 client tutorial.css） */

:root {
  --brand: #0a9676;
  --brand-dark: #087a60;
  --sidebar-w: 240px;
  --header-h: 48px;
  --bg: #f4f7f9;
  --sidebar-bg: #1a2332;
  --sidebar-text: #c8d4e0;
  --sidebar-active: #ffffff;
}

html {
  scroll-padding-top: calc(var(--header-h) + 12px);
}

body.tutorial-page {
  margin: 0;
  max-width: none;
  background: var(--bg);
  color: #2c3e50;
}

.tutorial-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 200;
  height: var(--header-h);
  display: flex;
  align-items: center;
  gap: 12px;
  padding: env(safe-area-inset-top, 0px) 16px 0;
  background: rgba(26, 35, 50, 0.96);
  color: #fff;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.06);
}

.tutorial-home {
  font-weight: 700;
  color: #fff;
  text-decoration: none;
  letter-spacing: 0.02em;
}

.tutorial-home:hover {
  color: #7ee8c8;
}

.tutorial-header-title {
  flex: 1;
  font-size: 14px;
  color: rgba(255, 255, 255, 0.75);
}

.tutorial-back {
  font-size: 13px;
  color: #7ee8c8;
  text-decoration: none;
  white-space: nowrap;
}

.tutorial-back:hover {
  text-decoration: underline;
}

.sidebar-toggle {
  display: none;
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.25);
  color: #fff;
  border-radius: 6px;
  width: 36px;
  height: 32px;
  cursor: pointer;
  font-size: 16px;
  line-height: 1;
}

.tutorial-layout {
  display: flex;
  min-height: 100vh;
  padding-top: var(--header-h);
}

.tutorial-sidebar {
  position: fixed;
  top: var(--header-h);
  left: 0;
  bottom: 0;
  width: var(--sidebar-w);
  overflow-y: auto;
  background: var(--sidebar-bg);
  border-right: 1px solid rgba(255, 255, 255, 0.06);
  padding: 12px 0 32px;
  box-sizing: border-box;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.tutorial-sidebar-search {
  padding: 14px 14px 16px;
  position: sticky;
  top: 0;
  z-index: 2;
  background: linear-gradient(
    180deg,
    var(--sidebar-bg) 0%,
    var(--sidebar-bg) 78%,
    rgba(26, 35, 50, 0) 100%
  );
}

.tutorial-sidebar-search::after {
  content: "";
  display: block;
  height: 1px;
  margin-top: 14px;
  background: linear-gradient(
    90deg,
    rgba(255, 255, 255, 0) 0%,
    rgba(255, 255, 255, 0.1) 50%,
    rgba(255, 255, 255, 0) 100%
  );
}

.tutorial-search-field {
  display: flex;
  align-items: center;
  min-height: 40px;
  padding: 0 10px 0 2px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.06);
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.18);
  transition: border-color 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
}

.tutorial-search-field:hover {
  border-color: rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.08);
}

.tutorial-search-field:focus-within {
  border-color: rgba(10, 150, 118, 0.75);
  background: rgba(10, 150, 118, 0.12);
  box-shadow:
    inset 0 1px 2px rgba(0, 0, 0, 0.12),
    0 0 0 3px rgba(10, 150, 118, 0.18);
}

.tutorial-search-icon {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  color: rgba(126, 232, 200, 0.72);
  pointer-events: none;
  transition: color 0.2s ease;
}

.tutorial-search-icon svg {
  display: block;
  width: 16px;
  height: 16px;
}

.tutorial-search-field:focus-within .tutorial-search-icon {
  color: #7ee8c8;
}

.tutorial-search-field input[type="search"],
.tutorial-search-field input[type="text"] {
  flex: 1;
  min-width: 0;
  width: 100%;
  box-sizing: border-box;
  margin: 0;
  padding: 8px 4px 8px 0;
  border: none;
  border-radius: 0;
  background: transparent;
  background-color: transparent;
  background-image: none;
  color: #f1f5f9;
  font-size: 13px;
  line-height: 1.4;
  outline: none;
  box-shadow: none;
  -webkit-appearance: none;
  appearance: none;
  -webkit-tap-highlight-color: transparent;
  caret-color: #7ee8c8;
}

.tutorial-search-field input[type="search"]::placeholder,
.tutorial-search-field input[type="text"]::placeholder {
  color: rgba(255, 255, 255, 0.34);
  -webkit-text-fill-color: rgba(255, 255, 255, 0.34);
  opacity: 1;
}

.tutorial-search-field input[type="search"]:not(:placeholder-shown),
.tutorial-search-field input[type="text"]:not(:placeholder-shown) {
  -webkit-text-fill-color: #f1f5f9;
}

.tutorial-search-field input[type="search"]::-webkit-search-decoration,
.tutorial-search-field input[type="search"]::-webkit-search-cancel-button,
.tutorial-search-field input[type="search"]::-webkit-search-results-button,
.tutorial-search-field input[type="search"]::-webkit-search-results-decoration {
  -webkit-appearance: none;
  appearance: none;
  display: none;
}

.tutorial-search-clear {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  margin: 0 2px 0 0;
  padding: 0;
  border: none;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.72);
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
  -webkit-tap-highlight-color: transparent;
}

.tutorial-search-clear[hidden] {
  display: none;
}

.tutorial-search-clear:hover {
  background: rgba(255, 255, 255, 0.18);
  color: #fff;
}

.tutorial-search-clear svg {
  display: block;
  width: 12px;
  height: 12px;
}

/* 微信内置浏览器（X5 内核）常强制 input 白底，需额外覆盖 */
html.env-wechat .tutorial-search-field {
  overflow: hidden;
  transform: translateZ(0);
}

html.env-wechat .tutorial-search-field input[type="text"],
html.env-wechat .tutorial-search-field input[type="search"] {
  background: none !important;
  background-color: transparent !important;
  background-image: none !important;
  border: 0 !important;
  box-shadow: none !important;
  -webkit-box-shadow: none !important;
  -webkit-appearance: none;
  appearance: none;
  opacity: 1;
  color: #f1f5f9;
}

html.env-wechat .tutorial-search-field input[type="text"]:not(:placeholder-shown),
html.env-wechat .tutorial-search-field input[type="search"]:not(:placeholder-shown) {
  -webkit-text-fill-color: #f1f5f9;
}

html.env-wechat .tutorial-search-field input[type="text"]::placeholder,
html.env-wechat .tutorial-search-field input[type="search"]::placeholder {
  color: rgba(255, 255, 255, 0.34);
  -webkit-text-fill-color: rgba(255, 255, 255, 0.34);
  opacity: 1;
}

html.env-wechat .tutorial-search-field input[type="text"]:-webkit-autofill,
html.env-wechat .tutorial-search-field input[type="search"]:-webkit-autofill {
  -webkit-box-shadow: 0 0 0 1000px transparent inset !important;
  box-shadow: 0 0 0 1000px transparent inset !important;
  -webkit-text-fill-color: #f1f5f9 !important;
  transition: background-color 99999s ease-out 0s;
}

.tutorial-tool-results {
  margin: 2px 0 0;
  padding: 0 0 10px;
}

.tutorial-tool-results-label {
  padding: 8px 18px 6px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(126, 232, 200, 0.55);
}

.tutorial-tool-results-list {
  list-style: none;
  margin: 0;
  padding: 0 8px;
}

.tutorial-tool-results-list li {
  margin: 2px 0;
}

.tutorial-tool-results-list a {
  display: block;
  padding: 8px 12px;
  font-size: 13px;
  color: #c8f7e8;
  text-decoration: none;
  border-radius: 8px;
  border-left: 2px solid transparent;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.tutorial-tool-results-list a:hover {
  background: rgba(10, 150, 118, 0.16);
  border-left-color: var(--brand);
  color: #fff;
}

.tutorial-search-empty {
  margin: 10px 18px 0;
  padding: 10px 12px;
  font-size: 12px;
  line-height: 1.5;
  color: rgba(255, 255, 255, 0.5);
  text-align: center;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px dashed rgba(255, 255, 255, 0.12);
}

.tutorial-nav .nav-group[hidden],
.tutorial-nav li[hidden] {
  display: none;
}

.tutorial-nav .nav-group {
  margin-bottom: 14px;
}

.tutorial-nav .nav-group-label {
  display: block;
  padding: 4px 18px 6px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.38);
}

.tutorial-nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.tutorial-nav li a {
  display: block;
  padding: 7px 18px;
  font-size: 13px;
  color: var(--sidebar-text);
  text-decoration: none;
  border-left: 3px solid transparent;
  transition: background 0.15s, color 0.15s;
}

.tutorial-nav li a:hover {
  background: rgba(255, 255, 255, 0.06);
  color: #fff;
}

.tutorial-nav li.active a {
  color: var(--sidebar-active);
  background: rgba(10, 150, 118, 0.22);
  border-left-color: var(--brand);
  font-weight: 600;
}

.tutorial-search-panel {
  max-width: 880px;
  margin: 0 auto 18px;
}

.tutorial-search-panel-head {
  margin-bottom: 14px;
}

.tutorial-search-panel-title {
  margin: 0 0 6px;
  font-size: 20px;
  color: #1f2933;
}

.tutorial-search-panel-summary {
  margin: 0;
  font-size: 13px;
  color: #64748b;
}

.tutorial-content-results {
  display: grid;
  gap: 12px;
}

.tutorial-search-card {
  display: block;
  padding: 16px 18px;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  text-decoration: none;
  color: inherit;
  box-shadow: 0 2px 12px rgba(15, 35, 55, 0.06);
  transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}

.tutorial-search-card:hover {
  border-color: #b8e6d8;
  box-shadow: 0 8px 24px rgba(10, 150, 118, 0.12);
  transform: translateY(-1px);
}

.tutorial-search-card-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

.tutorial-search-card-title {
  font-size: 15px;
  font-weight: 600;
  color: #0f766e;
}

.tutorial-search-card-tag {
  flex-shrink: 0;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
  color: #64748b;
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
}

.tutorial-search-card-snippet {
  margin: 0;
  font-size: 13px;
  line-height: 1.65;
  color: #475569;
}

.tutorial-search-hit {
  padding: 0 2px;
  border-radius: 3px;
  background: rgba(10, 150, 118, 0.18);
  color: #065f46;
  font-weight: 600;
}

.tutorial-main {
  flex: 1;
  margin-left: var(--sidebar-w);
  min-width: 0;
  padding: 24px 28px 48px;
}

.tutorial-article {
  max-width: 880px;
  margin: 0 auto;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 2px 16px rgba(15, 35, 55, 0.07);
  padding: 28px 36px 36px;
}

.tutorial-article[hidden] {
  display: none;
}

.tutorial-article h1 {
  margin-top: 0;
  border-bottom-color: #e8eef4;
}

.tutorial-article h2 {
  color: var(--brand-dark);
}

.tutorial-article .toc {
  background: #f8fbfa;
  border-color: #d8ebe4;
}

.tutorial-article .tip {
  background: #f0faf7;
  border-left-color: var(--brand);
}

.sidebar-backdrop {
  display: none;
}

@media (max-width: 900px) {
  .sidebar-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  .tutorial-sidebar {
    transform: translateX(-100%);
    transition: transform 0.22s ease;
    z-index: 150;
    box-shadow: 4px 0 24px rgba(0, 0, 0, 0.2);
  }

  .tutorial-sidebar.is-open {
    transform: translateX(0);
  }

  .sidebar-backdrop {
    display: block;
    position: fixed;
    inset: var(--header-h) 0 0 0;
    z-index: 140;
    background: rgba(0, 0, 0, 0.45);
  }

  .sidebar-backdrop[hidden] {
    display: none;
  }

  .tutorial-main {
    margin-left: 0;
    padding: 16px 12px 32px;
  }

  .tutorial-article {
    padding: 20px 18px 28px;
    border-radius: 10px;
  }

  body.tutorial-page {
    margin: 0;
  }
}

@media (max-width: 767px) {
  :root {
    --header-h: 50px;
  }

  .tutorial-header {
    flex-wrap: nowrap;
    height: var(--header-h);
    min-height: var(--header-h);
    gap: 8px;
    padding: 0 10px;
    padding-top: env(safe-area-inset-top, 0px);
  }

  .tutorial-header-title {
    display: none;
  }

  .tutorial-home {
    flex: 1;
    min-width: 0;
    font-size: 15px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .tutorial-back {
    flex-shrink: 0;
    font-size: 12px;
    padding: 6px 8px;
    border: 1px solid rgba(255, 255, 255, 0.22);
    border-radius: 6px;
    white-space: nowrap;
  }

  .sidebar-toggle {
    flex-shrink: 0;
    width: 38px;
    height: 38px;
  }

  .tutorial-layout {
    padding-top: calc(var(--header-h) + env(safe-area-inset-top, 0px));
  }

  .tutorial-header .account-widget {
    flex-shrink: 0;
  }

  .tutorial-header .account-widget__btn {
    width: 34px;
    height: 34px;
  }

  .tutorial-main {
    padding: 12px 10px calc(28px + env(safe-area-inset-bottom, 0px));
  }

  .tutorial-article {
    padding: 16px 14px 22px;
    border-radius: 8px;
    overflow-wrap: anywhere;
  }

  .tutorial-article img,
  .tutorial-article table {
    max-width: 100%;
  }

  .tutorial-article pre {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .tutorial-sidebar-search {
    padding: 12px 12px 14px;
  }

  .tutorial-search-field {
    min-height: 44px;
    padding: 0 12px 0 4px;
    border-radius: 10px;
  }

  .tutorial-search-icon {
    width: 36px;
    height: 36px;
  }

  .tutorial-search-field input[type="search"],
  .tutorial-search-field input[type="text"] {
    padding: 10px 0;
    font-size: 16px;
    line-height: 1.35;
  }

  .tutorial-search-clear {
    width: 30px;
    height: 30px;
  }

  .tutorial-search-clear svg {
    width: 13px;
    height: 13px;
  }

  .tutorial-search-panel-title {
    font-size: 18px;
  }

  .tutorial-search-card {
    padding: 14px 14px;
  }
}
