/* Satori 账户与教程响应式工具样式，版本 20260816c。助手组件样式位于 assistant-core.css。 */
:root {
  --st-primary: #2563eb;
  --st-primary-hover: #1d4ed8;
  --st-primary-soft: #eff6ff;
  --st-text: #1e293b;
  --st-muted: #64748b;
  --st-border: #dbe3ee;
  --st-surface: #ffffff;
  --st-surface-soft: #f8fafc;
  --st-danger: #b42318;
  --st-success: #166534;
  --st-warning: #9a5b00;
  --st-radius: 12px;
  --st-shadow: 0 24px 70px rgba(15, 23, 42, 0.2);
}

.st-tutorial-tools {
  position: fixed;
  top: 0;
  right: auto;
  left: max(21rem, calc((100vw - 96rem) / 2 + 21rem));
  z-index: 8500;
  display: flex;
  height: 4rem;
  align-items: center;
  justify-content: center;
  gap: 0.65rem;
  padding: 0.6rem 1.25rem;
  width: min(56rem, calc(100vw - 40rem));
  box-sizing: border-box;
  background: rgba(255, 255, 255, 0.96);
  border-bottom: 1px solid var(--st-border);
  backdrop-filter: blur(14px);
}
.st-tutorial-search { width: min(42rem, calc(100% - 10rem)); }
.st-tutorial-search .book-search { position: relative; margin: 0; }
.st-tutorial-search .book-search input {
  height: 2.65rem;
  padding: 0 2.6rem 0 2.75rem;
  color: var(--st-text);
  background: var(--st-surface-soft);
  border: 1px solid var(--st-border);
  border-radius: 12px;
  box-shadow: none;
}
.st-tutorial-search .book-search::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 0.9rem;
  z-index: 1;
  width: 1rem;
  height: 1rem;
  border: 1.8px solid var(--st-muted);
  border-radius: 50%;
  box-sizing: border-box;
  transform: translateY(-58%);
  pointer-events: none;
}
.st-tutorial-search .book-search::after {
  content: "";
  position: absolute;
  top: calc(50% + 0.35rem);
  left: 1.72rem;
  z-index: 1;
  width: 0.42rem;
  height: 1.8px;
  background: var(--st-muted);
  transform: rotate(45deg);
  pointer-events: none;
}
.st-tutorial-search #book-search-results {
  position: absolute;
  top: calc(100% + 0.55rem);
  right: 0;
  left: 0;
  max-height: min(60vh, 34rem);
  margin: 0;
  padding: 0.45rem;
  overflow-y: auto;
  background: var(--st-surface);
  border: 1px solid var(--st-border);
  border-radius: 12px;
  box-shadow: var(--st-shadow);
}
.st-tutorial-search #book-search-results:empty { display: none; }
.st-tutorial-search-trigger {
  display: none;
  align-items: center;
  justify-content: center;
  color: var(--st-primary);
  background: var(--st-surface);
  border: 1px solid var(--st-border);
  border-radius: 12px;
  font: inherit;
  cursor: pointer;
}
.st-tutorial-search-trigger:hover { background: var(--st-primary-soft); border-color: #a9c3fb; }
.st-tutorial-search-trigger:focus-visible { outline: 3px solid rgba(37, 99, 235, 0.28); outline-offset: 2px; }
.st-tutorial-search-trigger svg {
  width: 1.15rem;
  height: 1.15rem;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
}
.st-tutorial-assistant-trigger {
  display: inline-flex;
  min-width: 8.8rem;
  height: 2.65rem;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  padding: 0 0.9rem;
  color: #1e4b9e;
  background: var(--st-primary-soft);
  border: 1px solid #bfd2f7;
  border-radius: 12px;
  font: inherit;
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
  transition: background-color 180ms ease, border-color 180ms ease;
}
.st-tutorial-assistant-trigger:hover { color: #173f99; background: #dbeafe; border-color: #93b4f5; }
.st-tutorial-assistant-trigger:focus-visible { outline: 3px solid rgba(37, 99, 235, 0.28); outline-offset: 2px; }
.st-tutorial-assistant-trigger svg { width: 1.15rem; height: 1.15rem; fill: none; stroke: currentColor; stroke-width: 1.7; }
.st-tutorial-shell .st-assistant-fab { display: none; }

@media (min-width: 721px) {
  .st-assistant-open .st-tutorial-tools {
    right: auto;
    left: calc(
      18rem
      + max(
        1rem,
        (100vw - var(--st-assistant-desktop-width) - 18rem - 56rem) / 2
      )
    );
    width: min(
      56rem,
      calc(100vw - var(--st-assistant-desktop-width) - 20rem)
    );
  }
}

@media (max-width: 55.99rem) {
  .book-toc,
  .book-header label[for="toc-control"] {
    display: none !important;
  }
  .book-header > .flex > h3 {
    min-width: 0;
    flex: 1 1 auto;
    white-space: nowrap;
  }
  .st-tutorial-tools {
    position: static;
    z-index: auto;
    display: flex;
    width: auto;
    height: auto;
    flex: 0 0 auto;
    justify-content: flex-end;
    gap: 0.3rem;
    padding: 0;
    background: transparent;
    border: 0;
    backdrop-filter: none;
  }
  .st-tutorial-search-trigger,
  .st-tutorial-assistant-trigger {
    display: inline-flex;
    width: 2.55rem;
    min-width: 2.55rem;
    height: 2.55rem;
    padding: 0;
  }
  .st-tutorial-search {
    position: absolute;
    top: calc(100% + 0.4rem);
    right: 0.65rem;
    left: 0.65rem;
    display: none;
    width: auto;
    padding: 0.55rem;
    background: var(--st-surface);
    border: 1px solid var(--st-border);
    border-radius: 14px;
    box-shadow: var(--st-shadow);
  }
  .st-tutorial-tools[data-search-open="true"] .st-tutorial-search { display: block; }
  .st-tutorial-search .book-search input { height: 2.55rem; }
  .st-tutorial-assistant-trigger span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
}

.book-menu .book-menu-header .book-brand {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.book-menu .book-menu-header .book-brand > a {
  min-width: 0;
  flex: 1 1 auto;
}

.book-menu .book-menu-header .book-brand > a span {
  font-size: 0.78rem;
  letter-spacing: -0.02em;
  white-space: nowrap;
}

.st-account-trigger {
  position: relative;
  display: inline-flex;
  flex: 0 0 auto;
  width: 2.5rem;
  height: 2.5rem;
  align-items: center;
  justify-content: center;
  padding: 0;
  color: var(--st-text);
  background: var(--st-surface);
  border: 1px solid var(--st-border);
  border-radius: 50%;
  font: inherit;
  font-size: 0.75rem;
  cursor: pointer;
  transition: background-color 180ms ease, border-color 180ms ease, color 180ms ease;
}

.st-account-trigger:hover {
  color: var(--st-primary);
  background: var(--st-primary-soft);
  border-color: #a9c3fb;
}

.st-account-trigger:focus-visible,
.st-button:focus-visible,
.st-nav-button:focus-visible,
.st-icon-button:focus-visible,
.st-field input:focus-visible,
.st-field textarea:focus-visible {
  outline: 3px solid rgba(37, 99, 235, 0.28);
  outline-offset: 2px;
}

.st-account-trigger svg,
.st-icon-button svg,
.st-nav-button svg {
  width: 1.15rem;
  height: 1.15rem;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.st-account-trigger img {
  width: 100%;
  height: 100%;
  padding: 2px;
  box-sizing: border-box;
  object-fit: cover;
  border-radius: 50%;
}

.st-account-dialog {
  width: min(94vw, 940px);
  height: min(820px, calc(100dvh - 48px));
  max-width: none;
  max-height: none;
  padding: 0;
  color: var(--st-text);
  background: var(--st-surface);
  border: 1px solid var(--st-border);
  border-radius: 18px;
  box-shadow: var(--st-shadow);
  overflow: hidden;
}

.st-account-dialog::backdrop {
  background: rgba(15, 23, 42, 0.52);
  backdrop-filter: blur(2px);
}

.st-purchase-dialog {
  width: min(28rem, calc(100vw - 2rem));
  max-width: none;
  padding: 0;
  color: var(--st-text);
  background: var(--st-surface);
  border: 1px solid var(--st-border);
  border-radius: 16px;
  box-shadow: var(--st-shadow);
  overflow: hidden;
}

.st-purchase-dialog::backdrop {
  background: rgba(15, 23, 42, 0.52);
  backdrop-filter: blur(2px);
}

.st-purchase-shell {
  display: grid;
}

.st-purchase-header {
  display: flex;
  min-height: 4rem;
  align-items: center;
  gap: 0.75rem;
  padding: 0 1.25rem;
  border-bottom: 1px solid var(--st-border);
}

.st-purchase-header .st-dialog-title {
  flex: 1 1 auto;
}

.st-purchase-content {
  padding: 1.25rem;
}

.st-purchase-content .st-status-card {
  margin-bottom: 1.25rem;
}

.st-purchase-content .st-status-card[data-state="error"] {
  background: #fff1f0;
  border-color: #efb8b2;
}

.st-purchase-content .st-status-card[data-state="error"] svg {
  stroke: var(--st-danger);
}

.st-purchase-content .st-button-row {
  justify-content: flex-end;
}

.st-dialog-shell {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  width: 100%;
  height: 100%;
}

.st-dialog-header {
  display: flex;
  min-height: 4rem;
  align-items: center;
  gap: 0.75rem;
  padding: 0 1.25rem;
  border-bottom: 1px solid var(--st-border);
}

.st-dialog-header-copy {
  min-width: 0;
  flex: 1 1 auto;
}

.st-dialog-title {
  margin: 0;
  color: var(--st-text);
  font-size: 1.05rem;
  font-weight: 700;
  line-height: 1.3;
}

.st-icon-button {
  display: inline-flex;
  width: 2.5rem;
  height: 2.5rem;
  align-items: center;
  justify-content: center;
  color: var(--st-muted);
  background: transparent;
  border: 0;
  border-radius: 10px;
  cursor: pointer;
}

.st-icon-button:hover {
  color: var(--st-text);
  background: var(--st-surface-soft);
}

.st-mobile-menu-button,
.st-mobile-menu-backdrop {
  display: none;
}

.st-dialog-main {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  min-height: 0;
}

.st-account-sidebar {
  display: flex;
  min-height: 0;
  flex-direction: column;
  padding: 1rem 0.75rem;
  background: var(--st-surface-soft);
  border-right: 1px solid var(--st-border);
}

.st-account-nav {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  gap: 0.25rem;
}

.st-nav-button {
  display: flex;
  width: 100%;
  min-height: 2.75rem;
  align-items: center;
  gap: 0.7rem;
  padding: 0.55rem 0.75rem;
  color: var(--st-text);
  background: transparent;
  border: 1px solid transparent;
  border-radius: 10px;
  font: inherit;
  font-size: 0.86rem;
  text-align: left;
  cursor: pointer;
}

.st-nav-button:hover {
  background: #eef2f7;
}

.st-nav-button[aria-current="page"] {
  color: #173f99;
  background: var(--st-primary-soft);
  border-color: #c7d8fb;
  font-weight: 650;
}

.st-nav-button.st-nav-danger {
  margin-top: auto;
  color: var(--st-danger);
}

.st-nav-button.st-nav-danger:hover {
  background: #fff1f0;
}

.st-account-content {
  min-width: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 1.5rem clamp(1.1rem, 3vw, 2.25rem) 2rem;
}

.st-view-heading {
  margin: 0 0 1.25rem;
  color: var(--st-text);
  font-size: clamp(1.25rem, 2vw, 1.6rem);
  line-height: 1.3;
}

.st-card-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.9rem;
}

.st-card,
.st-status-card {
  padding: 1rem;
  background: var(--st-surface);
  border: 1px solid var(--st-border);
  border-radius: var(--st-radius);
}

.st-card-title {
  margin: 0 0 0.35rem;
  color: var(--st-text);
  font-size: 0.88rem;
  font-weight: 700;
}

.st-card-value {
  margin: 0;
  color: var(--st-text);
  font-size: 1.35rem;
  font-weight: 750;
}

.st-card-note {
  margin: 0.4rem 0 0;
  color: var(--st-muted);
  font-size: 0.78rem;
  line-height: 1.6;
}

.st-profile-card {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 1rem;
  margin-bottom: 1rem;
}

.st-profile-card img,
.st-profile-avatar {
  display: inline-flex;
  width: 4rem;
  height: 4rem;
  align-items: center;
  justify-content: center;
  object-fit: cover;
  color: #1e4b9e;
  background: var(--st-primary-soft);
  border: 1px solid #bfd2f7;
  border-radius: 50%;
  font-size: 1.15rem;
  font-weight: 800;
}

.st-profile-name {
  margin: 0;
  font-size: 1.12rem;
  font-weight: 750;
}

.st-profile-meta {
  margin: 0.25rem 0 0;
  color: var(--st-muted);
  font-size: 0.8rem;
  overflow-wrap: anywhere;
}

.st-badge {
  display: inline-flex;
  min-height: 1.6rem;
  align-items: center;
  padding: 0.18rem 0.55rem;
  color: #173f99;
  background: var(--st-primary-soft);
  border: 1px solid #c7d8fb;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
}

.st-badge.st-badge-muted {
  color: #475569;
  background: #f1f5f9;
  border-color: #dbe3ee;
}

.st-status-card {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  margin-bottom: 1rem;
  background: var(--st-primary-soft);
  border-color: #c7d8fb;
}

.st-status-card svg {
  width: 1.5rem;
  height: 1.5rem;
  flex: 0 0 auto;
  fill: none;
  stroke: var(--st-primary);
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.st-status-card p {
  margin: 0;
  font-size: 0.86rem;
  line-height: 1.65;
}

.st-field {
  display: grid;
  gap: 0.4rem;
  margin-bottom: 0.9rem;
}

.st-field label,
.st-field-label {
  color: var(--st-text);
  font-size: 0.82rem;
  font-weight: 650;
}

.st-field input,
.st-field textarea {
  width: 100%;
  min-height: 2.75rem;
  box-sizing: border-box;
  padding: 0.65rem 0.75rem;
  color: var(--st-text);
  background: var(--st-surface);
  border: 1px solid #cbd5e1;
  border-radius: 10px;
  font: inherit;
  font-size: 0.9rem;
}

.st-field textarea {
  min-height: 6rem;
  resize: vertical;
}

.st-field-help {
  margin: 0;
  color: var(--st-muted);
  font-size: 0.75rem;
  line-height: 1.5;
}

.st-form-row,
.st-button-row,
.st-auth-tabs {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.65rem;
}

.st-button-row-centered {
  justify-content: center;
}

.st-button-row-spaced {
  margin: 1rem 0;
}

.st-button-row-top {
  margin-top: 0.8rem;
}

.st-auth-tabs {
  margin-bottom: 1rem;
  padding-bottom: 0.65rem;
  border-bottom: 1px solid var(--st-border);
}

.st-auth-tab {
  min-height: 2.4rem;
  padding: 0.45rem 0.7rem;
  color: var(--st-muted);
  background: transparent;
  border: 0;
  border-bottom: 2px solid transparent;
  font: inherit;
  font-size: 0.84rem;
  cursor: pointer;
}

.st-auth-tab[aria-selected="true"] {
  color: var(--st-primary);
  border-bottom-color: var(--st-primary);
  font-weight: 700;
}

.st-button {
  display: inline-flex;
  min-height: 2.65rem;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  padding: 0.55rem 0.9rem;
  color: #fff;
  background: var(--st-primary);
  border: 1px solid var(--st-primary);
  border-radius: 10px;
  font: inherit;
  font-size: 0.84rem;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
}

.st-button:hover {
  color: #fff;
  background: var(--st-primary-hover);
  border-color: var(--st-primary-hover);
}

.st-button.st-button-secondary {
  color: var(--st-text);
  background: var(--st-surface);
  border-color: #cbd5e1;
}

.st-button.st-button-secondary:hover {
  color: var(--st-primary);
  background: var(--st-primary-soft);
  border-color: #a9c3fb;
}

.st-button.st-button-danger {
  color: var(--st-danger);
  background: #fff;
  border-color: #efb8b2;
}

.st-button:disabled,
.st-auth-tab:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.st-form-message {
  min-height: 1.4rem;
  margin: 0.75rem 0 0;
  color: var(--st-muted);
  font-size: 0.8rem;
  line-height: 1.5;
}

.st-form-message[data-state="error"] {
  color: var(--st-danger);
}

.st-form-message[data-state="success"] {
  color: var(--st-success);
}

.st-list {
  display: grid;
  gap: 0.7rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.st-list-item {
  display: grid;
  gap: 0.45rem;
  padding: 0.9rem;
  background: var(--st-surface);
  border: 1px solid var(--st-border);
  border-radius: 10px;
}

.st-list-item-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
}

.st-list-item-title {
  margin: 0;
  color: var(--st-text);
  font-size: 0.88rem;
  font-weight: 700;
  overflow-wrap: anywhere;
}

.st-list-item-meta {
  margin: 0;
  color: var(--st-muted);
  font-size: 0.74rem;
  line-height: 1.5;
}

.st-progress-item-actions {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 0.5rem;
}

.st-button.st-button-compact {
  min-height: 2rem;
  padding: 0.35rem 0.65rem;
  font-size: 0.72rem;
}

.st-progress-track {
  height: 0.45rem;
  overflow: hidden;
  background: #e8edf4;
  border-radius: 999px;
}

.st-progress-value {
  height: 100%;
  width: var(--st-progress, 0%);
  background: var(--st-primary);
  border-radius: inherit;
}

.st-empty,
.st-loading {
  padding: 2rem 1rem;
  color: var(--st-muted);
  text-align: center;
  font-size: 0.86rem;
}

.st-divider {
  height: 1px;
  margin: 1.25rem 0;
  background: var(--st-border);
  border: 0;
}

.st-faq {
  display: grid;
  gap: 0.65rem;
}

.st-faq details {
  padding: 0.75rem 0.85rem;
  background: var(--st-surface-soft);
  border: 1px solid var(--st-border);
  border-radius: 10px;
}

.st-faq summary {
  color: var(--st-text);
  font-size: 0.84rem;
  font-weight: 700;
  cursor: pointer;
}

.st-faq p {
  margin: 0.6rem 0 0;
  color: var(--st-muted);
  font-size: 0.8rem;
  line-height: 1.65;
}

.st-member-gate {
  grid-row: 2 / -1;
  overflow-y: auto;
  padding: 1rem;
}

.st-member-gate .st-view-heading {
  font-size: 1.15rem;
}

.tutorial-session-lost .book-page {
  visibility: hidden;
}

.st-anonymous-article {
  width: 100%;
  max-width: none;
}

.st-content-gate {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-top: 1.5rem;
  padding: 1.15rem 1.25rem;
  background: var(--st-surface-soft);
  border: 1px solid var(--st-border);
  border-radius: var(--st-radius);
}

.st-content-gate svg {
  flex: 0 0 auto;
  width: 2rem;
  height: 2rem;
  fill: none;
  stroke: var(--st-primary);
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.st-content-gate h2 {
  margin: 0 0 0.75rem;
  font-size: 1.05rem;
}

@media (max-width: 720px) {
  .st-account-trigger,
  .st-icon-button {
    min-width: 2.75rem;
    min-height: 2.75rem;
  }

  .st-account-dialog {
    width: 100vw;
    height: 100dvh;
    border: 0;
    border-radius: 0;
  }

  .st-dialog-main {
    position: relative;
    display: block;
    min-height: 0;
    overflow: hidden;
  }

  .st-account-sidebar {
    position: absolute;
    z-index: 3;
    inset: 0 auto 0 0;
    display: flex;
    width: min(82vw, 19rem);
    height: 100%;
    box-sizing: border-box;
    padding: 1rem 0.75rem calc(1rem + env(safe-area-inset-bottom));
    border-right: 1px solid var(--st-border);
    border-bottom: 0;
    overflow-y: auto;
    transform: translateX(-101%);
    transition: transform 180ms ease;
    box-shadow: 12px 0 30px rgba(15, 23, 42, 0.16);
  }

  .st-account-nav {
    width: 100%;
    min-width: 0;
    flex-direction: column;
    gap: 0.25rem;
  }

  .st-nav-button {
    width: 100%;
    min-width: 0;
    min-height: 2.75rem;
    flex: 0 0 auto;
    padding: 0.55rem 0.75rem;
    white-space: normal;
  }

  .st-nav-button.st-nav-danger {
    margin-top: auto;
    margin-left: 0;
  }

  .st-account-content {
    display: block;
    height: 100%;
    min-height: 0;
    box-sizing: border-box;
    padding: 1rem 1rem calc(1.5rem + env(safe-area-inset-bottom));
    overflow-y: auto;
  }

  .st-mobile-menu-button {
    display: inline-flex;
  }

  .st-mobile-menu-backdrop {
    position: absolute;
    z-index: 2;
    inset: 0;
    width: 100%;
    height: 100%;
    padding: 0;
    background: rgba(15, 23, 42, 0.38);
    border: 0;
    opacity: 0;
    pointer-events: none;
    transition: opacity 180ms ease;
  }

  .st-dialog-shell[data-mobile-menu="open"] .st-account-sidebar {
    transform: translateX(0);
  }

  .st-dialog-shell[data-mobile-menu="open"] .st-mobile-menu-backdrop {
    display: block;
    opacity: 1;
    pointer-events: auto;
  }

  @media (prefers-reduced-motion: reduce) {
    .st-account-sidebar,
    .st-mobile-menu-backdrop {
      transition: none;
    }
  }

  .st-card-grid {
    grid-template-columns: 1fr;
  }

  .st-list-item-header,
  .st-progress-item-actions {
    align-items: stretch;
  }

  .st-list-item-header {
    flex-direction: column;
  }

  .st-progress-item-actions {
    justify-content: space-between;
  }

}

@media (max-width: 390px) {
  .st-dialog-header {
    padding: 0 0.8rem;
  }

}

@media (prefers-reduced-motion: reduce) {
  .st-account-trigger,
  .st-button {
    transition: none;
  }
}
