:root {
  --preview-pink-bg: #fff5f8;
  --preview-pink: #f8c8dc;
  --preview-pink-border: #f7e2e9;
  --preview-ink: #a3476d;
  --preview-muted: #a05b77;
  --preview-glass: rgba(255, 245, 248, 0.72);
  --preview-shadow: 0 4px 14px rgba(248, 200, 220, 0.25);
}

/* Preview-only page surfaces. The desktop and all unrelated app pages stay untouched. */
html body #settings,
html body #api-settings-detail {
  background: var(--preview-pink-bg) !important;
  color: var(--preview-ink);
}

html body #settings > .nav-bar:first-child,
html body #api-settings-detail > .nav-bar:first-child {
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
}

html body #settings > .nav-bar:first-child {
  position: relative !important;
}

html body #settings > .nav-bar:first-child .nav-title {
  position: absolute !important;
  left: 50% !important;
  top: 50% !important;
  width: max-content !important;
  margin: 0 !important;
  /* Individual translate and transform are cumulative; offset only once. */
  translate: none !important;
  transform: translate(-50%, -50%) !important;
  text-align: center !important;
  color: var(--preview-ink) !important;
  font-family: Georgia, "Songti SC", serif !important;
  font-style: italic;
  font-size: 17px !important;
  font-weight: 500 !important;
}

html body #settings > .nav-bar:first-child .nav-title::after {
  content: none;
  display: none;
}

html body #api-settings-detail > .nav-bar:first-child,
html body #data-management-page > .nav-bar:first-child,
html body #wallpaper-settings-page > .nav-bar:first-child,
html body #notification-sound-settings-detail > .nav-bar:first-child,
html body #minimax-settings-detail > .nav-bar:first-child,
html body #prompt-engine-settings-page > .nav-bar:first-child,
html body #payment-settings-page > .nav-bar:first-child,
html body #font-settings-page > .nav-bar:first-child,
html body #app-icon-settings-page > .nav-bar:first-child {
  position: relative !important;
}

html body #api-settings-detail > .nav-bar:first-child .nav-title,
html body #data-management-page > .nav-bar:first-child .nav-title,
html body #wallpaper-settings-page > .nav-bar:first-child .nav-title,
html body #notification-sound-settings-detail > .nav-bar:first-child .nav-title,
html body #minimax-settings-detail > .nav-bar:first-child .nav-title,
html body #prompt-engine-settings-page > .nav-bar:first-child .nav-title,
html body #payment-settings-page > .nav-bar:first-child .nav-title,
html body #font-settings-page > .nav-bar:first-child .nav-title,
html body #app-icon-settings-page > .nav-bar:first-child .nav-title {
  position: absolute !important;
  left: 50% !important;
  top: 50% !important;
  width: max-content !important;
  margin: 0 !important;
  /* Individual translate and transform are cumulative; offset only once. */
  translate: none !important;
  transform: translate(-50%, -50%) !important;
  text-align: center !important;
}

html body #settings > .nav-bar:first-child .nav-left,
html body #api-settings-detail > .nav-bar:first-child .nav-left {
  color: var(--preview-muted) !important;
}

html body #settings > div:nth-child(2) {
  padding: 0 16px 24px !important;
}

html body #settings h1,
html body #settings > div:nth-child(2) > .flex[style*="background: #e8e8e8"] {
  display: none !important;
}

html body #settings > div:nth-child(2) > div[style*="linear-gradient"],
html body #settings > div:nth-child(2) > button[data-target="world-book"],
html body #settings > div:nth-child(2) > div[style*="background: #fff"],
html body #api-settings-detail .form-card {
  background: var(--preview-glass) !important;
  border: 1px solid var(--preview-pink-border) !important;
  border-radius: 18px !important;
  box-shadow: var(--preview-shadow) !important;
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
}

html body #settings > div:nth-child(2) > div[style*="linear-gradient"] {
  margin-bottom: 16px !important;
}

html body #settings [id$="-setting-item"],
html body #settings > div:nth-child(2) > div[style*="linear-gradient"] > .flex-between {
  min-height: 52px;
}

html body #settings [id$="-setting-item"] > .flex > .flex-center,
html body #settings [id$="-setting-item"] .flex-center[style*="width: 28px"] {
  width: 32px !important;
  height: 32px !important;
  border-radius: 8px !important;
  background: rgba(248, 200, 220, 0.22) !important;
  box-shadow: none !important;
  color: var(--preview-muted) !important;
}

html body #settings [id$="-setting-item"] span,
html body #settings [id$="-setting-item"] .flex-col > span {
  color: var(--preview-ink) !important;
}

html body #settings [id$="-setting-item"] > i,
html body #settings button[data-target="world-book"] > i {
  color: var(--preview-muted) !important;
}

html body #settings button[data-target="world-book"] {
  min-height: 54px;
  margin-bottom: 16px !important;
  color: var(--preview-ink) !important;
}

html body #settings button[data-target="world-book"] span {
  align-items: center;
  font-size: 14px;
}

html body #settings button[data-target="world-book"] img {
  width: 32px !important;
  height: 32px !important;
  border-radius: 8px;
}

html body #api-settings-detail .advanced-form {
  padding: 0 16px 24px;
}

html body #api-settings-detail .form-card {
  padding: 16px !important;
}

html body #api-settings-detail input,
html body #api-settings-detail textarea,
html body #api-settings-detail select {
  border: 1px solid var(--preview-pink-border) !important;
  border-radius: 12px !important;
  background: rgba(255, 255, 255, 0.7) !important;
  color: var(--preview-ink) !important;
}

html body #api-settings-detail input:focus,
html body #api-settings-detail textarea:focus,
html body #api-settings-detail select:focus {
  border-color: var(--preview-pink) !important;
  box-shadow: 0 0 0 3px rgba(248, 200, 220, 0.24);
}

/* Native script library overlay. Keep its IDs, handlers, and z-index unchanged. */
html body #story-project-overlay {
  padding: 0 !important;
  background: transparent !important;
}

html body #story-project-overlay > .selector-sheet {
  inset: 0 !important;
  display: flex !important;
  flex-direction: column;
  width: 100% !important;
  height: 100% !important;
  max-height: none !important;
  padding: 28px 16px 20px !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: var(--preview-pink-bg) !important;
  box-shadow: none !important;
}

html body #story-project-overlay > .selector-sheet > h3 {
  position: relative;
  left: 50%;
  width: max-content;
  transform: translateX(-50%);
  margin-left: 0 !important;
  margin-right: 0 !important;
  color: var(--preview-ink) !important;
  font: italic 500 17px/1.3 Georgia, "Songti SC", serif !important;
  text-align: center !important;
}

html body #story-project-overlay > .selector-sheet > p {
  color: var(--preview-muted) !important;
  line-height: 1.6;
}

html body #story-project-overlay .selector-option,
html body #story-project-overlay .sheet-cancel {
  min-height: 48px;
  border: 1px solid var(--preview-pink-border) !important;
  border-radius: 14px !important;
  background: var(--preview-glass) !important;
  box-shadow: var(--preview-shadow);
  color: var(--preview-ink) !important;
}

html body #story-project-overlay .selector-option {
  flex: 0 0 auto;
}

html body #story-project-overlay .selector-option i {
  color: var(--preview-muted) !important;
}

html body #story-project-list {
  flex: 1;
  max-height: none !important;
  margin-bottom: 12px !important;
  overflow-y: auto;
}

html body #story-project-list > div {
  min-height: 76px;
  align-items: center;
  border: 1px solid var(--preview-pink-border) !important;
  border-radius: 18px !important;
  background: var(--preview-glass) !important;
  box-shadow: var(--preview-shadow);
}

html body #story-project-list strong {
  color: var(--preview-ink) !important;
}

html body #story-project-list span,
html body #story-project-list i {
  color: var(--preview-muted) !important;
}

/* Story creator is a centered dialog, contained by the original phone frame. */
html body #story-create-overlay {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px !important;
  background: rgba(68, 51, 56, 0.18) !important;
  animation: preview-dialog-in 0.22s ease-out both;
}

html body #story-create-overlay .story-create-sheet {
  position: relative !important;
  inset: auto !important;
  width: calc(100% - 8px) !important;
  max-width: 680px;
  height: auto !important;
  min-height: 0 !important;
  max-height: 85% !important;
  padding: 18px !important;
  overflow-y: auto !important;
  border: 1px solid var(--preview-pink-border) !important;
  border-radius: 22px !important;
  background: var(--preview-glass) !important;
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  box-shadow: var(--preview-shadow) !important;
  color: var(--preview-ink);
}

html body #story-create-overlay .story-create-sheet > .flex-between {
  position: sticky;
  top: -18px;
  z-index: 2;
  margin: -18px -18px 12px;
  padding: 14px 18px !important;
  border: 0 !important;
  background: rgba(255, 245, 248, 0.94) !important;
}

html body #story-create-overlay .story-create-sheet h3 {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  width: max-content;
  margin: 0 !important;
  color: var(--preview-ink);
  font: italic 500 17px/1.3 Georgia, "Songti SC", serif;
  text-align: center;
}

html body #story-create-overlay .story-create-sheet > .flex-between button {
  border: 0 !important;
  background: transparent !important;
  color: var(--preview-muted) !important;
}

html body #story-create-overlay .story-create-modes {
  display: flex;
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--preview-pink-border);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.52);
}

html body #story-create-overlay .story-create-modes button {
  flex: 1;
  min-height: 40px;
  border: 1px solid transparent !important;
  border-radius: 10px !important;
  background: transparent !important;
  color: var(--preview-muted) !important;
}

html body #story-create-overlay .story-create-modes button[aria-pressed="true"] {
  border-color: rgba(248, 200, 220, 0.5) !important;
  background: var(--preview-pink) !important;
  color: var(--preview-ink) !important;
}

/* World-book pages use the same pink glass treatment as settings. */
html body #world-book,
html body #global-wb-list-page,
html body #local-wb-list-page,
html body #edit-wb-page {
  background: var(--preview-pink-bg) !important;
  color: var(--preview-ink);
}

html body #world-book > .nav-bar:first-child,
html body #global-wb-list-page > .nav-bar:first-child,
html body #local-wb-list-page > .nav-bar:first-child,
html body #edit-wb-page > .nav-bar:first-child {
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
}

html body #world-book > .nav-bar:first-child .nav-title,
html body #global-wb-list-page > .nav-bar:first-child .nav-title,
html body #local-wb-list-page > .nav-bar:first-child .nav-title,
html body #edit-wb-page > .nav-bar:first-child .nav-title {
  color: var(--preview-ink) !important;
}

html body #world-book > .nav-bar:first-child .nav-title span:first-child,
html body #global-wb-list-page > .nav-bar:first-child .nav-title span:first-child,
html body #local-wb-list-page > .nav-bar:first-child .nav-title span:first-child,
html body #edit-wb-page > .nav-bar:first-child .nav-title span:first-child {
  font-family: Georgia, "Songti SC", serif !important;
  font-style: italic;
  color: var(--preview-ink) !important;
}

html body #world-book > .nav-bar:first-child .nav-title span:last-child,
html body #global-wb-list-page > .nav-bar:first-child .nav-title span:last-child,
html body #local-wb-list-page > .nav-bar:first-child .nav-title span:last-child,
html body #edit-wb-page > .nav-bar:first-child .nav-title span:last-child {
  color: var(--preview-text-3, var(--preview-muted)) !important;
}

html body #world-book > .nav-bar:first-child .nav-left,
html body #global-wb-list-page > .nav-bar:first-child .nav-left,
html body #local-wb-list-page > .nav-bar:first-child .nav-left,
html body #edit-wb-page > .nav-bar:first-child .nav-left,
html body #global-wb-list-page > .nav-bar:first-child .nav-right,
html body #local-wb-list-page > .nav-bar:first-child .nav-right,
html body #edit-wb-page > .nav-bar:first-child .nav-right {
  color: var(--preview-muted) !important;
}

html body #world-book > div:not(.nav-bar),
html body #global-wb-list-page > div:not(.nav-bar),
html body #local-wb-list-page > div:not(.nav-bar),
html body #edit-wb-page > .advanced-form {
  background: transparent !important;
}

html body #worldbook-presets,
html body #world-book > div:not(.nav-bar) > .flex-between,
html body #global-wb-list-container > div,
html body #local-wb-list-container > div,
html body #edit-wb-page .form-card {
  background: var(--preview-glass) !important;
  border: 1px solid var(--preview-pink-border) !important;
  border-radius: 18px !important;
  box-shadow: var(--preview-shadow) !important;
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
}

html body #world-book > div:not(.nav-bar) > .flex-between {
  min-height: 76px;
  align-items: center;
}

html body #world-book > div:not(.nav-bar) > .flex-between span:first-child,
html body #global-wb-list-container span,
html body #local-wb-list-container span,
html body #edit-wb-page label,
html body #edit-wb-page .form-card span {
  color: var(--preview-ink) !important;
}

html body #world-book > div:not(.nav-bar) > .flex-between span:nth-child(2),
html body #global-wb-list-container small,
html body #local-wb-list-container small {
  color: var(--preview-muted) !important;
}

html body #world-book > div:not(.nav-bar) > .flex-between i,
html body #global-wb-list-container i,
html body #local-wb-list-container i {
  color: var(--preview-text-3, var(--preview-muted)) !important;
}

html body #worldbook-presets h3,
html body #worldbook-presets strong {
  color: var(--preview-ink) !important;
}

html body #worldbook-presets p,
html body #worldbook-presets label span span {
  color: var(--preview-muted) !important;
}

html body #worldbook-presets label {
  border-bottom-color: var(--preview-pink-border) !important;
}

html body #worldbook-presets input[type="checkbox"] {
  accent-color: var(--preview-pink) !important;
  width: 20px;
  height: 20px;
}

html body #edit-wb-page input,
html body #edit-wb-page textarea,
html body #edit-wb-page select {
  border: 1px solid var(--preview-pink-border) !important;
  border-radius: 14px !important;
  background: rgba(255, 255, 255, 0.72) !important;
  color: var(--preview-ink) !important;
}

html body #edit-wb-page input:focus,
html body #edit-wb-page textarea:focus,
html body #edit-wb-page select:focus {
  border-color: var(--preview-pink) !important;
  box-shadow: 0 0 0 3px rgba(248, 200, 220, 0.24) !important;
}

html body #edit-wb-page .danger-btn {
  border-color: var(--preview-pink-border) !important;
  border-radius: 12px !important;
  background: rgba(255, 255, 255, 0.64) !important;
  color: var(--preview-muted) !important;
}

/* Export dialogs inherit the same light-pink glass language. */
html body #export-type-selector-overlay,
html body #export-chat-history-selector-overlay {
  background: rgba(68, 51, 56, 0.18) !important;
  backdrop-filter: blur(4px);
}

html body #export-type-selector-overlay .selector-sheet,
html body #export-chat-history-selector-overlay .selector-sheet {
  background: var(--preview-glass) !important;
  border: 1px solid var(--preview-pink-border) !important;
  border-radius: 22px !important;
  box-shadow: var(--preview-shadow) !important;
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  color: var(--preview-ink) !important;
}

html body #export-type-selector-overlay h3,
html body #export-chat-history-selector-overlay h3 {
  color: var(--preview-ink) !important;
  font-family: Georgia, "Songti SC", serif !important;
  font-weight: 500 !important;
}

html body #export-type-selector-overlay .selector-option {
  border: 1px solid var(--preview-pink-border) !important;
  border-radius: 14px !important;
  background: rgba(255, 255, 255, 0.62) !important;
  box-shadow: var(--preview-shadow) !important;
  color: var(--preview-ink) !important;
}

html body #export-type-selector-overlay .selector-option i,
html body #export-chat-history-selector-overlay span,
html body #export-chat-history-selector-overlay .selector-option i {
  color: var(--preview-muted) !important;
}

html body #export-type-selector-overlay .selector-option div:last-child,
html body #export-chat-history-selector-overlay .selector-option div:last-child {
  color: var(--preview-muted) !important;
}

html body #export-chat-history-friends-list {
  background: rgba(255, 255, 255, 0.62) !important;
  border: 1px solid var(--preview-pink-border) !important;
  border-radius: 14px !important;
}

html body #export-chat-history-selector-overlay .sheet-cancel,
html body #export-chat-history-selector-overlay .btn-primary,
html body #export-type-selector-overlay .sheet-cancel {
  border-radius: 12px !important;
  border-color: var(--preview-pink-border) !important;
  background: var(--preview-pink) !important;
  color: var(--preview-ink) !important;
  box-shadow: var(--preview-shadow) !important;
}

html body #story-create-overlay .story-create-sheet label {
  color: var(--preview-muted) !important;
}

html body #story-create-overlay .story-create-sheet input,
html body #story-create-overlay .story-create-sheet textarea,
html body #story-create-overlay .story-create-sheet select {
  border: 1px solid var(--preview-pink-border) !important;
  border-radius: 14px !important;
  background: rgba(255, 255, 255, 0.72) !important;
  color: var(--preview-ink) !important;
}

html body #story-create-overlay .story-create-sheet input:focus,
html body #story-create-overlay .story-create-sheet textarea:focus,
html body #story-create-overlay .story-create-sheet select:focus {
  border-color: var(--preview-pink) !important;
  box-shadow: 0 0 0 3px rgba(248, 200, 220, 0.24);
}

html body #story-create-overlay .story-create-sheet .btn-primary {
  width: 100%;
  min-height: 44px;
  border: 1px solid rgba(248, 200, 220, 0.5) !important;
  border-radius: 12px !important;
  background: var(--preview-pink) !important;
  box-shadow: var(--preview-shadow) !important;
  color: var(--preview-ink) !important;
}

html body #story-create-overlay .story-import-entry {
  border: 1px solid var(--preview-pink-border) !important;
  border-radius: 14px !important;
  background: rgba(255, 255, 255, 0.44) !important;
}

html body #story-create-overlay .story-import-entry-copy strong,
html body #story-create-overlay .story-import-entry-copy span {
  color: var(--preview-ink) !important;
}

html body #story-create-overlay .story-import-entry-copy span {
  color: var(--preview-muted) !important;
}

html body #story-create-overlay .story-import-trigger {
  border: 1px solid var(--preview-pink) !important;
  border-radius: 10px !important;
  background: rgba(255, 255, 255, 0.7) !important;
  color: var(--preview-muted) !important;
}

html body #story-create-overlay .story-create-sheet > p {
  color: var(--preview-muted) !important;
  line-height: 1.55;
}

/* The active library is injected by game-ui.js, rather than the legacy static overlay. */
html body .phone-frame > .selector-overlay:has(.story-create-sheet [data-content]) {
  inset: 0 !important;
  padding: 0 !important;
  background: transparent !important;
  animation: preview-dialog-in 0.22s ease-out both;
}

html body .phone-frame > .selector-overlay:has(.story-create-sheet [data-content]) > .story-create-sheet {
  inset: 0 !important;
  display: flex !important;
  flex-direction: column;
  width: 100% !important;
  height: 100% !important;
  max-height: none !important;
  min-height: 0 !important;
  padding: 16px !important;
  overflow: hidden !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: var(--preview-pink-bg) !important;
  box-shadow: none !important;
  color: var(--preview-ink);
}

html body .phone-frame > .selector-overlay:has(.story-create-sheet [data-content]) > .story-create-sheet > .flex-between {
  flex: 0 0 54px;
  justify-content: center;
  border-bottom: 1px solid var(--preview-pink-border);
  background: transparent !important;
}

html body .phone-frame > .selector-overlay:has(.story-create-sheet [data-content]) > .story-create-sheet > .flex-between h3 {
  color: var(--preview-ink);
  font: italic 500 17px/1.3 Georgia, "Songti SC", serif;
}

html body .phone-frame > .selector-overlay:has(.story-create-sheet [data-content]) > .story-create-sheet > .flex-between button {
  min-height: 36px;
  padding: 0 10px !important;
  border: 1px solid var(--preview-pink-border) !important;
  border-radius: 10px !important;
  background: var(--preview-glass) !important;
  color: var(--preview-muted) !important;
}

html body .phone-frame > .selector-overlay:has(.story-create-sheet [data-content]) > .story-create-sheet [data-content] {
  display: block;
  flex: 1;
  width: 100%;
  max-width: none !important;
  margin: 0 !important;
  padding: 14px 0 calc(20px + env(safe-area-inset-bottom, 8px)) !important;
  overflow-y: auto;
  color: var(--preview-ink);
}

html body .phone-frame > .selector-overlay:has(.story-create-sheet [data-content]) .story-current {
  margin: 0 0 14px !important;
  padding: 14px;
  border: 1px solid var(--preview-pink-border);
  border-radius: 14px;
  background: var(--preview-glass);
  color: var(--preview-muted);
}

html body .phone-frame > .selector-overlay:has(.story-create-sheet [data-content]) .story-current strong {
  color: var(--preview-ink);
}

html body .phone-frame > .selector-overlay:has(.story-create-sheet [data-content]) .story-primary-actions {
  display: flex;
  gap: 10px;
  margin: 0 0 18px !important;
}

html body .phone-frame > .selector-overlay:has(.story-create-sheet [data-content]) .story-primary-actions button {
  flex: 1;
  min-height: 44px;
  margin: 0 !important;
  border: 1px solid var(--preview-pink-border) !important;
  border-radius: 12px !important;
  background: var(--preview-pink) !important;
  color: var(--preview-ink) !important;
  font-size: 14px;
}

html body .phone-frame > .selector-overlay:has(.story-create-sheet [data-content]) [data-content] h4 {
  margin: 18px 0 8px !important;
  color: var(--preview-muted);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 1px;
}

html body .phone-frame > .selector-overlay:has(.story-create-sheet [data-content]) [data-games] button,
html body .phone-frame > .selector-overlay:has(.story-create-sheet [data-content]) .story-template-card {
  width: 100%;
  min-height: 76px;
  margin: 0 0 10px !important;
  padding: 12px !important;
  border: 1px solid var(--preview-pink-border) !important;
  border-radius: 16px !important;
  background: var(--preview-glass) !important;
  box-shadow: var(--preview-shadow);
  color: var(--preview-ink) !important;
}

html body .phone-frame > .selector-overlay:has(.story-create-sheet [data-content]) .story-template-card {
  display: flex;
  align-items: center;
  gap: 10px;
}

html body .phone-frame > .selector-overlay:has(.story-create-sheet [data-content]) .story-template-cover {
  width: 48px;
  height: 48px;
  flex: 0 0 48px;
  border-radius: 12px;
  background: rgba(248, 200, 220, 0.45);
  color: var(--preview-ink);
}

html body .phone-frame > .selector-overlay:has(.story-create-sheet [data-content]) .story-template-main {
  min-width: 0;
  flex: 1;
  color: var(--preview-ink);
}

html body .phone-frame > .selector-overlay:has(.story-create-sheet [data-content]) .story-template-description,
html body .phone-frame > .selector-overlay:has(.story-create-sheet [data-content]) .story-template-meta,
html body .phone-frame > .selector-overlay:has(.story-create-sheet [data-content]) .story-template-chevron {
  color: var(--preview-muted) !important;
}

html body .phone-frame > .selector-overlay:has(.story-create-sheet [data-content]) .story-template-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

html body .phone-frame > .selector-overlay:has(.story-create-sheet [data-content]) .story-template-actions button,
html body .phone-frame > .selector-overlay:has(.story-create-sheet [data-content]) .story-more-actions button {
  padding: 7px 9px !important;
  border: 1px solid var(--preview-pink-border) !important;
  border-radius: 9px !important;
  background: rgba(255, 255, 255, 0.7) !important;
  color: var(--preview-muted) !important;
  font-size: 11px;
}

html body .phone-frame > .selector-overlay:has(.story-create-sheet [data-content]) .story-empty-state {
  padding: 32px 12px !important;
  color: var(--preview-ink);
}

html body .phone-frame > .selector-overlay:has(.story-create-sheet [data-content]) .story-empty-state > i {
  color: var(--preview-muted);
  opacity: 0.5;
}

html body .phone-frame > .selector-overlay:has(.story-create-sheet [data-content]) .story-empty-state small {
  color: var(--preview-muted);
}

html body .phone-frame > .selector-overlay:has(.story-create-sheet [data-content]) .story-more {
  margin: 16px 0 0 !important;
  padding: 12px 0 0 !important;
  border-top: 1px solid var(--preview-pink-border) !important;
}

html body .phone-frame > .selector-overlay:has(.story-create-sheet [data-content]) .story-more summary {
  color: var(--preview-muted);
}

html body .phone-frame > .selector-overlay:has(.story-create-sheet [data-content]) .story-more-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

html body .phone-frame > .selector-overlay:has(.story-create-sheet [data-content]) [data-content] button:disabled {
  opacity: 0.55;
}

html body #story-create-overlay .story-create-sheet [hidden] {
  display: none !important;
}

html body #story-create-overlay .story-create-sheet button:not(.btn-primary) {
  border-color: var(--preview-pink-border);
  border-radius: 10px;
  color: var(--preview-ink);
}

html body #settings button,
html body #settings [onclick],
html body #story-project-overlay button,
html body #story-project-overlay [onclick],
html body #story-create-overlay button {
  transition: transform 0.16s ease, filter 0.16s ease, box-shadow 0.16s ease;
}

html body #settings button:active,
html body #settings [onclick]:active,
html body #story-project-overlay button:active,
html body #story-project-overlay [onclick]:active,
html body #story-create-overlay button:active {
  transform: scale(0.985);
  filter: brightness(1.025);
}

@keyframes preview-dialog-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 480px) {
  html body #settings > div:nth-child(2) {
    height: calc(100% - 56px) !important;
    padding: 8px 16px calc(20px + env(safe-area-inset-bottom, 8px)) !important;
  }

  html body #story-project-overlay > .selector-sheet {
    padding: 16px 16px calc(16px + env(safe-area-inset-bottom, 8px)) !important;
  }

  html body #story-create-overlay {
    padding: max(16px, env(safe-area-inset-top, 16px)) 16px
      calc(16px + env(safe-area-inset-bottom, 8px)) !important;
  }
}

@media (prefers-reduced-motion: reduce) {
  html body #story-create-overlay { animation: none; }
}

/* Settings detail pages share the same light-pink visual language in the preview. */
html body #data-management-page,
html body #wallpaper-settings-page,
html body #notification-sound-settings-detail,
html body #minimax-settings-detail,
html body #prompt-engine-settings-page,
html body #api-settings-detail,
html body #payment-settings-page,
html body #font-settings-page,
html body #app-icon-settings-page {
  background: var(--preview-pink-bg) !important;
  color: var(--preview-ink);
}

html body #data-management-page > .nav-bar:first-child,
html body #wallpaper-settings-page > .nav-bar:first-child,
html body #notification-sound-settings-detail > .nav-bar:first-child,
html body #minimax-settings-detail > .nav-bar:first-child,
html body #prompt-engine-settings-page > .nav-bar:first-child,
html body #api-settings-detail > .nav-bar:first-child,
html body #payment-settings-page > .nav-bar:first-child,
html body #font-settings-page > .nav-bar:first-child,
html body #app-icon-settings-page > .nav-bar:first-child {
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
}

html body #data-management-page > .nav-bar:first-child .nav-title,
html body #wallpaper-settings-page > .nav-bar:first-child .nav-title,
html body #notification-sound-settings-detail > .nav-bar:first-child .nav-title,
html body #minimax-settings-detail > .nav-bar:first-child .nav-title,
html body #prompt-engine-settings-page > .nav-bar:first-child .nav-title,
html body #api-settings-detail > .nav-bar:first-child .nav-title,
html body #payment-settings-page > .nav-bar:first-child .nav-title,
html body #font-settings-page > .nav-bar:first-child .nav-title,
html body #app-icon-settings-page > .nav-bar:first-child .nav-title {
  color: var(--preview-ink) !important;
}

html body #data-management-page > .nav-bar:first-child .nav-left,
html body #wallpaper-settings-page > .nav-bar:first-child .nav-left,
html body #notification-sound-settings-detail > .nav-bar:first-child .nav-left,
html body #minimax-settings-detail > .nav-bar:first-child .nav-left,
html body #prompt-engine-settings-page > .nav-bar:first-child .nav-left,
html body #api-settings-detail > .nav-bar:first-child .nav-left,
html body #payment-settings-page > .nav-bar:first-child .nav-left,
html body #font-settings-page > .nav-bar:first-child .nav-left,
html body #app-icon-settings-page > .nav-bar:first-child .nav-left {
  color: var(--preview-muted) !important;
}

html body #data-management-page .advanced-form,
html body #wallpaper-settings-page .advanced-form,
html body #notification-sound-settings-detail .advanced-form,
html body #minimax-settings-detail .advanced-form,
html body #prompt-engine-settings-page .advanced-form,
html body #api-settings-detail .advanced-form {
  padding: 12px 16px 28px !important;
}

html body #data-management-page .form-card,
html body #wallpaper-settings-page .form-card,
html body #notification-sound-settings-detail .form-card,
html body #minimax-settings-detail .form-card,
html body #api-settings-detail .form-card,
html body #prompt-engine-settings-page .advanced-form > div:first-child,
html body #payment-settings-page > div:not(.nav-bar) > div,
html body #font-settings-page > div:not(.nav-bar) > div,
html body #app-icon-settings-page > div:not(.nav-bar) > div {
  background: var(--preview-glass) !important;
  border: 1px solid var(--preview-pink-border) !important;
  border-radius: 18px !important;
  box-shadow: var(--preview-shadow) !important;
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
}

html body #prompt-engine-settings-page .advanced-form > div:first-child {
  margin: 0 0 18px !important;
  padding: 18px !important;
}

html body #data-management-page .form-group,
html body #wallpaper-settings-page .form-group,
html body #notification-sound-settings-detail .form-group,
html body #minimax-settings-detail .form-group,
html body #prompt-engine-settings-page .form-group,
html body #api-settings-detail .form-group {
  border-color: var(--preview-pink-border) !important;
}

html body #data-management-page label,
html body #wallpaper-settings-page label,
html body #notification-sound-settings-detail label,
html body #minimax-settings-detail label,
html body #prompt-engine-settings-page label,
html body #api-settings-detail label,
html body #payment-settings-page span,
html body #font-settings-page span,
html body #app-icon-settings-page span {
  color: var(--preview-ink) !important;
}

html body #data-management-page input,
html body #data-management-page textarea,
html body #data-management-page select,
html body #wallpaper-settings-page input,
html body #wallpaper-settings-page textarea,
html body #wallpaper-settings-page select,
html body #notification-sound-settings-detail input,
html body #notification-sound-settings-detail textarea,
html body #notification-sound-settings-detail select,
html body #minimax-settings-detail input,
html body #minimax-settings-detail textarea,
html body #minimax-settings-detail select,
html body #prompt-engine-settings-page input,
html body #prompt-engine-settings-page textarea,
html body #prompt-engine-settings-page select,
html body #api-settings-detail input,
html body #api-settings-detail textarea,
html body #api-settings-detail select {
  border: 1px solid var(--preview-pink-border) !important;
  border-radius: 14px !important;
  background: rgba(255, 255, 255, 0.72) !important;
  color: var(--preview-ink) !important;
}

html body #data-management-page input:focus,
html body #data-management-page textarea:focus,
html body #data-management-page select:focus,
html body #wallpaper-settings-page input:focus,
html body #wallpaper-settings-page textarea:focus,
html body #wallpaper-settings-page select:focus,
html body #notification-sound-settings-detail input:focus,
html body #notification-sound-settings-detail textarea:focus,
html body #notification-sound-settings-detail select:focus,
html body #minimax-settings-detail input:focus,
html body #minimax-settings-detail textarea:focus,
html body #minimax-settings-detail select:focus,
html body #prompt-engine-settings-page input:focus,
html body #prompt-engine-settings-page textarea:focus,
html body #prompt-engine-settings-page select:focus,
html body #api-settings-detail input:focus,
html body #api-settings-detail textarea:focus,
html body #api-settings-detail select:focus {
  border-color: var(--preview-pink) !important;
  box-shadow: 0 0 0 3px rgba(248, 200, 220, 0.24) !important;
}

html body #data-management-page .btn-primary,
html body #wallpaper-settings-page .btn-primary,
html body #notification-sound-settings-detail .btn-primary,
html body #minimax-settings-detail .btn-primary,
html body #prompt-engine-settings-page .btn-primary,
html body #api-settings-detail .btn-primary,
html body #payment-settings-page .btn-primary,
html body #font-settings-page .btn-primary,
html body #app-icon-settings-page .btn-primary {
  border: 1px solid rgba(248, 200, 220, 0.55) !important;
  border-radius: 12px !important;
  background: var(--preview-pink) !important;
  box-shadow: var(--preview-shadow) !important;
  color: var(--preview-ink) !important;
}

html body #data-management-page .danger-btn,
html body #wallpaper-settings-page .danger-btn,
html body #notification-sound-settings-detail .danger-btn,
html body #minimax-settings-detail .danger-btn,
html body #prompt-engine-settings-page .danger-btn,
html body #api-settings-detail .danger-btn {
  border-color: var(--preview-pink-border) !important;
  border-radius: 12px !important;
  background: rgba(255, 255, 255, 0.64) !important;
  color: var(--preview-muted) !important;
}

html body #notification-sound-settings-detail .memory-switch .slider,
html body #minimax-settings-detail .memory-switch .slider,
html body #api-settings-detail .memory-switch .slider,
html body #payment-settings-page .memory-switch .slider {
  background: rgba(136, 112, 120, 0.24) !important;
}

html body #notification-sound-settings-detail .memory-switch input:checked + .slider,
html body #minimax-settings-detail .memory-switch input:checked + .slider,
html body #api-settings-detail .memory-switch input:checked + .slider,
html body #payment-settings-page .memory-switch input:checked + .slider {
  background: var(--preview-pink) !important;
}

/* Center the active script library content like the reference image. */
html body .phone-frame > .selector-overlay:has(.story-create-sheet [data-content]) .story-current,
html body .phone-frame > .selector-overlay:has(.story-create-sheet [data-content]) [data-content] > h4,
html body .phone-frame > .selector-overlay:has(.story-create-sheet [data-content]) .story-empty-state,
html body .phone-frame > .selector-overlay:has(.story-create-sheet [data-content]) .story-more {
  text-align: center;
}

html body .phone-frame > .selector-overlay:has(.story-create-sheet [data-content]) .story-primary-actions {
  justify-content: center;
}

html body .phone-frame > .selector-overlay:has(.story-create-sheet [data-content]) [data-games] button {
  text-align: center !important;
}

html body .phone-frame > .selector-overlay:has(.story-create-sheet [data-content]) .story-template-card {
  text-align: center;
}

html body .phone-frame > .selector-overlay:has(.story-create-sheet [data-content]) .story-template-main {
  text-align: center;
}

html body .phone-frame > .selector-overlay:has(.story-create-sheet [data-content]) .story-template-actions {
  justify-content: center;
}

html body .phone-frame > .selector-overlay:has(.story-create-sheet [data-content]) .story-empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
}

html body .phone-frame > .selector-overlay:has(.story-create-sheet [data-content]) .story-more-actions {
  justify-content: center;
}

/* Keep the centered title and close action in separate grid columns.
   The optional cancel action gets a second row on narrow phones. */
html body #story-library-overlay > .story-create-sheet > .flex-between {
  position: relative !important;
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  flex: 0 0 auto;
  gap: 4px;
}

html body #story-library-overlay > .story-create-sheet > .flex-between h3 {
  position: static !important;
  grid-column: 2;
  grid-row: 1;
  width: auto !important;
  margin: 0 !important;
  translate: none !important;
  transform: none !important;
  text-align: center !important;
}

html body #story-library-overlay > .story-create-sheet > .flex-between > .flex {
  display: contents;
}

html body #story-library-overlay [data-close] {
  grid-column: 1;
  grid-row: 1;
  justify-self: start;
  min-width: 44px;
  min-height: 44px !important;
}

html body #story-library-overlay [data-story-stop]:not([hidden]) {
  grid-column: 1 / -1;
  grid-row: 2;
  justify-self: end;
  min-height: 44px !important;
}

/* Dynamic world-book rows and export actions stay within the pink preview
   surface even when their original inline styles are white or gray. */
html body #global-wb-list-container > div:has(> .flex-between),
html body #local-wb-list-container > div:has(> .flex-between) {
  padding: 0 !important;
  overflow: hidden;
}

html body #global-wb-list-container > div:has(> .flex-between) > .flex-between,
html body #local-wb-list-container > div:has(> .flex-between) > .flex-between {
  min-height: 54px;
  padding: 10px 15px !important;
  border: 0 !important;
}

html body #global-wb-list-container > div:not(:has(> .flex-between)),
html body #local-wb-list-container > div:not(:has(> .flex-between)) {
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
  color: var(--preview-muted) !important;
}

html body .story-more-actions button {
  border: 1px solid var(--preview-pink-border) !important;
  border-radius: 10px !important;
  background: rgba(255, 255, 255, 0.62) !important;
  color: var(--preview-muted) !important;
  box-shadow: none !important;
}

/* Settings uses one local outline icon family and a readable rose palette. */
html body #settings :is(span:not(.slider), label, .nav-title, .nav-left) {
  color: var(--preview-ink) !important;
}
html body #settings .nav-title {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", sans-serif !important;
  font-style: normal !important;
}
html body #settings .settings-line-icon {
  display: inline-block;
  width: 22px;
  height: 22px;
  flex-shrink: 0;
  color: var(--preview-ink) !important;
}
html body #settings :is(.settings-icon-tile, .flex-center:has(> .settings-line-icon)) {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 34px !important;
  height: 34px !important;
  border-radius: 11px !important;
  background: #fce7ef !important;
  box-shadow: none !important;
  flex-shrink: 0;
}
html body #settings .flex-between > .settings-line-icon {
  width: 18px;
  height: 18px;
  color: #b96d8c !important;
}
html body #settings .nav-left {
  min-width: 44px;
  min-height: 44px;
}
html body #settings [style*="border-bottom"] { border-bottom-color: #f3dce5 !important; }
html body #settings .memory-switch input:checked + .slider { background: #b45b7e !important; }
html body #settings input[type="range"] { accent-color: #b45b7e; }
html body #settings [onclick="clearAllData()"] :is(span, svg) { color: #b34062 !important; }

/* Explicit text roles keep menu labels independent of legacy inline sizes. */
html body #settings span.settings-menu-label {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", sans-serif !important;
  font-size: 15px !important;
  line-height: 22px !important;
  font-weight: 500 !important;
  letter-spacing: .3px !important;
}
html body #settings span.settings-note {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", sans-serif !important;
  font-size: 12px !important;
  line-height: 18px !important;
  font-weight: 400 !important;
  letter-spacing: 0 !important;
}

/* 剧本两步生成：剧情 → 联动 */
.story-steps { margin: 14px 0 4px; padding: 14px 16px; border-radius: 14px; background: var(--preview-pink-bg, #fff5f8); border: 1px solid var(--preview-pink-border, #f7e2e9); color: var(--preview-ink, #a3476d); }
.story-steps[hidden] { display: none !important; }
.story-steps-list { list-style: none; margin: 0; padding: 0; display: flex; align-items: center; gap: 10px; }
.story-steps-list li { flex: 1; display: flex; align-items: center; gap: 10px; min-width: 0; }
.story-steps-list li + li::before { content: ""; width: 18px; height: 1px; background: var(--preview-pink, #f8c8dc); flex-shrink: 0; margin-left: -4px; }
.story-step-dot { width: 26px; height: 26px; flex-shrink: 0; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 600; border: 1.5px solid var(--preview-pink, #f8c8dc); background: #fff; color: var(--preview-muted, #a05b77); }
.story-step-body { display: flex; flex-direction: column; min-width: 0; }
.story-step-body strong { font-size: 14px; font-weight: 600; }
.story-step-body small { font-size: 11px; color: var(--preview-muted, #a05b77); opacity: .8; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.story-steps-list li[data-state="run"] .story-step-dot { background: var(--preview-pink, #f8c8dc); color: #fff; border-color: transparent; animation: story-step-pulse 1.4s ease-in-out infinite; }
.story-steps-list li[data-state="done"] .story-step-dot { background: var(--preview-ink, #a3476d); color: #fff; border-color: transparent; font-size: 0; }
.story-steps-list li[data-state="done"] .story-step-dot::after { content: "✓"; font-size: 13px; }
.story-steps-list li[data-state="fail"] .story-step-dot { background: #fff; color: #d64545; border-color: #f1b5b5; font-size: 0; }
.story-steps-list li[data-state="fail"] .story-step-dot::after { content: "!"; font-size: 14px; }
.story-steps-list li[data-state="skip"] { opacity: .55; }
.story-steps-bar { height: 4px; border-radius: 4px; margin: 12px 0 8px; background: #fff; overflow: hidden; }
#story-steps-bar-fill { height: 100%; width: 0; border-radius: 4px; background: linear-gradient(90deg, var(--preview-pink, #f8c8dc), var(--preview-ink, #a3476d)); transition: width .35s ease; }
.story-steps-status { margin: 0; font-size: 12px; color: var(--preview-muted, #a05b77); }
.story-steps-preview { margin-top: 10px; padding: 10px 12px; border-radius: 10px; background: #fff; font-size: 12px; line-height: 1.6; color: #6b5560; max-height: 120px; overflow: auto; white-space: pre-wrap; }
.story-steps-preview[hidden], .story-steps-actions[hidden] { display: none !important; }
.story-steps-actions { display: flex; gap: 8px; margin-top: 10px; }
.story-steps-actions button { flex: 1; min-height: 38px; border-radius: 10px; font-size: 13px; border: 1px solid var(--preview-pink, #f8c8dc); background: #fff; color: var(--preview-ink, #a3476d); cursor: pointer; }
.story-steps-actions button:first-child { background: var(--preview-ink, #a3476d); color: #fff; border-color: transparent; }
@keyframes story-step-pulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(248, 200, 220, .7); } 50% { box-shadow: 0 0 0 6px rgba(248, 200, 220, 0); } }

/* ================= 剧本 / 线下 新版界面（sx-*） ================= */
.sx-panel { --sx-ink: var(--preview-ink, #a3476d); --sx-pink: var(--preview-pink, #f8c8dc); --sx-bg: var(--preview-pink-bg, #fff5f8); --sx-line: var(--preview-pink-border, #f7e2e9); --sx-muted: var(--preview-muted, #a05b77); }
html body .sx-panel .story-create-sheet { background: var(--sx-bg) !important; color: #4a3640; padding-bottom: 0 !important; }
html body .sx-panel .story-create-sheet > .sx-head { display: grid !important; grid-template-columns: 76px 1fr 76px; align-items: center; background: var(--sx-bg) !important; padding: 6px 0 12px !important; margin: 0 -2px; }
.sx-head h3 { margin: 0; text-align: center; font-size: 17px; font-weight: 600; color: var(--sx-ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
html body .sx-panel .sx-head .sx-head-btn { border: 0 !important; background: transparent !important; color: var(--sx-muted) !important; font-size: 15px; padding: 8px 4px !important; margin: 0 !important; min-height: 40px; cursor: pointer; }
.sx-head [data-back] { justify-self: start; } .sx-head [data-close] { justify-self: end; grid-column: 3; }
html body .sx-panel .story-create-sheet [data-content] { max-width: 640px; margin: 0 auto; padding-bottom: 24px; }
.sx-enter { animation: sx-in .28s cubic-bezier(.2,.8,.2,1); }
@keyframes sx-in { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

/* 按钮 */
html body .sx-panel [data-content] button { font: inherit; -webkit-tap-highlight-color: transparent; transition: transform .12s ease, background-color .2s ease, box-shadow .2s ease, opacity .2s; }
html body .sx-panel [data-content] button:active:not(:disabled) { transform: scale(.97); }
html body .sx-panel [data-content] .sx-btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 46px; padding: 0 18px !important; margin: 0 !important; border-radius: 14px !important; border: 1px solid var(--sx-line) !important; background: #fff !important; color: var(--sx-ink) !important; font-size: 15px; font-weight: 600; cursor: pointer; }
html body .sx-panel [data-content] .sx-btn.sx-primary { background: linear-gradient(135deg, #f4a9c6, var(--sx-ink)) !important; color: #fff !important; border-color: transparent !important; box-shadow: 0 6px 16px rgba(163, 71, 109, .22); }
html body .sx-panel [data-content] .sx-btn.sx-sm { min-height: 36px; padding: 0 14px !important; font-size: 14px; border-radius: 11px !important; }
html body .sx-panel [data-content] .sx-btn.sx-block { width: 100%; }
html body .sx-panel [data-content] .sx-btn:disabled { opacity: .55; cursor: wait; box-shadow: none; }
html body .sx-panel [data-content] .sx-link { border: 0 !important; background: none !important; color: var(--sx-muted) !important; padding: 6px 8px !important; margin: 0 !important; font-size: 13px; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; text-decoration-color: var(--sx-line); }
html body .sx-panel [data-content] .sx-danger { color: #d0576b !important; }

/* 排版 */
.sx-h { display: flex; align-items: baseline; gap: 8px; margin: 22px 0 10px; font-size: 15px; font-weight: 600; color: var(--sx-ink); }
.sx-h small { font-size: 12px; font-weight: 400; color: var(--sx-muted); opacity: .8; }
.sx-tip { margin: 0 0 14px; padding: 10px 12px; border-radius: 12px; background: #fff; border: 1px dashed var(--sx-line); font-size: 13px; color: var(--sx-muted); line-height: 1.6; }
.sx-faint { margin: 6px 0 0; font-size: 12px; color: var(--sx-muted); opacity: .85; line-height: 1.6; }
.sx-empty { padding: 22px 16px; text-align: center; font-size: 13px; color: var(--sx-muted); background: #fff; border-radius: 14px; border: 1px dashed var(--sx-line); line-height: 1.7; }
.sx-error { margin: 12px 0 0; color: #d0576b; font-size: 13px; }
.sx-actions-row { display: flex; gap: 10px; margin: 10px 0; flex-wrap: wrap; }
.sx-actions-row > .sx-btn { flex: 1; }
.sx-actions-row > select { flex: 1; min-width: 140px; }

/* 输入 */
.sx-field { display: block; margin: 12px 0; }
html body .sx-panel .sx-label { display: block; margin: 14px 0 6px; font-size: 13px; color: var(--sx-muted); font-weight: 500; }
.sx-field .sx-label { margin-top: 0; }
html body .sx-panel .sx-input { width: 100%; box-sizing: border-box; border: 1px solid var(--sx-line) !important; border-radius: 12px !important; padding: 11px 12px !important; background: #fff !important; color: #4a3640; font: inherit; font-size: 15px; transition: border-color .2s, box-shadow .2s; }
html body .sx-panel .sx-input:focus { outline: none; border-color: var(--sx-pink) !important; box-shadow: 0 0 0 3px rgba(248, 200, 220, .45); }
.sx-mono { font-family: ui-monospace, Menlo, monospace !important; font-size: 12px !important; }
.sx-check { display: flex; align-items: flex-start; gap: 8px; margin: 10px 0; font-size: 14px; color: #5b4450; line-height: 1.5; cursor: pointer; }
.sx-check input { width: 18px !important; height: 18px; margin: 1px 0 0; accent-color: var(--sx-ink); flex-shrink: 0; }
.sx-check-sm { font-size: 12px; margin: 0; align-items: center; color: var(--sx-muted); }
.sx-check-sm input { width: 15px !important; height: 15px; margin: 0; }

/* 首页 */
.sx-hero { display: grid; gap: 4px; padding: 16px; border-radius: 18px; margin-bottom: 14px; background: linear-gradient(135deg, #fff 0%, #ffe8f1 100%); border: 1px solid var(--sx-line); box-shadow: 0 6px 18px rgba(248, 200, 220, .3); }
.sx-hero small { font-size: 12px; color: var(--sx-muted); }
.sx-hero strong { font-size: 18px; color: #4a3640; margin-bottom: 8px; }
.sx-cards { display: grid; gap: 10px; }
.sx-card { padding: 14px; border-radius: 16px; background: #fff; border: 1px solid var(--sx-line); display: grid; gap: 10px; box-shadow: 0 2px 8px rgba(248, 200, 220, .18); }
.sx-card-main strong { font-size: 16px; color: #4a3640; }
.sx-card-main p { margin: 4px 0 0; font-size: 13px; color: #7a6470; line-height: 1.5; }
.sx-card-actions { display: flex; align-items: center; gap: 6px; }
.sx-card-actions .sx-primary { margin-right: auto !important; }
.sx-list { display: grid; gap: 8px; }
html body .sx-panel [data-content] .sx-row { display: flex !important; justify-content: space-between; align-items: center; gap: 10px; width: 100%; min-height: 48px; padding: 10px 14px !important; margin: 0 !important; border-radius: 13px !important; border: 1px solid var(--sx-line) !important; background: #fff !important; color: #4a3640 !important; font-size: 15px; text-align: left; cursor: pointer; }
.sx-row em { font-style: normal; font-size: 12px; color: var(--sx-muted); flex-shrink: 0; }
html body .sx-panel [data-content] .sx-row.is-current { background: var(--sx-bg) !important; border-color: var(--sx-pink) !important; opacity: 1; cursor: default; }
.sx-row.is-current em { color: var(--sx-ink); font-weight: 600; }
html body .sx-panel [data-content] .sx-row.is-static { cursor: default; }
html body .sx-panel [data-content] .sx-note { display: block !important; line-height: 1.5; font-size: 14px; }
html body .sx-panel [data-content] .sx-note.is-unread { border-left: 3px solid var(--sx-ink) !important; }
.sx-more { margin-top: 14px; border-radius: 14px; background: #fff; border: 1px solid var(--sx-line); padding: 0 14px; }
.sx-more > summary { list-style: none; padding: 14px 0; font-size: 14px; color: var(--sx-muted); cursor: pointer; display: flex; justify-content: space-between; }
.sx-more > summary::-webkit-details-marker { display: none; }
.sx-more > summary::after { content: "›"; transition: transform .2s; font-size: 18px; line-height: 1; }
.sx-more[open] > summary::after { transform: rotate(90deg); }
.sx-more > :not(summary) { padding-bottom: 14px; }
.sx-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
html body .sx-panel [data-content] .sx-grid button, html body .sx-panel [data-content] .sx-pop button { min-height: 42px; padding: 8px 10px !important; margin: 0 !important; border-radius: 11px !important; border: 1px solid var(--sx-line) !important; background: var(--sx-bg) !important; color: #5b4450 !important; font-size: 13px; cursor: pointer; }
html body .sx-panel [data-content] .sx-grid button:disabled { opacity: .45; cursor: not-allowed; }

/* 编辑剧本 */
.sx-section { margin-bottom: 6px; }
.sx-role { margin: 0 0 10px; padding: 0; border: 1px solid var(--sx-line); border-radius: 14px; background: #fff; overflow: hidden; }
html body .sx-panel [data-content] .sx-role-head { display: flex !important; flex-direction: column; align-items: flex-start; gap: 2px; width: 100%; padding: 12px 40px 12px 14px !important; margin: 0 !important; border: 0 !important; border-radius: 0 !important; background: #fff !important; color: #4a3640 !important; text-align: left; position: relative; cursor: pointer; }
.sx-role-head::after { content: "›"; position: absolute; right: 16px; top: 50%; transform: translateY(-50%); color: var(--sx-muted); font-size: 18px; transition: transform .2s; }
.sx-role.is-open .sx-role-head::after { transform: translateY(-50%) rotate(90deg); }
.sx-role-head small { font-size: 12px; color: var(--sx-muted); }
.sx-role-body { padding: 0 14px 12px; border-top: 1px solid var(--sx-line); }

/* 底部固定操作区 */
.sx-footer { position: sticky; bottom: 0; z-index: 3; margin: 18px -22px 0; padding: 12px 22px calc(12px + env(safe-area-inset-bottom, 0px)); background: linear-gradient(to top, var(--sx-bg) 70%, rgba(255, 245, 248, 0)); }
.sx-footer-2 { display: flex; gap: 10px; }
.sx-footer-2 .sx-btn { flex: 1; }

/* 开局向导 */
.sx-wizard-steps { list-style: none; display: flex; gap: 6px; margin: 0 0 6px; padding: 0; counter-reset: sxstep; }
.sx-wizard-steps li { flex: 1; text-align: center; font-size: 12px; color: var(--sx-muted); padding-top: 10px; position: relative; opacity: .7; counter-increment: sxstep; }
.sx-wizard-steps li::before { content: ""; position: absolute; top: 0; left: 0; right: 0; height: 4px; border-radius: 4px; background: var(--sx-line); transition: background .3s; }
.sx-wizard-steps li.is-on, .sx-wizard-steps li.is-done { opacity: 1; color: var(--sx-ink); font-weight: 600; }
.sx-wizard-steps li.is-on::before { background: linear-gradient(90deg, #f4a9c6, var(--sx-ink)); }
.sx-wizard-steps li.is-done::before { background: var(--sx-pink); }
.sx-choice { display: grid; gap: 10px; }
.sx-choice-3 { grid-template-columns: 1fr; }
html body .sx-panel [data-content] .sx-choice button { display: grid !important; gap: 3px; width: 100%; padding: 14px 16px 14px 44px !important; margin: 0 !important; text-align: left; border-radius: 14px !important; border: 1.5px solid var(--sx-line) !important; background: #fff !important; color: #4a3640 !important; position: relative; cursor: pointer; }
.sx-choice button::before { content: ""; position: absolute; left: 16px; top: 50%; width: 16px; height: 16px; margin-top: -8px; border-radius: 50%; border: 1.5px solid var(--sx-pink); background: #fff; transition: all .2s; }
.sx-choice button strong { font-size: 15px; }
.sx-choice button small { font-size: 12px; color: var(--sx-muted); line-height: 1.5; }
html body .sx-panel [data-content] .sx-choice button.is-on { border-color: var(--sx-ink) !important; background: var(--sx-bg) !important; box-shadow: 0 4px 12px rgba(163, 71, 109, .12); }
.sx-choice button.is-on::before { border: 5px solid var(--sx-ink); }
.sx-choice.is-locked { opacity: .5; pointer-events: none; }
.sx-chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 4px 0; }
html body .sx-panel [data-content] .sx-chips button, .sx-chips label { min-height: 36px; padding: 6px 14px !important; margin: 0 !important; border-radius: 999px !important; border: 1px solid var(--sx-line) !important; background: #fff !important; color: #5b4450 !important; font-size: 14px; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; }
html body .sx-panel [data-content] .sx-chips button.is-on { background: var(--sx-ink) !important; color: #fff !important; border-color: transparent !important; }
.sx-chips label input { width: 15px !important; height: 15px; margin: 0; accent-color: var(--sx-ink); }
.sx-rel { margin: 0 0 10px; padding: 10px 14px 12px; border: 1px solid var(--sx-line); border-radius: 14px; background: #fff; }
.sx-rel legend { padding: 0 6px; font-size: 14px; font-weight: 600; color: var(--sx-ink); }
.sx-rel .sx-check { margin-top: 4px; font-size: 13px; }
.sx-rel[hidden], .sx-check[hidden] { display: none !important; }
.sx-opening { padding: 14px 16px; border-radius: 14px; background: #fff; border: 1px solid var(--sx-line); }
.sx-opening p { margin: 0; white-space: pre-wrap; font-size: 14px; line-height: 1.8; color: #4a3640; max-height: 220px; overflow: auto; }
.sx-opening small { display: block; margin-top: 10px; font-size: 12px; color: var(--sx-muted); }

/* 主线剧情 */
.sx-scene { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.sx-scene[hidden] { display: none; }
.sx-scene span { padding: 4px 10px; border-radius: 999px; background: #fff; border: 1px solid var(--sx-line); font-size: 12px; color: var(--sx-muted); }
.sx-readonly { padding: 14px; border-radius: 16px; background: #fff; border: 1px solid var(--sx-pink); margin-bottom: 12px; }
.sx-readonly[hidden] { display: none; }
.sx-readonly p { margin: 0 0 10px; font-size: 13px; line-height: 1.7; color: #5b4450; }
.sx-turns { display: flex; flex-direction: column; gap: 12px; padding-bottom: 8px; }
.sx-narr { padding: 14px 16px; border-radius: 4px 16px 16px 16px; background: #fff; border: 1px solid var(--sx-line); white-space: pre-wrap; font-size: 15px; line-height: 1.85; color: #3f2f37; animation: sx-in .3s ease; }
.sx-me { align-self: flex-end; max-width: 82%; padding: 10px 14px; border-radius: 16px 4px 16px 16px; background: linear-gradient(135deg, #f8bfd5, #e98fb3); color: #fff; font-size: 14px; line-height: 1.6; white-space: pre-wrap; }
.sx-typing { display: flex; gap: 5px; width: fit-content; padding: 14px 18px; }
.sx-typing i { width: 7px; height: 7px; border-radius: 50%; background: var(--sx-pink); animation: sx-dot 1s infinite ease-in-out; }
.sx-typing i:nth-child(2) { animation-delay: .15s; } .sx-typing i:nth-child(3) { animation-delay: .3s; }
@keyframes sx-dot { 0%, 80%, 100% { transform: translateY(0); opacity: .5; } 40% { transform: translateY(-5px); opacity: 1; } }
.sx-composer { position: sticky; bottom: 0; z-index: 3; margin: 12px -22px 0; padding: 10px 22px calc(10px + env(safe-area-inset-bottom, 0px)); background: rgba(255, 245, 248, .94); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); border-top: 1px solid var(--sx-line); }
.sx-composer .sx-chips { margin-bottom: 8px; flex-wrap: nowrap; overflow-x: auto; }
html body .sx-panel [data-content] .sx-composer .sx-chips button { flex-shrink: 0; font-size: 13px; min-height: 32px; white-space: nowrap; }
.sx-compose-row { display: flex; gap: 8px; align-items: flex-end; }
html body .sx-panel .sx-compose-row .sx-input { resize: none; min-height: 46px; max-height: 120px; }
.sx-compose-row .sx-btn { flex-shrink: 0; }
.sx-compose-tools { display: flex; align-items: center; gap: 10px; margin-top: 8px; }
.sx-pop { margin-left: auto; position: relative; }
.sx-pop > summary { list-style: none; font-size: 13px; color: var(--sx-muted); cursor: pointer; padding: 4px 8px; border-radius: 8px; }
.sx-pop > summary::-webkit-details-marker { display: none; }
.sx-pop > div { position: absolute; right: 0; bottom: calc(100% + 8px); width: 200px; display: grid; gap: 6px; padding: 8px; border-radius: 14px; background: #fff; border: 1px solid var(--sx-line); box-shadow: 0 10px 30px rgba(163, 71, 109, .18); animation: sx-in .2s ease; }
.sx-status { margin: 6px 0 0; font-size: 11px; color: var(--sx-muted); opacity: .85; }
@media (prefers-reduced-motion: reduce) { .sx-enter, .sx-narr, .sx-pop > div { animation: none; } }

/* ================= 新建剧本：手账本 ================= */
#story-create-overlay { --jx-paper: #fbfcff; --jx-sky: #cfe6fa; --jx-rule: #e4effa; --jx-rose: #e68aae; --jx-rose-deep: #c9658f; --jx-ink: #4b3943; --jx-soft: #8a7480; }
html body #story-create-overlay .story-create-sheet.jx-create {
  background: linear-gradient(rgba(246, 250, 255, .82), rgba(251, 252, 255, .95) 45%), url("assets/sky/wallpaper.jpg") center top / cover !important;
  color: var(--jx-ink); padding: 0 20px !important; display: flex; flex-direction: column; font-family: -apple-system, "PingFang SC", "Hiragino Sans GB", sans-serif;
}
.jx-sr { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
html body #story-create-overlay .jx-create > .jx-head { position: sticky; top: 0; z-index: 4; display: grid !important; grid-template-columns: 90px 1fr 90px; align-items: center; margin: 0 -20px; padding: calc(10px + env(safe-area-inset-top, 0px)) 20px 10px !important; background: rgba(246, 250, 255, .7) !important; backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border: 0 !important; }
html body #story-create-overlay .jx-create > .jx-head h3 { margin: 0 !important; text-align: center; font-size: 17px !important; font-weight: 600; color: var(--jx-ink) !important; transform: none !important; position: static !important; }
html body #story-create-overlay .jx-create > .jx-head .jx-back { justify-self: start; border: 0 !important; background: none !important; padding: 8px 0 !important; color: var(--jx-soft) !important; font-size: 15px; cursor: pointer; }

/* 封面：唯一的“装饰” */
.jx-cover { position: relative; margin: 26px 10px 8px; padding: 30px 22px 18px; background: #fff; border-radius: 6px; transform: rotate(-1.2deg); box-shadow: 0 1px 0 #eef3fa, 0 14px 30px -12px rgba(77, 120, 170, .35); }
.jx-cover::before { content: ""; position: absolute; top: -11px; left: 50%; width: 112px; height: 24px; margin-left: -56px; transform: rotate(2.5deg); background: repeating-linear-gradient(45deg, rgba(207, 230, 250, .92) 0 8px, rgba(230, 242, 253, .92) 8px 16px); box-shadow: 0 1px 2px rgba(77, 120, 170, .15); }
.jx-cover::after { content: ""; position: absolute; right: 16px; bottom: -9px; width: 38px; height: 16px; transform: rotate(-18deg); background: rgba(248, 200, 220, .85); }
.jx-cover-title { display: flex; align-items: center; gap: 2px; font-family: "Songti SC", "STSong", "Noto Serif SC", "Source Han Serif SC", serif; color: var(--jx-ink); }
.jx-cover-title > span { font-size: 26px; line-height: 1; color: var(--jx-rose-deep); flex-shrink: 0; }
html body #story-create-overlay .jx-create .jx-cover-title input { flex: 1; min-width: 0; border: 0 !important; border-radius: 0 !important; background: transparent !important; padding: 4px 2px !important; margin: 0 !important; box-shadow: none !important; font-family: inherit !important; font-size: 24px !important; font-weight: 600; letter-spacing: .04em; color: var(--jx-ink) !important; text-align: center; }
html body #story-create-overlay .jx-create .jx-cover-title input::placeholder { color: #c2b4bc; font-weight: 400; }
html body #story-create-overlay .jx-create .jx-cover-title input:focus { outline: none; background: linear-gradient(transparent 62%, rgba(255, 240, 166, .8) 62%) !important; }
.jx-cover-note { margin: 8px 0 0; text-align: center; font-size: 12px; color: var(--jx-soft); }

/* 笔记本 + 索引签 */
.jx-notebook { margin-top: 30px; }
html body #story-create-overlay .jx-create .jx-tabs { display: flex !important; gap: 6px; padding: 0 14px !important; margin: 0 !important; background: none !important; border: 0 !important; box-shadow: none !important; }
html body #story-create-overlay .jx-create .jx-tabs button { flex: 0 0 auto; position: relative; top: 1px; padding: 9px 16px 8px !important; margin: 0 !important; border: 1px solid var(--jx-rule) !important; border-bottom: 0 !important; border-radius: 10px 10px 0 0 !important; background: rgba(228, 239, 250, .75) !important; color: var(--jx-soft) !important; font-size: 14px; font-weight: 500; box-shadow: none !important; cursor: pointer; transition: background .2s, color .2s; }
html body #story-create-overlay .jx-create .jx-tabs button[aria-pressed="true"] { background: var(--jx-paper) !important; color: var(--jx-ink) !important; font-weight: 600; z-index: 1; }
html body #story-create-overlay .jx-create .jx-tabs button[aria-pressed="true"]::before { content: ""; position: absolute; left: 12px; right: 12px; top: 0; height: 3px; border-radius: 0 0 3px 3px; background: var(--jx-rose); }
.jx-page { position: relative; background: var(--jx-paper); border: 1px solid var(--jx-rule); border-radius: 4px 14px 14px 14px; padding: 14px 16px 12px 30px; box-shadow: 0 10px 26px -14px rgba(77, 120, 170, .3); }
.jx-page::before { content: ""; position: absolute; top: 0; bottom: 0; left: 18px; width: 1px; background: rgba(230, 138, 174, .45); }
html body #story-create-overlay .jx-create .jx-lined { display: block; width: 100%; box-sizing: border-box; margin: 0 !important; padding: 2px 0 !important; border: 0 !important; border-radius: 0 !important; box-shadow: none !important; resize: none; font: inherit; font-size: 15px !important; line-height: 30px !important; color: var(--jx-ink) !important; background: repeating-linear-gradient(to bottom, transparent 0 29px, var(--jx-rule) 29px 30px) local !important; background-position: 0 2px !important; }
html body #story-create-overlay textarea.jx-lined { min-height: 92px; }
html body #story-create-overlay .jx-create #story-create-text.jx-lined { min-height: 272px; }
html body #story-create-overlay .jx-create .jx-lined::placeholder { color: #a9b6c6; }
html body #story-create-overlay .jx-create .jx-lined:focus { outline: none; }
.jx-page-foot { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-top: 8px; font-size: 12px; color: var(--jx-soft); flex-wrap: wrap; }
#story-create-count.is-long { color: var(--jx-rose-deep); }
#story-create-count.is-long::after { content: "（较长，会分段整理）"; }
.jx-page-tools { display: flex; gap: 4px; flex-wrap: wrap; }
html body #story-create-overlay .jx-create .jx-tool { padding: 6px 10px !important; margin: 0 !important; border: 1px solid var(--jx-rule) !important; border-radius: 999px !important; background: #fff !important; color: var(--jx-ink) !important; font-size: 12px; box-shadow: none !important; cursor: pointer; transition: transform .12s, background .2s; }
html body #story-create-overlay .jx-create .jx-tool:active { transform: scale(.96); background: #f3f8fd !important; }
html body #story-create-overlay .jx-create .jx-q { display: block; margin: 18px 0 2px !important; font-size: 14px !important; font-weight: 600; color: var(--jx-ink) !important; }
html body #story-create-overlay .jx-create #story-write-fields .jx-q:first-child { margin-top: 4px !important; }
.jx-q em { font-style: normal; font-size: 11px; font-weight: 400; color: var(--jx-rose-deep); margin-left: 6px; }
html body #story-create-overlay .jx-create .jx-line1 { height: 32px; }
.jx-inline { display: flex; gap: 8px; align-items: center; margin-top: 8px; }
html body #story-create-overlay .jx-create .jx-inline select { flex: 1; min-width: 0; padding: 7px 10px !important; margin: 0 !important; border: 1px solid var(--jx-rule) !important; border-radius: 10px !important; background: #fff !important; font-size: 13px; color: var(--jx-ink); }
.jx-import-progress { margin-top: 10px; }

/* 两步进度与底部按钮 */
html body #story-create-overlay .jx-create .story-steps { margin: 16px 0 0; background: rgba(255, 255, 255, .9); }
.jx-dock { position: sticky; bottom: 0; z-index: 4; margin: auto -20px 0; padding: 18px 20px calc(14px + env(safe-area-inset-bottom, 0px)); background: linear-gradient(to top, rgba(251, 252, 255, .98) 65%, rgba(251, 252, 255, 0)); }
.jx-dock-note { margin: 0 0 10px; font-size: 12px; color: var(--jx-soft); text-align: center; line-height: 1.6; }
html body #story-create-overlay .jx-create .jx-submit { display: block; width: 100%; min-height: 50px; margin: 0 !important; border: 0 !important; border-radius: 16px !important; background: var(--jx-rose) !important; color: #fff !important; font-size: 16px !important; font-weight: 600; letter-spacing: .08em; box-shadow: 0 8px 20px -8px rgba(201, 101, 143, .7) !important; cursor: pointer; transition: transform .12s, box-shadow .2s, opacity .2s; }
html body #story-create-overlay .jx-create .jx-submit:active:not(:disabled) { transform: scale(.98); box-shadow: 0 4px 10px -6px rgba(201, 101, 143, .7) !important; }
html body #story-create-overlay .jx-create .jx-submit:disabled { opacity: .7; cursor: wait; }
html body #story-create-overlay .jx-create :focus-visible { outline: 2px solid var(--jx-rose); outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) { html body #story-create-overlay .jx-create .jx-tabs button, html body #story-create-overlay .jx-create .jx-submit { transition: none; } }
html body #story-create-overlay:has(.jx-create) { padding: 0 !important; display: block; background: rgba(68, 51, 56, .12) !important; }
html body #story-create-overlay .story-create-sheet.jx-create { position: absolute !important; inset: 0 !important; width: 100% !important; max-width: none; height: 100% !important; max-height: none !important; border: 0 !important; border-radius: 0 !important; box-shadow: none !important; overflow-y: auto !important; animation: jx-open .32s cubic-bezier(.2, .8, .2, 1); }
html body #story-create-overlay .jx-create > :not(.jx-head):not(.jx-dock):not(input) { width: 100%; max-width: 560px; margin-left: auto; margin-right: auto; box-sizing: border-box; }
html body #story-create-overlay .jx-create > .jx-cover { width: calc(100% - 20px); max-width: 540px; }
@keyframes jx-open { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { html body #story-create-overlay .story-create-sheet.jx-create { animation: none; } }

html body #story-create-overlay .jx-create > .jx-head h3 { grid-column: 2; justify-self: center; font-style: normal !important; font-family: inherit !important; letter-spacing: .02em; }
html body #story-create-overlay .jx-create textarea.jx-lined, html body #story-create-overlay .jx-create input.jx-lined { border: 0 !important; border-radius: 0 !important; box-shadow: none !important; background-color: transparent !important; }
html body #story-create-overlay .jx-create textarea.jx-lined:focus, html body #story-create-overlay .jx-create input.jx-lined:focus { border: 0 !important; box-shadow: none !important; }
html body #story-create-overlay .jx-create .jx-tabs { position: static !important; top: auto !important; z-index: 1; padding: 0 14px !important; }
html body #story-create-overlay .jx-create .jx-inline select { height: 36px; color: var(--jx-ink) !important; border-color: var(--jx-rule) !important; box-shadow: none !important; }

/* ================= 剧本库：相册式剧本架 ================= */
html body .sx-panel .story-create-sheet.is-library { background: linear-gradient(rgba(246, 250, 255, .78), rgba(251, 252, 255, .96) 55%), url("assets/sky/wallpaper.jpg") center top / cover !important; }
html body .sx-panel .story-create-sheet.is-library > .sx-head { background: rgba(246, 250, 255, .72) !important; backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); }
html body .sx-panel .story-create-sheet.is-library .sx-head h3 { color: #4b3943; }

html body .sx-panel [data-content] .sx-resume { display: flex !important; align-items: center; justify-content: space-between; width: 100%; padding: 12px 16px !important; margin: 0 0 4px !important; border: 1px solid rgba(255, 255, 255, .9) !important; border-radius: 16px !important; background: rgba(255, 255, 255, .78) !important; color: #4b3943 !important; text-align: left; cursor: pointer; box-shadow: 0 8px 20px -14px rgba(77, 120, 170, .5); }
.sx-resume span { display: grid; gap: 2px; min-width: 0; }
.sx-resume small { font-size: 11px; color: #8a7480; }
.sx-resume strong { font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sx-resume em { font-style: normal; flex-shrink: 0; padding: 7px 14px; border-radius: 999px; background: #e68aae; color: #fff; font-size: 13px; font-weight: 600; }

.sx-shelf { margin: 0 -22px; }
.sx-carousel { display: flex; gap: 14px; overflow-x: auto; overflow-y: visible; scroll-snap-type: x mandatory; padding: 30px calc(50% - min(29vw, 115px)) 34px; scrollbar-width: none; -webkit-overflow-scrolling: touch; outline: none; }
.sx-carousel::-webkit-scrollbar { display: none; }
.sx-carousel:focus-visible { box-shadow: inset 0 0 0 2px rgba(230, 138, 174, .5); border-radius: 16px; }
html body .sx-panel [data-content] .sx-book { flex: 0 0 min(58vw, 230px); aspect-ratio: 3 / 4; position: relative; display: block !important; padding: 0 !important; margin: 0 !important; scroll-snap-align: center; border: 0 !important; border-radius: 6px 14px 14px 6px !important; background: linear-gradient(160deg, var(--tint-light, #eef6fe) 0%, var(--tint, #cfe6fa) 100%) !important; color: #4b3943 !important; cursor: pointer; overflow: visible; transform-origin: 50% 85%; transition: transform .18s ease-out, opacity .18s ease-out, box-shadow .25s; box-shadow: 0 16px 30px -18px rgba(60, 80, 120, .55), inset 10px 0 0 rgba(0, 0, 0, .05); will-change: transform; }
html body .sx-panel [data-content] .sx-book:active:not(:disabled) { transform: none; }
html body .sx-panel [data-content] .sx-book.is-active { box-shadow: 0 24px 40px -18px rgba(60, 80, 120, .6), inset 10px 0 0 rgba(0, 0, 0, .05); }
.sx-book::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 10px; border-radius: 6px 0 0 6px; background: repeating-linear-gradient(to bottom, rgba(255, 255, 255, .55) 0 2px, transparent 2px 14px); }
.sx-book-tape { position: absolute; top: -9px; right: 18px; width: 54px; height: 18px; transform: rotate(6deg); background: repeating-linear-gradient(45deg, rgba(255, 255, 255, .75) 0 6px, rgba(255, 255, 255, .45) 6px 12px); box-shadow: 0 1px 2px rgba(0, 0, 0, .06); }
.sx-book-glyph { position: absolute; left: 50%; top: 16%; transform: translateX(-50%); font-family: "Songti SC", "STSong", "Noto Serif SC", serif; font-size: min(26vw, 104px); line-height: 1; font-weight: 700; color: var(--tint-deep, #7aa7cf); opacity: .28; pointer-events: none; }
.sx-book-label { position: absolute; left: 14%; right: 9%; bottom: 13%; display: grid; gap: 4px; padding: 12px 12px 10px; background: rgba(255, 255, 255, .92); border-radius: 4px; text-align: center; box-shadow: 0 1px 0 rgba(0, 0, 0, .04); }
.sx-book-label strong { font-family: "Songti SC", "STSong", "Noto Serif SC", serif; font-size: 16px; font-weight: 700; line-height: 1.35; color: #4b3943; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.sx-book-label small { font-size: 11px; color: #8a7480; }
html body .sx-panel [data-content] .sx-book-new { background: rgba(255, 255, 255, .55) !important; border: 2px dashed #cfe6fa !important; box-shadow: none !important; }
.sx-book-new::before { display: none; }
.sx-book-plus { position: absolute; left: 50%; top: 26%; transform: translateX(-50%); width: 64px; height: 64px; border-radius: 50%; background: #fff; color: #e68aae; font-size: 32px; line-height: 64px; text-align: center; box-shadow: 0 6px 16px -8px rgba(201, 101, 143, .5); }
html body .sx-panel [data-content] .sx-book-new .sx-book-label { background: transparent; box-shadow: none; }

.sx-dots { display: flex; justify-content: center; gap: 6px; margin-top: -18px; height: 6px; }
.sx-dots i { width: 6px; height: 6px; border-radius: 3px; background: rgba(75, 57, 67, .18); transition: width .25s, background .25s; }
.sx-dots i.is-on { width: 18px; background: #e68aae; }

.sx-detail { margin: 18px 0 6px; padding: 18px 18px 16px; border-radius: 18px; background: rgba(255, 255, 255, .9); box-shadow: 0 12px 28px -18px rgba(77, 120, 170, .45); min-height: 150px; }
.sx-flip { animation: sx-flip .28s ease; }
@keyframes sx-flip { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.sx-detail-title { margin: 0 0 10px; font-family: "Songti SC", "STSong", "Noto Serif SC", serif; font-size: 20px; font-weight: 700; color: #4b3943; line-height: 1.35; }
.sx-detail-roles { margin-bottom: 10px; }
.sx-detail-roles span { cursor: default !important; min-height: 28px !important; padding: 3px 10px !important; font-size: 13px !important; background: #f6f9fd !important; }
.sx-detail-roles small { margin-left: 4px; font-size: 11px; color: #8a7480; }
.sx-detail-text { margin: 0; font-size: 14px; line-height: 1.8; color: #5b4450; }
.sx-detail-actions { display: flex; align-items: center; gap: 8px; margin-top: 14px; }
.sx-detail-actions .sx-primary { flex: 1; }
html body .sx-panel .is-library [data-content] .sx-btn.sx-primary { background: #e68aae !important; box-shadow: 0 8px 18px -8px rgba(201, 101, 143, .7); }
html body .sx-panel .is-library .sx-more { background: rgba(255, 255, 255, .85); }
@media (prefers-reduced-motion: reduce) { .sx-flip { animation: none; } html body .sx-panel [data-content] .sx-book { transition: none; } }

/* sx 面板接管旧版弹层布局：整页滚动、粘性标题栏、居中标题 */
html body .phone-frame > .sx-panel.selector-overlay:has(.story-create-sheet [data-content]) > .story-create-sheet { display: block !important; padding: 0 22px !important; overflow-y: auto !important; overflow-x: hidden !important; background: var(--sx-bg) !important; }
html body .phone-frame > .sx-panel.selector-overlay:has(.story-create-sheet [data-content]) > .story-create-sheet.is-library { background: linear-gradient(rgba(246, 250, 255, .78), rgba(251, 252, 255, .96) 55%), url("assets/sky/wallpaper.jpg") center top / cover !important; }
html body .phone-frame > .sx-panel.selector-overlay:has(.story-create-sheet [data-content]) > .story-create-sheet > .flex-between { display: grid !important; grid-template-columns: 76px 1fr 76px; align-items: center; position: sticky; top: 0; z-index: 5; margin: 0 -22px !important; padding: calc(6px + env(safe-area-inset-top, 0px)) 16px 6px !important; min-height: 54px; border-bottom: 1px solid var(--sx-line); background: rgba(255, 245, 248, .86) !important; backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); }
html body .phone-frame > .sx-panel.selector-overlay:has(.story-create-sheet [data-content]) > .story-create-sheet.is-library > .flex-between { background: rgba(246, 250, 255, .72) !important; border-bottom-color: rgba(255, 255, 255, .7); }
html body .phone-frame > .sx-panel.selector-overlay:has(.story-create-sheet [data-content]) > .story-create-sheet > .flex-between h3 { grid-column: 2; margin: 0; text-align: center; font: 600 17px/1.3 -apple-system, "PingFang SC", "Hiragino Sans GB", sans-serif !important; color: #4b3943; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
html body .phone-frame > .sx-panel.selector-overlay:has(.story-create-sheet [data-content]) > .story-create-sheet > .flex-between button { grid-row: 1; min-height: 40px; padding: 0 4px !important; border: 0 !important; background: none !important; color: var(--sx-muted) !important; font-size: 15px; }
html body .phone-frame > .sx-panel.selector-overlay:has(.story-create-sheet [data-content]) > .story-create-sheet > .flex-between [data-back] { grid-column: 1; justify-self: start; }
html body .phone-frame > .sx-panel.selector-overlay:has(.story-create-sheet [data-content]) > .story-create-sheet > .flex-between [data-close] { grid-column: 3; justify-self: end; }
html body .phone-frame > .sx-panel.selector-overlay:has(.story-create-sheet [data-content]) > .story-create-sheet [data-content] { display: block; flex: none; overflow: visible !important; max-width: 640px !important; margin: 0 auto !important; padding: 14px 0 24px !important; color: #4a3640; }

/* ================= 去掉“AI 味”：墨色实心按钮，无渐变、无发光 ================= */
.sx-panel, #story-create-overlay { --btn-ink: #3e3237; --btn-ink-press: #2c2327; --btn-line: #ddd3d7; }
/* 标题栏：没有返回时「关闭」在左，右边是操作 */
html body .phone-frame > .sx-panel.selector-overlay:has(.story-create-sheet [data-content]) > .story-create-sheet > .sx-head:not(.has-back) [data-close] { grid-column: 1; justify-self: start; }
html body .phone-frame > .sx-panel.selector-overlay:has(.story-create-sheet [data-content]) > .story-create-sheet > .sx-head [data-action] { grid-column: 3; justify-self: end; }
html body .phone-frame > .sx-panel.selector-overlay:has(.story-create-sheet [data-content]) > .story-create-sheet > .sx-head.has-back.has-action [data-close] { display: none; }
html body .phone-frame > .sx-panel.selector-overlay:has(.story-create-sheet [data-content]) > .story-create-sheet > .sx-head [data-action] { min-height: 32px; padding: 0 12px !important; border-radius: 8px !important; background: var(--btn-ink) !important; color: #fff !important; font-size: 14px; font-weight: 600; }
html body .phone-frame > .sx-panel.selector-overlay:has(.story-create-sheet [data-content]) > .story-create-sheet > .sx-head [data-action]:active { background: var(--btn-ink-press) !important; }

/* 主按钮 */
html body .sx-panel [data-content] .sx-btn.sx-primary,
html body .sx-panel .is-library [data-content] .sx-btn.sx-primary { background: var(--btn-ink) !important; color: #fff !important; border-color: var(--btn-ink) !important; box-shadow: none !important; }
html body .sx-panel [data-content] .sx-btn.sx-primary:active:not(:disabled) { background: var(--btn-ink-press) !important; }
html body .sx-panel [data-content] .sx-btn { border-radius: 10px !important; border-color: var(--btn-line) !important; color: var(--btn-ink) !important; font-weight: 600; }
html body .sx-panel [data-content] .sx-btn.sx-primary { color: #fff !important; }
html body .sx-panel [data-content] .sx-link { color: #7d6f76 !important; }
.sx-resume em { background: var(--btn-ink) !important; border-radius: 8px !important; }
.sx-dots i.is-on { background: var(--btn-ink) !important; }
.sx-dots.is-count { height: auto; margin-top: -14px; font-size: 12px; color: #7d6f76; letter-spacing: .06em; font-variant-numeric: tabular-nums; }
/* 选择项与标签：选中用墨色描边，不再整块粉色 */
html body .sx-panel [data-content] .sx-choice button.is-on { border-color: var(--btn-ink) !important; background: #fff !important; box-shadow: none !important; }
.sx-choice button.is-on::before { border-color: var(--btn-ink) !important; }
html body .sx-panel [data-content] .sx-chips button.is-on { background: var(--btn-ink) !important; color: #fff !important; }
.sx-wizard-steps li.is-on::before { background: var(--btn-ink) !important; }
.sx-wizard-steps li.is-done::before { background: #b9adb3 !important; }
.sx-wizard-steps li.is-on, .sx-wizard-steps li.is-done { color: var(--btn-ink) !important; }
.sx-me { background: #efe9ec !important; color: var(--btn-ink) !important; }
.sx-typing i { background: #b9adb3 !important; }
.sx-check input { accent-color: var(--btn-ink) !important; }

/* 新建剧本页 */
html body #story-create-overlay .jx-create .jx-submit { background: var(--btn-ink) !important; border-radius: 12px !important; box-shadow: none !important; letter-spacing: .04em; }
html body #story-create-overlay .jx-create .jx-submit:active:not(:disabled) { background: var(--btn-ink-press) !important; box-shadow: none !important; }
html body #story-create-overlay .jx-create .jx-tabs button[aria-pressed="true"]::before { background: var(--btn-ink) !important; }
/* 两步进度 */
.story-steps { background: #fff !important; border-color: var(--btn-line) !important; color: var(--btn-ink) !important; }
.story-step-dot { border-color: var(--btn-line) !important; color: #7d6f76 !important; }
.story-steps-list li + li::before { background: var(--btn-line) !important; }
.story-steps-list li[data-state="run"] .story-step-dot { background: #fff !important; color: var(--btn-ink) !important; border: 2px solid var(--btn-ink) !important; animation: none !important; }
.story-steps-list li[data-state="done"] .story-step-dot { background: var(--btn-ink) !important; color: #fff !important; }
#story-steps-bar-fill { background: var(--btn-ink) !important; }
.story-steps-bar { background: #f1edef !important; }
.story-steps-status, .story-step-body small { color: #7d6f76 !important; }
.story-steps-actions button { border-radius: 10px !important; border-color: var(--btn-line) !important; color: var(--btn-ink) !important; }
.story-steps-actions button:first-child { background: var(--btn-ink) !important; color: #fff !important; }
/* 文字强调色改为中性暖灰，粉色只留在背景与封面 */
html body .sx-panel { --sx-ink: #3e3237; --sx-muted: #7d6f76; }
html body .sx-panel .sx-faint, html body .sx-panel .sx-detail-roles small, html body .sx-panel .sx-label { color: #7d6f76 !important; }
.jx-cover-title > span { color: #b9adb3 !important; }

/* ================= 剧情阅读页：天空手账风 ================= */
html body .phone-frame > .sx-panel.selector-overlay:has(.story-create-sheet [data-content]) > .story-create-sheet.is-reading { background: linear-gradient(rgba(246, 250, 255, .80), rgba(251, 252, 255, .94) 50%), url("assets/sky/wallpaper.jpg") center top / cover !important; }
html body .phone-frame > .sx-panel.selector-overlay:has(.story-create-sheet [data-content]) > .story-create-sheet.is-reading > .flex-between { background: rgba(246, 250, 255, .72) !important; border-bottom-color: rgba(255, 255, 255, .7); }
.is-reading .sx-reading-head { margin: 4px 2px 12px; }
.is-reading .sx-reading-head > strong { display: block; font-family: "Songti SC", "STSong", "Noto Serif SC", serif; font-size: 18px; font-weight: 700; color: #3e3237; margin-bottom: 8px; }
.is-reading .sx-scene { margin: 0; gap: 6px; }
.is-reading .sx-scene span { display: inline-flex; align-items: center; gap: 5px; padding: 4px 10px; border: 0; border-radius: 999px; background: rgba(255, 255, 255, .85); color: #5d5258; font-size: 12px; }
.is-reading .sx-scene span i { font-size: 10px; color: #8a7d84; }
/* 正文：一张白纸，宋体，段落留白，不再一段一卡 */
.is-reading .sx-turns { gap: 0; padding: 22px 20px 18px; border-radius: 6px; background: #fff; box-shadow: 0 1px 0 #eef3fa, 0 14px 30px -18px rgba(77, 120, 170, .35); }
.is-reading .sx-narr { padding: 0; border: 0; border-radius: 0; background: none; animation: none; font-family: "Songti SC", "STSong", "Noto Serif SC", "Source Han Serif SC", serif; font-size: 16px; line-height: 1.95; color: #2f2a2d; white-space: normal; }
.is-reading .sx-narr p { margin: 0 0 .9em; text-indent: 2em; }
.is-reading .sx-narr p:last-child { margin-bottom: 0; }
.is-reading .sx-me { align-self: flex-end; max-width: 80%; margin: 4px 0 14px; padding: 7px 12px; border-radius: 12px 12px 4px 12px; background: #f3f0f2 !important; color: #3e3237 !important; font-size: 14px; line-height: 1.6; }
.is-reading .sx-turn-sep { height: 1px; margin: 18px auto; width: 40%; background: repeating-linear-gradient(90deg, #d9d2d6 0 4px, transparent 4px 10px); }
.is-reading .sx-empty { background: transparent; border: 0; }
/* 输入栏 */
.is-reading .sx-composer { background: rgba(251, 252, 255, .92) !important; border-top-color: rgba(220, 228, 238, .9) !important; }
.is-reading .sx-compose-row { align-items: center !important; }
html body .sx-panel .is-reading .sx-compose-row .sx-input { min-height: 40px !important; padding: 9px 12px !important; border-radius: 10px !important; line-height: 1.5; }
html body .sx-panel .is-reading [data-content] .sx-btn.sx-continue { min-height: 40px; padding: 0 12px !important; font-size: 14px; font-weight: 500; background: #fff !important; color: #3e3237 !important; border-color: #ddd3d7 !important; }
html body .sx-panel .is-reading [data-content] .sx-compose-row .sx-btn.sx-primary { min-height: 40px; padding: 0 16px !important; }
.sx-story-tip { margin: 0 0 12px; }
/* 显示剧情状态栏时，全屏面板的顶栏给它让出位置 */
html body.has-story-clock .phone-frame > .sx-panel.selector-overlay:has(.story-create-sheet [data-content]) > .story-create-sheet > .flex-between { padding-top: 28px !important; min-height: 76px; }
html body.has-story-clock #story-create-overlay .jx-create > .jx-head { padding-top: 30px !important; }

/* ===== 剧情阅读页 v2：正文更宽更大，底部两行 ===== */
html body .phone-frame > .sx-panel.selector-overlay:has(.story-create-sheet [data-content]) > .story-create-sheet.is-reading { padding: 0 12px !important; }
html body .phone-frame > .sx-panel.selector-overlay:has(.story-create-sheet [data-content]) > .story-create-sheet.is-reading > .flex-between { margin: 0 -12px !important; }
html body .phone-frame > .sx-panel.selector-overlay:has(.story-create-sheet [data-content]) > .story-create-sheet.is-reading [data-content] { padding: 10px 0 0 !important; }
.is-reading .sx-reading-head { margin: 4px 8px 10px; }
.is-reading .sx-reading-head > strong { font-size: 17px; margin-bottom: 6px; }
/* 白纸：左右留白收窄，一行约 20 个字 */
.is-reading .sx-turns { padding: 20px 16px 22px; border-radius: 4px; }
.is-reading .sx-narr { font-size: 15px; line-height: 1.8; letter-spacing: .01em; color: #2b2629; }
.is-reading .sx-narr p { margin: 0 0 .6em; text-indent: 2em; text-align: justify; }
.is-reading .sx-narr p.is-line { text-indent: 1em; }
.is-reading .sx-turn { display: flex; flex-direction: column; }
.is-reading .sx-turn.has-sep { margin-top: 26px; padding-top: 22px; position: relative; }
.is-reading .sx-turn.has-sep::before { content: "· · ·"; position: absolute; top: -8px; left: 0; right: 0; text-align: center; color: #c9c0c5; font-size: 13px; letter-spacing: .3em; }
.is-reading .sx-me { margin: 0 0 14px; align-self: flex-end; font-family: -apple-system, "PingFang SC", sans-serif; font-size: 13px; color: #6d6168 !important; background: #f4f1f3 !important; border-radius: 10px 10px 3px 10px; padding: 6px 11px; }
.is-reading .sx-turn.is-new { animation: sx-turn-in .5s ease-out; }
@keyframes sx-turn-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.is-reading .sx-typing-line { display: flex; gap: 5px; justify-content: center; padding: 22px 0 4px; }
.is-reading .sx-typing-line i { width: 6px; height: 6px; border-radius: 50%; background: #c9c0c5; animation: sx-dot 1s infinite ease-in-out; }
.is-reading .sx-typing-line i:nth-child(2) { animation-delay: .15s; } .is-reading .sx-typing-line i:nth-child(3) { animation-delay: .3s; }
.is-reading .sx-stream:empty { display: none; }
.is-reading .sx-stream.is-live { margin-top: 10px; }
.is-reading .sx-stream.is-live > p:last-child::after { content: ''; display: inline-block; width: 2px; height: 1em; margin-left: 2px; vertical-align: -0.12em; background: #b9adb3; animation: sx-caret 1s steps(2) infinite; }
@keyframes sx-caret { 50% { opacity: 0; } }
/* 底部：推荐行动一行 + 输入一行 */
.is-reading .sx-composer { margin: 10px -12px 0 !important; padding: 8px 12px calc(8px + env(safe-area-inset-bottom, 0px)) !important; }
.is-reading .sx-quick { flex-wrap: nowrap !important; align-items: stretch; overflow-x: auto; margin: 0 0 8px !important; scrollbar-width: none; }
.is-reading .sx-quick::-webkit-scrollbar { display: none; }
html body .sx-panel .is-reading [data-content] .sx-quick button { flex-shrink: 0; min-height: 30px !important; padding: 4px 12px !important; font-size: 13px !important; border-color: #e3dde0 !important; background: #fff !important; color: #4b4045 !important; }
/* 推荐行动：点一下直接推进；带副标题的两行更清楚 */
html body .sx-panel .is-reading [data-content] .sx-quick .sx-quick-item { display: flex; flex-direction: column; align-items: flex-start; gap: 1px; max-width: 172px; min-height: 30px !important; padding: 5px 12px !important; text-align: left; }
.is-reading .sx-quick-item .sx-quick-text { font-size: 13px; line-height: 1.35; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.is-reading .sx-quick-item .sx-quick-hint { font-size: 10.5px; line-height: 1.3; font-style: normal; color: #a2969b; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.is-reading .sx-quick-item:active { background: #f5f1f2 !important; }
html body .sx-panel .is-reading [data-content] .sx-quick .sx-quick-continue { align-self: stretch; gap: 5px; background: #3e3237 !important; color: #fff !important; border-color: #3e3237 !important; }
.is-reading .sx-quick-continue i { font-size: 11px; }
html body .sx-panel .is-reading .sx-compose-row { gap: 8px; }
html body .sx-panel .is-reading .sx-compose-row .sx-input { min-height: 38px !important; padding: 8px 12px !important; font-size: 15px !important; }
html body .sx-panel .is-reading [data-content] .sx-compose-row .sx-btn.sx-primary { min-height: 38px; padding: 0 16px !important; border-radius: 10px !important; }
.is-reading .sx-gen { display: flex; align-items: center; gap: 8px; margin: 0 2px 8px; font-size: 12px; color: #7d6f76; }
.is-reading .sx-gen [data-status] { flex: 1; min-width: 0; }
.is-reading .sx-gen[hidden], .is-reading .sx-gen-error[hidden] { display: none; }
.is-reading .sx-gen-dots { display: inline-flex; gap: 3px; } .is-reading .sx-gen-dots i { width: 4px; height: 4px; border-radius: 50%; background: #b9adb3; animation: sx-dot 1s infinite; } .is-reading .sx-gen-dots i:nth-child(2) { animation-delay: .15s; } .is-reading .sx-gen-dots i:nth-child(3) { animation-delay: .3s; }
html body .sx-panel .is-reading [data-content] .sx-gen .sx-link { margin-left: auto !important; padding: 2px 4px !important; font-size: 12px; }
html body .sx-panel .is-reading [data-content] .sx-gen .sx-link { flex-shrink: 0; white-space: nowrap; }
.is-reading .sx-gen-error { margin: 0 2px 8px; font-size: 12px; color: #c0485f; line-height: 1.5; }
/* 设置：按用途分组，一组一卡片 */
.st-body { padding: 0 16px calc(28px + env(safe-area-inset-bottom)); overflow-y: auto; height: calc(100% - var(--nav-height)); }
.st-group { margin-bottom: 18px; }
.st-group h4 { margin: 0 0 8px 4px; font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", sans-serif; font-size: 12px; font-weight: 500; letter-spacing: 1px; color: #a89aa1; }
.st-card { background: #fff; border-radius: 14px; padding: 0 14px; border: 1px solid rgba(232,228,230,0.9); box-shadow: 0 1px 3px rgba(0,0,0,0.02); }
.st-row { display: flex; align-items: center; gap: 12px; min-height: 54px; padding: 8px 0; border-bottom: .5px solid #f1edef; cursor: pointer; }
.st-card > .st-row:last-child { border-bottom: 0; }
.st-row:active { background: #faf7f8; }
.st-tile { width: 28px; height: 28px; border-radius: 8px; background: #f2f0f1; color: #6f6168; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.st-tile .settings-line-icon { width: 16px; height: 16px; }
.st-label { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; font-size: 15px; font-weight: 500; color: #3e3237; letter-spacing: .2px; }
.st-label .st-note { font-size: 11.5px; font-weight: 400; color: #a89aa1; letter-spacing: 0; line-height: 1.45; }
.st-chev { width: 14px; height: 14px; color: #c9bdc3; flex-shrink: 0; }
.wwb-seg { display: flex; gap: 6px; flex-wrap: wrap; }
.wwb-seg button { border: 1px solid #e6dfe2; background: #fff; color: #6f6168; border-radius: 16px; padding: 6px 12px; font: inherit; font-size: 13px; cursor: pointer; }
.wwb-seg button.on { background: #3e3237; border-color: #3e3237; color: #fff; }
.st-foot { margin: 22px 4px 0; font-size: 11px; color: #b3a7ac; line-height: 1.7; text-align: center; }
.st-about { text-align: center; padding: 14px 0 26px; }
.st-about-icon { display: block; margin: 0 auto 10px; width: 64px; height: 64px; border-radius: 16px; box-shadow: 0 4px 14px rgba(62,50,55,.10); }
.st-about-mark { font-family: 'Georgia', serif; font-style: italic; font-size: 26px; color: #3e3237; letter-spacing: 2px; }
.st-about-ver { margin-top: 6px; font-size: 11.5px; color: #a89aa1; letter-spacing: .5px; }

/* 数值：只在「更多」里看，正文不显示 */
.sx-stats-list { display: flex; flex-direction: column; gap: 10px; margin: 6px 0 12px; }
.sx-stat-row { display: flex; align-items: center; gap: 10px; font-size: 13px; color: #4b4045; }
.sx-stat-row span { width: 68px; flex-shrink: 0; color: #6f6168; }
.sx-stat-row b { margin-left: auto; font-weight: 500; color: #3e3237; font-variant-numeric: tabular-nums; }
.sx-stat-row i { flex: 1; height: 3px; border-radius: 2px; background: #eee7e9; position: relative; overflow: hidden; }
.sx-stat-row i::after { content: ''; position: absolute; inset: 0 auto 0 0; width: var(--pct, 0%); background: #b9a5ae; }
.sx-stat-owner { margin: 10px 0 2px; font-size: 11px; color: #a89aa1; letter-spacing: 1px; }
.sx-cal-list { display: flex; flex-direction: column; gap: 10px; margin: 6px 0 12px; }
.sx-cal-item { display: flex; gap: 12px; align-items: flex-start; }
.sx-cal-item.is-past { opacity: .55; }
.sx-cal-when { width: 86px; flex-shrink: 0; font-size: 12px; color: #6f6168; line-height: 1.5; }
.sx-cal-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.sx-cal-main strong { font-size: 14px; font-weight: 500; color: #3e3237; }
.sx-cal-main span { font-size: 11.5px; color: #a89aa1; }
.sx-cal-item em { font-style: normal; font-size: 11px; color: #a89aa1; }

/* 对白：和正文一样首行空两格；「名字：」加粗墨色，台词紧跟在后面；玩家和别人一样，不做区分 */
.is-reading .sx-narr p.is-line { text-indent: 2em; }
.is-reading .sx-narr p.is-npc-line, .is-reading .sx-narr p.is-me-line { display: block; margin-bottom: .6em; }
.is-reading .sx-speaker { font-weight: 600; font-style: italic; color: #9a8f94; }
.is-reading .sx-speaker::after { content: '：'; }
.is-reading .sx-said { color: #9a8f94; font-style: italic; font-weight: 600; }
.is-reading .sx-narr p.is-me-line { padding: 0; border: 0; background: none; }
/* 心里话默认藏着：长按这句台词才浮出来；有心里话的台词后面一个很淡的小点作提示 */
.is-reading .sx-narr p.has-os { -webkit-touch-callout: none; -webkit-user-select: none; user-select: none; cursor: pointer; }
.is-reading .sx-os-dot { display: inline-block; width: 4px; height: 4px; margin: 0 0 .25em .35em; border-radius: 50%; background: #d8ced2; vertical-align: middle; }
.is-reading .sx-narr p.show-os .sx-os-dot { display: none; }
.is-reading .sx-os { display: none; margin-left: .3em; font-size: .82em; line-height: 1.6; color: #b8aeb3; font-style: italic; font-weight: 400; }
.is-reading .sx-narr p.show-os .sx-os { display: inline; animation: sx-os-in .2s ease; }
@keyframes sx-os-in { from { opacity: 0; } to { opacity: 1; } }
.is-reading .sx-os::before { content: '（'; } .is-reading .sx-os::after { content: '）'; }
/* 最新一回合下面的「重新生成 / 撤销」 */
.is-reading .sx-turn-tools { display: flex; justify-content: flex-end; gap: 14px; margin: 10px 0 0; }
html body .sx-panel .is-reading [data-content] .sx-turn-tools button { min-height: 0 !important; padding: 4px 2px !important; border: 0 !important; background: none !important; color: #9a8d93 !important; font-size: 12.5px !important; font-weight: 400 !important; box-shadow: none !important; }
html body .sx-panel .is-reading [data-content] .sx-turn-tools button:active { color: #3e3237 !important; }

/* 开局分步：三步清单，一眼看出卡在哪 */
.is-reading .sx-opening { margin: 0 2px 12px; padding: 12px 14px; border: .5px solid #eee7e9; border-radius: 12px; background: #fcfafb; }
.is-reading .sx-opening[hidden] { display: none; }
.is-reading .sx-open-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; margin-bottom: 8px; }
.is-reading .sx-open-head strong { font-size: 12px; color: #3e3237; font-weight: 600; }
.is-reading .sx-open-head span { font-size: 10px; color: #b3a7ac; }
.is-reading .sx-open-list { list-style: none; margin: 0 !important; padding: 0 !important; display: flex; flex-direction: column; gap: 6px; }
.is-reading .sx-open-list li { display: flex; align-items: center; gap: 8px; font-size: 12px; color: #8b7d83; line-height: 1.4; }
.is-reading .sx-open-mark { width: 14px; text-align: center; font-size: 11px; color: #c6bcc0; flex-shrink: 0; }
.is-reading .sx-open-label { flex: 1; min-width: 0; }
.is-reading .sx-open-tail { font-size: 10.5px; color: #b3a7ac; flex-shrink: 0; }
.is-reading .sx-open-list li.is-done .sx-open-mark { color: #5aa58a; }
.is-reading .sx-open-list li.is-done .sx-open-label { color: #4b4045; }
.is-reading .sx-open-list li.is-running .sx-open-mark { color: #8d74b8; }
.is-reading .sx-open-list li.is-running .sx-open-label { color: #3e3237; font-weight: 500; }
.is-reading .sx-open-list li.is-failed .sx-open-mark { color: #c0485f; }
.is-reading .sx-open-list li.is-failed .sx-open-tail { color: #c0485f; }

/* 没写完的回合：重试 / 放弃 */
.is-reading .sx-pending { margin: 0 2px 8px; padding: 10px 12px; border: .5px solid #e6dfe2; border-radius: 10px; background: #fbf9fa; }
.is-reading .sx-pending[hidden] { display: none; }
.is-reading .sx-pending-text { margin: 0 0 8px !important; padding: 0 !important; font-size: 12px; line-height: 1.55; color: #6f6168; }
.is-reading .sx-pending-row { display: flex; gap: 8px; }
html body .sx-panel .is-reading [data-content] .sx-pending-row .sx-btn { min-height: 32px !important; padding: 0 14px !important; font-size: 13px !important; border-radius: 8px !important; }
html body .sx-panel .is-reading [data-content] .sx-pending-row .sx-btn.sx-primary { background: #3e3237 !important; color: #fff !important; border-color: #3e3237 !important; }
/* 更多：底部弹出菜单 */
.sx-sheet-mask { position: absolute; inset: 0; z-index: 30; background: rgba(0, 0, 0, .35); display: flex; align-items: flex-end; }
.sx-sheet-mask[hidden] { display: none; }
.sx-sheet { width: 100%; background: #f7f7f7; border-radius: 14px 14px 0 0; padding-bottom: env(safe-area-inset-bottom, 0px); overflow: hidden; animation: wx-sheet-up .2s ease-out; }
html body .sx-panel [data-content] .sx-sheet-row { display: flex !important; align-items: center; justify-content: center; width: 100%; min-height: 54px; margin: 0 !important; padding: 0 18px !important; border: 0 !important; border-radius: 0 !important; border-bottom: .5px solid #e8e8e8 !important; background: #fff !important; color: #222 !important; font-size: 16px; font-weight: 400; cursor: pointer; }
.sx-sheet label.sx-sheet-row { justify-content: space-between !important; }
.sx-sheet label.sx-sheet-row input { width: 20px; height: 20px; accent-color: #3e3237; }
html body .sx-panel [data-content] .sx-sheet-row.sx-sheet-cancel { margin-top: 8px !important; border-bottom: 0 !important; }
html body .sx-panel [data-content] .sx-sheet-row:disabled { color: #bbb !important; }
@media (prefers-reduced-motion: reduce) { .is-reading .sx-turn.is-new, .sx-sheet { animation: none; } }
html body .sx-panel > .sx-sheet-mask .sx-sheet-row { display: flex !important; align-items: center; justify-content: center; width: 100%; min-height: 54px; margin: 0 !important; padding: 0 18px !important; border: 0 !important; border-radius: 0 !important; border-bottom: .5px solid #e8e8e8 !important; background: #fff !important; color: #222 !important; font: 400 16px -apple-system, "PingFang SC", sans-serif; cursor: pointer; box-sizing: border-box; }
html body .sx-panel > .sx-sheet-mask label.sx-sheet-row { justify-content: space-between !important; }
html body .sx-panel > .sx-sheet-mask .sx-sheet-row.sx-sheet-cancel { margin-top: 8px !important; border-bottom: 0 !important; }
html body .sx-panel > .sx-sheet-mask .sx-sheet-row:disabled { color: #bbb !important; }
html body .sx-panel > .sx-sheet-mask .sx-sheet-row:active { background: #f2f2f2 !important; }
html body .phone-frame > .sx-panel.selector-overlay:has(.story-create-sheet [data-content]) > .story-create-sheet.is-reading > .flex-between { background: rgba(247, 250, 254, .97) !important; backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); }
/* 推荐行动横排：可滑动 + 两端渐隐提示 */
.is-reading .sx-quick { cursor: grab; user-select: none; -webkit-user-select: none; scroll-behavior: smooth; -webkit-mask-image: none; mask-image: none; padding-right: 2px; }
.is-reading .sx-quick.has-more { -webkit-mask-image: linear-gradient(90deg, #000 82%, transparent); mask-image: linear-gradient(90deg, #000 82%, transparent); }
.is-reading .sx-quick.has-prev.has-more { -webkit-mask-image: linear-gradient(90deg, transparent, #000 10%, #000 82%, transparent); mask-image: linear-gradient(90deg, transparent, #000 10%, #000 82%, transparent); }
.is-reading .sx-quick.has-prev:not(.has-more) { -webkit-mask-image: linear-gradient(90deg, transparent, #000 10%); mask-image: linear-gradient(90deg, transparent, #000 10%); }

/* 人物头像设置 */
.sx-avatar-list { display: grid; gap: 8px; margin-top: 12px; }
.sx-avatar-row { display: flex; align-items: center; gap: 12px; width: 100%; padding: 10px 12px; border: 1px solid var(--sx-line, #ede7ea); border-radius: 12px; background: #fff; text-align: left; font: inherit; color: #4b3943; cursor: pointer; }
.sx-avatar-row:active { background: #faf6f8; }
.sx-avatar-row img { width: 40px; height: 40px; border-radius: 10px; object-fit: cover; flex: 0 0 auto; background: #f0ebee; }
.sx-avatar-row > span { flex: 1; font-size: 15px; font-weight: 600; }
.sx-avatar-row > em { font-style: normal; font-size: 12px; color: #7d6f76; border: 1px solid #ddd3d7; border-radius: 8px; padding: 4px 10px; }

/* 批注 */
.sx-compose-row .sx-note-btn { flex: 0 0 auto; width: 38px; height: 38px; align-self: center; border: 1px solid #ddd3d7; border-radius: 10px; background: #fff; color: #7d6f76; font-size: 14px; cursor: pointer; }
.sx-compose-row .sx-note-btn.is-on { color: #3e3237; border-color: #3e3237; }
.sx-note-bar { display: block; width: 100%; margin: 0 0 8px; padding: 6px 10px; border: 0; border-radius: 8px; background: #f6f1f3; color: #6b5a63; font: 12px/1.4 -apple-system, "PingFang SC", sans-serif; text-align: left; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; cursor: pointer; }
.sx-note-bar[hidden] { display: none; }
.sx-note-sheet { padding: 16px 18px calc(14px + env(safe-area-inset-bottom, 0px)) !important; display: block !important; }
.sx-note-sheet > .sx-h { margin: 0 0 4px; }
.sx-note-sheet > .sx-faint { margin: 0 0 10px; }
.sx-note-sheet textarea { width: 100%; box-sizing: border-box; }
.sx-note-sheet [data-note-add] { width: 100%; margin-top: 4px; }
.sx-note-sheet .sx-sheet-cancel { width: 100%; margin-top: 14px; border-top: 1px solid #ede7ea; padding-top: 12px; text-align: center; }
.sx-note-scope { display: flex; gap: 18px; margin: 10px 2px 12px; font-size: 14px; color: #4b3943; }
.sx-note-scope input { accent-color: #3e3237; margin-right: 4px; }
.sx-note-list { display: grid; gap: 6px; margin-top: 12px; }
.sx-note-item { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border: 1px solid #ede7ea; border-radius: 10px; background: #fff; }
.sx-note-tag { flex: 0 0 auto; font-size: 11px; padding: 1px 6px; border-radius: 5px; background: #f1ecee; color: #7d6f76; }
.sx-note-text { flex: 1; min-width: 0; font-size: 13px; color: #4b3943; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav-back-svg{display:block;flex-shrink:0}

/* 玩家这一回合做的事：右对齐的一小条，前面标「你」，生成时也先显示出来 */
.is-reading .sx-turn { display: flex; flex-direction: column; }
.is-reading .sx-turn > .sx-narr { align-self: stretch; }
.is-reading .sx-me, .sx-me-live { display: block; align-self: flex-end; max-width: 82%; white-space: pre-wrap; word-break: break-word; }
.is-reading .sx-me::before, .sx-me-live::before { content: '你'; display: block; font-size: 10.5px; color: #b896a3; margin-bottom: 1px; letter-spacing: .05em; }
.sx-me-live { margin: 6px 0 12px auto; padding: 6px 11px; border-radius: 10px 10px 3px 10px; background: #f4f1f3; color: #6d6168; font-size: 13px; line-height: 1.6; font-family: -apple-system, "PingFang SC", sans-serif; }

/* 生成剧本时：新建页的输入变灰，不能再改 */
.jx-create.is-busy .jx-cover, .jx-create.is-busy .jx-notebook .jx-tabs, .jx-create.is-busy #story-paste-fields textarea, .jx-create.is-busy #story-write-fields { opacity: .55; pointer-events: none; }
.jx-create.is-busy #story-create-submit { opacity: .6; }

/* ===== 快捷浮标：浮标本体 + 心声面板 ===== */
html body #floating-ball { width: 40px; height: 40px; border-radius: 50% !important; background: rgba(62, 50, 55, .86) !important; border: 1px solid rgba(255, 255, 255, .5) !important; box-shadow: 0 6px 18px rgba(62, 50, 55, .22) !important; }
html body #floating-ball #floating-ball-icon { color: #fff !important; font-size: 15px !important; }
html body #floating-panel-overlay { align-items: flex-end !important; background: rgba(62, 50, 55, .2); }
html body #floating-panel-overlay .status-panel-container { width: 100% !important; max-width: none !important; max-height: 72% !important; border-radius: 22px 22px 0 0 !important; background: #fff5f8 !important; box-shadow: 0 -8px 30px rgba(80, 50, 60, .12) !important; padding-bottom: env(safe-area-inset-bottom); }
html body #floating-panel-overlay .status-panel-top-bar { display: none !important; }
html body #floating-panel-overlay .status-panel-content-wrapper { padding-top: 0 !important; }
.qf-head { display: flex; align-items: center; gap: 12px; padding: 20px 20px 12px; }
.qf-head img { width: 44px; height: 44px; border-radius: 50%; object-fit: cover; background: #f3e4ea; flex-shrink: 0; }
.qf-who { flex: 1; min-width: 0; }
.qf-who strong { display: block; font-size: 16px; color: #3e3237; }
.qf-who span { display: block; margin-top: 3px; font-size: 12px; color: #b896a3; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.qf-head em { font-style: normal; font-size: 11px; color: #c9b1bb; }
.qf-voice { margin: 4px 20px 14px; padding: 14px 16px; background: #fff; border-radius: 14px; font-family: "Songti SC", "STSong", "Noto Serif SC", serif; font-size: 15px; line-height: 1.85; color: #4a3c42; position: relative; }
.qf-voice::before { content: '心声'; display: block; font-family: -apple-system, "PingFang SC", sans-serif; font-size: 11px; color: #b896a3; margin-bottom: 4px; letter-spacing: .1em; }
.qf-rows { margin: 0 20px; background: #fff; border-radius: 14px; padding: 2px 14px; }
.qf-rows > div { display: flex; gap: 12px; padding: 11px 0; border-bottom: 1px solid #f6e8ee; }
.qf-rows > div:last-child { border-bottom: 0; }
.qf-rows dt { width: 36px; flex-shrink: 0; font-size: 12px; color: #b896a3; padding-top: 1px; }
.qf-rows dd { margin: 0; flex: 1; font-size: 14px; line-height: 1.6; color: #4a3c42; }
.qf-hold { margin: 12px 24px 0; font-size: 12.5px; color: #a3476d; line-height: 1.6; }
.qf-empty { margin: 10px 24px 26px; font-size: 13px; color: #b896a3; line-height: 1.7; }
.qf-foot { display: flex; gap: 8px; padding: 16px 20px 18px; }
.qf-foot button { border: 1px solid #f0dde5; background: #fff; color: #8a6b78; border-radius: 15px; padding: 7px 13px; font: inherit; font-size: 12.5px; cursor: pointer; }
.qf-foot button.is-on { background: #3e3237; border-color: #3e3237; color: #fff; }

/* ===== 微博评论区：照着微博正文页的样子 ===== */
.wbc-tabs { display: flex; align-items: center; gap: 22px; margin: 2px 0 6px; padding: 6px 0 10px; border-bottom: 1px solid #f2f2f2; font-size: 13.5px; color: #939393; }
.wbc-tabs .on { color: #333; font-weight: 600; position: relative; }
.wbc-tabs .on::after { content: ''; position: absolute; left: 50%; bottom: -11px; width: 18px; height: 3px; margin-left: -9px; border-radius: 2px; background: #ff8200; }
.wbc-tabs em { margin-left: auto; font-style: normal; font-size: 12px; color: #939393; }
.wbc { display: flex; gap: 10px; padding: 12px 0 10px; border-bottom: 1px solid #f5f5f5; cursor: pointer; }
.wbc-face { width: 34px; height: 34px; border-radius: 50%; object-fit: cover; flex-shrink: 0; background: #f2f2f2; }
.wbc-main { flex: 1; min-width: 0; }
.wbc-name { font-size: 13px; color: #eb7350; line-height: 1.3; }
.wbc-text { margin-top: 4px; font-size: var(--global-font-size, 14.5px); line-height: 1.55; color: #333; word-break: break-word; }
.wbc-at { color: #507daf; }
.wbc-meta { display: flex; align-items: center; gap: 14px; margin-top: 6px; font-size: 11.5px; color: #a4a4a4; }
.wbc-reply-btn { color: #939393; }
.wbc-like { margin-left: auto; display: inline-flex; align-items: center; gap: 3px; border: 0; background: none; padding: 0; font: inherit; font-size: 11.5px; color: #a4a4a4; cursor: pointer; }
.wbc-like.is-on { color: #ff8200; }
.wbc-like.is-on svg { fill: #ff8200; }
.wbc-replies { margin-top: 8px; padding: 8px 10px; background: #f7f7f7; border-radius: 4px; font-size: 13px; line-height: 1.65; color: #333; }
.wbc-reply { padding: 2px 0; word-break: break-word; }
.wbc-reply b { font-weight: 400; color: #507daf; }
.wbc-reply .wbc-at { margin-left: 4px; }
.wbc-replies:not(.is-open) .wbc-reply.is-folded { display: none; }
.wbc-more { margin-top: 3px; color: #507daf; font-size: 12.5px; }
.wbc-typing { padding: 6px 0 10px 44px; font-size: 12px; color: #a4a4a4; font-style: italic; }

/* ===== 日记：手帐式，左边日期右边正文；详情页是一张横线纸 ===== */
html body #diary-page, html body #diary-page #diary-scroll-area { background: #fff8fa !important; }
html body #diary-page > .nav-bar { background: #fff8fa !important; backdrop-filter: none !important; }
html body #diary-page > .flex:has(.diary-tab) { background: #fff8fa !important; border-bottom: 0 !important; padding: 2px 16px 8px !important; gap: 6px; }
html body #diary-page .diary-tab { flex: none !important; padding: 6px 14px !important; border-radius: 15px; font-size: 13px !important; color: #8a6b78 !important; font-weight: 400 !important; letter-spacing: 0 !important; border: 1px solid #f0dde5; background: #fff; }
html body #diary-page .diary-tab.active { background: #3e3237; border-color: #3e3237; color: #fff !important; }
html body #diary-page .diary-tab .tab-indicator { display: none; }
.dy-cover { position: relative; margin: 6px 16px 0; padding: 0 16px 16px; background: #fff; border-radius: 18px; overflow: hidden; box-shadow: 0 1px 2px rgba(120, 80, 95, .05); }
.dy-band { height: 56px; margin: 0 -16px; background: linear-gradient(90deg, #f6dde6, #fbeef2) center/cover; cursor: pointer; }
.dy-who { display: flex; align-items: flex-end; gap: 12px; margin-top: -24px; }
.dy-who img { width: 60px; height: 60px; border-radius: 50%; object-fit: cover; border: 3px solid #fff; background: #f3e4ea; flex-shrink: 0; }
.dy-who-text { flex: 1; min-width: 0; padding-bottom: 4px; }
#diary-profile-name { font-size: 17px; font-weight: 600; color: #3e3237; }
#diary-profile-username { font-size: 11.5px; color: #b896a3; margin-top: 2px; }
.dy-gear { border: 0; background: none; color: #c4a6b2; padding: 4px; cursor: pointer; margin-bottom: 4px; }
.dy-quote { margin-top: 12px; font-family: "Songti SC", "STSong", "Noto Serif SC", serif; font-size: 13.5px; line-height: 1.7; color: #7d5a68; cursor: pointer; }
.dy-list-wrap { padding: 18px 16px calc(40px + env(safe-area-inset-bottom, 0px)); }
.dy-list-head { display: flex; align-items: center; justify-content: space-between; margin: 0 4px 6px; }
.dy-list-head span { font-size: 13px; font-weight: 600; color: #3e3237; }
.dy-gen { border: 0; background: #3e3237; color: #fff; border-radius: 15px; padding: 6px 13px; font: inherit; font-size: 12.5px; cursor: pointer; }
html body #diary-list { gap: 0 !important; background: #fff; border-radius: 16px; padding: 0 14px; box-shadow: 0 1px 2px rgba(120, 80, 95, .05); }
html body #diary-list:has(.dy-empty) { background: transparent; box-shadow: none; }
.dy-month { margin: 0 -14px; padding: 12px 14px 6px; font-size: 11.5px; color: #b896a3; letter-spacing: .05em; border-bottom: 1px solid #f6e8ee; }
.dy-month:first-child { padding-top: 14px; }
.dy-entry { display: flex; gap: 14px; width: 100%; padding: 14px 0; border: 0; border-bottom: 1px solid #f6e8ee; background: none; text-align: left; font: inherit; cursor: pointer; color: inherit; }
.dy-entry:last-child { border-bottom: 0; }
.dy-date { width: 34px; flex-shrink: 0; text-align: center; padding-top: 2px; }
.dy-date b { display: block; font-family: "Songti SC", "STSong", "Noto Serif SC", serif; font-size: 24px; font-weight: 600; line-height: 1; color: #3e3237; }
.dy-date small { display: block; margin-top: 4px; font-size: 10.5px; color: #b896a3; }
.dy-body { flex: 1; min-width: 0; display: block; }
.dy-body strong { display: block; font-size: 14.5px; font-weight: 600; color: #3e3237; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dy-pre { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; margin-top: 4px; font-family: "Songti SC", "STSong", "Noto Serif SC", serif; font-size: 13.5px; line-height: 1.7; color: #6d5b63; }
.dy-body em { display: block; margin-top: 6px; font-style: normal; font-size: 11px; color: #c4a6b2; }
.dy-empty { padding: 40px 20px; text-align: center; font-size: 13px; line-height: 1.8; color: #b896a3; }

/* 详情：一张横线纸 */
html body #diary-detail-page, html body #diary-detail-page > .nav-bar { background: #fff8fa !important; }
html body #diary-detail-scroll-area > div:first-child { background-color: #fff !important; border-radius: 16px !important; box-shadow: 0 1px 2px rgba(120, 80, 95, .06) !important; padding: 18px 20px 14px !important; }
html body #diary-detail-avatar { width: 34px !important; height: 34px !important; }
html body #diary-detail-author { font-size: 14.5px !important; color: #3e3237 !important; }
html body #diary-detail-username { font-size: 11.5px !important; color: #b896a3 !important; }
html body #diary-detail-title { font-size: 18px !important; color: #3e3237 !important; font-family: "Songti SC", "STSong", "Noto Serif SC", serif; line-height: 32px !important; margin: 0 !important; }
html body #diary-detail-content { background-image: repeating-linear-gradient(to bottom, transparent 0, transparent 31px, #f4e3ea 31px, #f4e3ea 32px); background-attachment: local; padding-bottom: 1px; font-family: "Songti SC", "STSong", "Noto Serif SC", serif; font-size: 15.5px !important; line-height: 32px !important; color: #4a3c42 !important; text-align: left !important; white-space: pre-wrap; margin-bottom: 16px !important; }
html body #diary-detail-date { color: #c4a6b2; }
html body #diary-detail-scroll-area .flex-between[style*="border-top"] { border-top-color: #f6e8ee !important; }
html body #diary-detail-scroll-area .flex-between[style*="border-top"] > div { color: #a3476d !important; font-size: 13px !important; border-right-color: #f6e8ee !important; }
html body #diary-detail-scroll-area .flex-between[style*="border-top"] i { display: none; }
html body #diary-ai-comment-btn { background: #3e3237 !important; color: #fff !important; box-shadow: none !important; }

/* ===== 微博关注关系 ===== */
.wbs-btn { border: 1px solid #ff8200; background: #fff; color: #ff8200; border-radius: 15px; padding: 6px 16px; font: inherit; font-size: 13px; cursor: pointer; white-space: nowrap; }
.wbs-btn.sm { padding: 4px 11px; font-size: 12px; }
.wbs-btn.is-on { border-color: #e2e2e2; color: #939393; }
.wbs-btn.is-muted { border-color: #e2e2e2; color: #b0b0b0; background: #f7f7f7; }
.wbs-btn.is-ghost { border-color: #e2e2e2; color: #666; }
.wbs-btn[disabled] { cursor: default; }
.wbs-actions { display: flex; align-items: center; gap: 8px; }
.wbs-tag { font-style: normal; font-size: 11.5px; color: #939393; }
.wbs-note { font-size: 12px; color: #939393; background: #f7f7f7; border-radius: 6px; padding: 8px 10px; line-height: 1.6; }
.wbs-strip { padding: 10px 0 12px; border-bottom: 8px solid #f2f2f2; background: #fff; }
.wbs-strip-h { padding: 0 14px 8px; font-size: 13.5px; color: #333; }
.wbs-strip-row { display: flex; gap: 10px; overflow-x: auto; padding: 0 14px; scrollbar-width: none; }
.wbs-strip-row::-webkit-scrollbar { display: none; }
.wbs-card { position: relative; flex: 0 0 108px; display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 14px 8px 12px; border: 1px solid #f0f0f0; border-radius: 8px; background: #fff; cursor: pointer; }
.wbs-card img { width: 52px; height: 52px; border-radius: 50%; object-fit: cover; background: #f2f2f2; }
.wbs-card strong { max-width: 100%; font-size: 13px; font-weight: 500; color: #333; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wbs-card small { max-width: 100%; font-size: 11px; color: #939393; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-bottom: 4px; }
.wbs-x { position: absolute; top: 2px; right: 4px; border: 0; background: none; color: #c4c4c4; font-size: 15px; cursor: pointer; padding: 2px 4px; }
.wbs-mask { position: absolute; inset: 0; z-index: 2600; background: rgba(0, 0, 0, .28); display: none; align-items: flex-end; }
.wbs-sheet { width: 100%; max-height: 80%; overflow-y: auto; background: #fff; border-radius: 16px 16px 0 0; padding: 8px 16px calc(18px + env(safe-area-inset-bottom)); }
.wbs-grab { width: 36px; height: 4px; border-radius: 2px; background: #e2e2e2; margin: 0 auto 10px; }
.wbs-sheet-h { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.wbs-sheet-h strong { font-size: 16px; color: #333; }
.wbs-sheet-h button { border: 0; background: none; font: inherit; font-size: 13px; color: #939393; cursor: pointer; }
.wbs-row { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid #f5f5f5; cursor: pointer; }
.wbs-row img { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; background: #f2f2f2; flex-shrink: 0; }
.wbs-row-main { flex: 1; min-width: 0; }
.wbs-row-main strong { display: block; font-size: 14px; font-weight: 500; color: #333; }
.wbs-row-main small { display: block; margin-top: 2px; font-size: 11.5px; color: #939393; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wbs-empty { padding: 26px 8px; text-align: center; font-size: 13px; color: #a4a4a4; line-height: 1.7; }
.wbs-foot { padding: 12px 4px 0; font-size: 12px; color: #a4a4a4; text-align: center; }
.wbs-sub-h { margin: 16px 0 4px; font-size: 12.5px; color: #939393; }
.wbs-person { display: flex; align-items: center; gap: 12px; padding: 6px 0 10px; }
.wbs-person img { width: 56px; height: 56px; border-radius: 50%; object-fit: cover; background: #f2f2f2; }
.wbs-person strong { display: block; font-size: 16px; color: #333; }
.wbs-person small { display: block; margin-top: 3px; font-size: 12px; color: #939393; }
.wbs-stats { display: flex; align-items: baseline; gap: 18px; margin-bottom: 12px; font-size: 12px; color: #939393; }
.wbs-stats b { margin-right: 3px; font-size: 15px; color: #333; font-weight: 600; }
.wbs-stats em { font-style: normal; font-size: 11.5px; color: #ff8200; }
.wbs-post { padding: 10px 0; border-bottom: 1px solid #f5f5f5; font-size: 13.5px; line-height: 1.6; color: #333; cursor: pointer; }
.wbs-post small { display: block; margin-top: 4px; font-size: 11px; color: #a4a4a4; }
.wbs-strip-h { display: flex; align-items: center; justify-content: space-between; }
.wbs-strip-tool { border: 0; background: none; font: inherit; font-size: 12px; color: #939393; cursor: pointer; padding: 0; }
.wbs-strip.is-dm { border-bottom: 1px solid #f2f2f2; }
/* 心声：只有一句话 */
.qf-solo { padding: 22px 22px 6px; }
.qf-solo-who { display: flex; align-items: center; gap: 8px; font-size: 12px; color: #b896a3; }
.qf-solo-who img { width: 22px; height: 22px; border-radius: 50%; object-fit: cover; background: #f3e4ea; }
.qf-solo-voice { margin: 14px 2px 4px; font-family: "Songti SC", "STSong", "Noto Serif SC", serif; font-size: 18px; line-height: 1.85; color: #3e3237; }
.qf-solo-voice::before { content: '「'; color: #d4b5c1; }
.qf-solo-voice::after { content: '」'; color: #d4b5c1; }
.qf-solo-empty { margin: 16px 2px 20px; font-size: 13.5px; line-height: 1.7; color: #b896a3; }
.qf-solo .qf-foot { padding: 14px 0 16px; }
/* 日记只看 TA 写的，不再有「我的日记」 */
html body #diary-page > .flex:has(.diary-tab) { display: none !important; }
html body #diary-page #add-diary-btn { display: none !important; }
/* 新建页里已经有两步进度卡了，就不再重复显示那条细进度条 */
.jx-create:has(#story-steps:not([hidden])) #story-create-import-progress { display: none !important; }

/* ===== 生成剧本：单独一整页 ===== */
#story-gen-page { position: absolute; inset: 0; z-index: 2060; display: flex; flex-direction: column; background: #fff5f8; color: #3e3237; font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", sans-serif; }
#story-gen-page[hidden] { display: none !important; }
#story-gen-page .sg-nav { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; padding: max(env(safe-area-inset-top), 44px) 10px 6px; }
#story-gen-page .sg-nav-btn { border: 0; background: none; font: inherit; font-size: 14.5px; color: #a3476d; padding: 6px 8px; cursor: pointer; text-align: left; }
#story-gen-page .sg-nav-btn.r { text-align: right; color: #8a6b78; font-size: 13.5px; }
#story-gen-page .sg-body { flex: 1; overflow-y: auto; padding: 18px 22px calc(30px + env(safe-area-inset-bottom)); }
#story-gen-page .sg-kicker { margin: 0; font-size: 12.5px; color: #b896a3; letter-spacing: .08em; }
#story-gen-page h2 { margin: 6px 0 0; font-family: "Songti SC", "STSong", "Noto Serif SC", serif; font-size: 26px; font-weight: 600; line-height: 1.35; color: #3e3237; word-break: break-word; }
#story-gen-page .sg-clock { display: flex; align-items: baseline; gap: 4px; margin: 18px 0 6px; color: #3e3237; }
#story-gen-page .sg-clock b { font-size: 46px; font-weight: 300; font-variant-numeric: tabular-nums; letter-spacing: -1px; line-height: 1; }
#story-gen-page .sg-clock span { font-size: 14px; color: #b896a3; }
#story-gen-page .story-steps { margin: 18px 0 0 !important; padding: 18px 16px !important; background: #fff !important; border: 0 !important; border-radius: 18px !important; box-shadow: 0 1px 2px rgba(120,80,95,.05); }
#story-gen-page .story-steps-list { flex-direction: column; align-items: stretch; gap: 14px; }
#story-gen-page .story-steps-list li + li::before { display: none; }
#story-gen-page .story-step-body { flex: 1; min-width: 0; }
#story-gen-page .story-step-body small { white-space: normal; }
#story-gen-page .sg-step-time { display: block; margin-top: 3px; font-style: normal; font-size: 11.5px; color: #b896a3; font-variant-numeric: tabular-nums; }
#story-gen-page .story-steps-status { margin-top: 4px; font-size: 13px; line-height: 1.6; color: #7d5a68; }
#story-gen-page .story-steps-preview { white-space: pre-wrap; font-size: 13px; line-height: 1.7; }
#story-gen-page #story-plot-actions { margin-top: 14px; }
#story-gen-page #story-plot-actions[hidden] { display: none !important; }
#story-gen-page .story-steps-actions button { min-height: 44px; font-size: 14px; }
#story-gen-page .sg-tip { margin: 16px 4px 0; font-size: 12px; color: #b896a3; line-height: 1.7; }
#story-gen-page .sg-tip[hidden] { display: none; }
#story-gen-page .story-steps-actions button { background: #fff !important; color: #3e3237 !important; border: 1px solid #ecd9e2 !important; border-radius: 12px !important; }
#story-gen-page .story-steps-actions button:first-child { background: #3e3237 !important; color: #fff !important; border-color: #3e3237 !important; }
#story-gen-page .story-step-dot { width: 28px !important; height: 28px !important; border-radius: 50% !important; display: inline-flex !important; align-items: center; justify-content: center; flex-shrink: 0; font-size: 13px; border: 1.5px solid #dcc3cd !important; background: #fff !important; color: #b896a3 !important; }
#story-gen-page li[data-state="run"] .story-step-dot { border-color: #3e3237 !important; color: #3e3237 !important; animation: sg-pulse 1.4s ease-in-out infinite; }
#story-gen-page li[data-state="done"] .story-step-dot { background: #3e3237 !important; border-color: #3e3237 !important; color: #fff !important; font-size: 0; }
#story-gen-page li[data-state="done"] .story-step-dot::after { content: "✓"; font-size: 13px; }
#story-gen-page li[data-state="fail"] .story-step-dot { border-color: #d98a9f !important; color: #c0485f !important; font-size: 0; }
#story-gen-page li[data-state="fail"] .story-step-dot::after { content: "!"; font-size: 14px; font-weight: 700; }
@keyframes sg-pulse { 50% { box-shadow: 0 0 0 5px rgba(62,50,55,.08); } }
@media (prefers-reduced-motion: reduce) { #story-gen-page li[data-state="run"] .story-step-dot { animation: none; } }

/* ===== 生成页 v2：像在等一本书写完。居中的书名，一条细细的进度线，下面是两步 ===== */
#story-gen-page { background: linear-gradient(180deg, #fff7fa 0%, #fdf1f5 100%) !important; }
#story-gen-page .sg-body { display: flex; flex-direction: column; padding: 0 28px calc(24px + env(safe-area-inset-bottom)) !important; }
#story-gen-page .sg-hero { text-align: center; padding: 9vh 0 34px; }
#story-gen-page .sg-kicker { font-size: 12px !important; letter-spacing: .3em !important; color: #c19aab !important; }
#story-gen-page h2 { margin: 14px 0 0 !important; font-size: 30px !important; font-weight: 500 !important; letter-spacing: .04em; }
#story-gen-page .sg-sub { margin: 12px 0 0; font-size: 12.5px; color: #b896a3; font-variant-numeric: tabular-nums; }
#story-gen-page.is-failed .sg-sub-hint { display: none; }
#story-gen-page .sg-ink { position: relative; width: 120px; height: 2px; margin: 22px auto 0; background: #f0dde5; border-radius: 2px; overflow: hidden; }
#story-gen-page .sg-ink i { position: absolute; top: 0; left: -40%; width: 40%; height: 100%; border-radius: 2px; background: #3e3237; animation: sg-ink 1.8s ease-in-out infinite; }
#story-gen-page.is-failed .sg-ink i { animation: none; left: 0; width: 100%; background: #e6b7c5; }
@keyframes sg-ink { 0% { left: -40%; } 100% { left: 100%; } }
@media (prefers-reduced-motion: reduce) { #story-gen-page .sg-ink i { animation: none; left: 30%; } }

/* 两步：没有卡片，一条竖线串起来 */
#story-gen-page .story-steps { margin: 0 !important; padding: 0 !important; background: none !important; box-shadow: none !important; border-radius: 0 !important; }
#story-gen-page .story-steps-list { position: relative; gap: 22px !important; padding-left: 2px; }
#story-gen-page .story-steps-list::before { content: ''; position: absolute; left: 15px; top: 16px; bottom: 16px; width: 1px; background: #ecd9e2; }
#story-gen-page .story-steps-list li { position: relative; align-items: flex-start !important; gap: 14px !important; }
#story-gen-page .story-step-dot { position: relative; z-index: 1; width: 28px !important; height: 28px !important; font-size: 12px !important; background: #fdf3f6 !important; }
#story-gen-page .story-step-body strong { display: block; font-size: 15px; font-weight: 600; color: #3e3237; padding-top: 4px; }
#story-gen-page li[data-state="wait"] .story-step-body strong { color: #b896a3; font-weight: 500; }
#story-gen-page .story-step-body small { display: block; margin-top: 3px; font-size: 12.5px; color: #a58a95; line-height: 1.55; }
#story-gen-page .sg-step-time { color: #c9adb8 !important; }
#story-gen-page .story-steps-bar { display: none !important; }
#story-gen-page .story-steps-status { display: none; }
#story-gen-page .story-steps.has-fail .story-steps-status { display: block; margin: 22px 0 0 !important; padding: 12px 14px; border-radius: 12px; background: #fbe9ee; color: #9c4a60 !important; font-size: 13px !important; line-height: 1.7; }
#story-gen-page .story-steps-preview { margin: 22px 0 0 !important; padding: 14px 16px !important; background: rgba(255,255,255,.75) !important; border-radius: 14px !important; font-family: "Songti SC", "STSong", "Noto Serif SC", serif; font-size: 13.5px !important; color: #4a3c42; }

/* 按钮：底部一个主按钮 + 一行文字链接 */
#story-gen-page .story-steps-actions, #story-gen-page #story-plot-actions { flex-direction: column; gap: 6px !important; margin-top: 26px !important; }
#story-gen-page .story-steps-actions button { width: 100%; min-height: 48px !important; border-radius: 14px !important; font-size: 15px !important; }
#story-gen-page .story-steps-actions button:not(:first-child) { min-height: 40px !important; background: none !important; border: 0 !important; color: #a3476d !important; font-size: 14px !important; }
#story-gen-page .sg-tip { margin-top: auto !important; padding-top: 30px; text-align: center; }
#story-gen-page li[data-state="done"] .story-step-dot, #story-gen-page li[data-state="fail"] .story-step-dot { font-size: 0 !important; }
#story-gen-page li[data-state="done"] .story-step-dot::after { font-size: 13px; }
#story-gen-page li[data-state="fail"] .story-step-dot::after { font-size: 14px; }

/* ===== 生成页 v3：和「新建剧本」一个手账本：天空壁纸、贴胶带的封面卡、横线纸 ===== */
#story-gen-page { --jx-paper: #fbfcff; --jx-rule: #e4effa; --jx-rose: #e68aae; --jx-rose-deep: #c9658f; --jx-ink: #4b3943; --jx-soft: #8a7480;
  background: linear-gradient(rgba(246, 250, 255, .78), rgba(251, 252, 255, .94) 50%), url("assets/sky/wallpaper.jpg") center top / cover !important; color: var(--jx-ink) !important; }
#story-gen-page .sg-nav { grid-template-columns: 90px 1fr 90px !important; padding: calc(10px + env(safe-area-inset-top, 0px)) 16px 10px !important; background: rgba(251, 252, 255, .72); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); }
#story-gen-page .sg-nav-title { text-align: center; font-size: 17px; font-weight: 600; color: var(--jx-ink); }
#story-gen-page .sg-nav-btn { color: var(--jx-soft) !important; font-size: 14.5px !important; padding: 8px 0 !important; }
#story-gen-page .sg-body { padding: 0 20px calc(24px + env(safe-area-inset-bottom)) !important; }
/* 封面卡：和新建页一模一样的胶带和倾斜 */
#story-gen-page .sg-hero { position: relative; margin: 34px 10px 0; padding: 30px 22px 20px !important; text-align: center; background: #fff; border-radius: 6px; transform: rotate(-1.2deg); box-shadow: 0 1px 0 #eef3fa, 0 14px 30px -12px rgba(77, 120, 170, .35); }
#story-gen-page .sg-hero::before { content: ""; position: absolute; top: -11px; left: 50%; width: 112px; height: 24px; margin-left: -56px; transform: rotate(2.5deg); background: repeating-linear-gradient(45deg, rgba(207, 230, 250, .92) 0 8px, rgba(230, 242, 253, .92) 8px 16px); }
#story-gen-page .sg-hero::after { content: ""; position: absolute; right: 16px; bottom: -9px; width: 38px; height: 16px; transform: rotate(-18deg); background: rgba(248, 200, 220, .85); }
#story-gen-page .sg-kicker { margin: 0 !important; font-size: 12px !important; letter-spacing: .2em !important; color: var(--jx-soft) !important; }
#story-gen-page .sg-title { display: flex; align-items: center; justify-content: center; gap: 2px; margin: 10px 0 0 !important; font-family: "Songti SC", "STSong", "Noto Serif SC", serif; font-size: 26px !important; font-weight: 600 !important; color: var(--jx-ink); }
#story-gen-page .sg-title span { color: var(--jx-rose-deep); font-weight: 400; }
#story-gen-page .sg-title b { font-weight: 600; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#story-gen-page .sg-sub { margin: 10px 0 0 !important; color: var(--jx-soft) !important; }
#story-gen-page .sg-ink { width: 96px !important; margin: 16px auto 0 !important; background: var(--jx-rule) !important; }
#story-gen-page .sg-ink i { background: var(--jx-rose) !important; }
#story-gen-page.is-failed .sg-ink i { background: #f3c4d4 !important; }
/* 横线纸：两步写在纸上 */
#story-gen-page .sg-page { position: relative; margin-top: 30px; padding: 18px 16px 18px 34px; background: var(--jx-paper) repeating-linear-gradient(to bottom, transparent 0 33px, var(--jx-rule) 33px 34px); border: 1px solid var(--jx-rule); border-radius: 4px 14px 14px 14px; box-shadow: 0 10px 26px -14px rgba(77, 120, 170, .3); }
#story-gen-page .sg-page::before { content: ""; position: absolute; top: 0; bottom: 0; left: 20px; width: 1px; background: rgba(230, 138, 174, .45); }
#story-gen-page .story-steps-list::before { display: none !important; }
#story-gen-page .story-step-dot { background: #fff !important; border-color: #cfe0f3 !important; color: #8fb2d6 !important; }
#story-gen-page li[data-state="run"] .story-step-dot { border-color: var(--jx-rose) !important; color: var(--jx-rose-deep) !important; }
#story-gen-page li[data-state="done"] .story-step-dot { background: var(--jx-rose) !important; border-color: var(--jx-rose) !important; }
#story-gen-page li[data-state="fail"] .story-step-dot { border-color: #e9a3b9 !important; color: var(--jx-rose-deep) !important; }
#story-gen-page .story-step-body strong { color: var(--jx-ink) !important; }
#story-gen-page li[data-state="wait"] .story-step-body strong { color: #a9b6c6 !important; }
#story-gen-page .story-step-body small, #story-gen-page .sg-step-time { color: var(--jx-soft) !important; }
/* 出错：一张贴上去的粉色便签 */
#story-gen-page .story-steps.has-fail .story-steps-status { position: relative; margin-top: 22px !important; padding: 14px 14px 12px !important; border-radius: 3px !important; background: #fff0f5 !important; color: #a04a69 !important; transform: rotate(.8deg); box-shadow: 0 6px 14px -10px rgba(201, 101, 143, .6); }
#story-gen-page .story-steps.has-fail .story-steps-status::before { content: ""; position: absolute; top: -8px; left: 22px; width: 44px; height: 14px; transform: rotate(-4deg); background: rgba(207, 230, 250, .9); }
#story-gen-page .story-steps-preview { background: #fff !important; border: 1px solid var(--jx-rule); border-radius: 6px !important; }
/* 按钮：粉色主按钮 + 文字链接，和「生成剧本」那颗一致 */
#story-gen-page .story-steps-actions button:first-child { background: var(--jx-rose) !important; border-color: var(--jx-rose) !important; color: #fff !important; border-radius: 16px !important; min-height: 50px !important; font-size: 16px !important; box-shadow: 0 8px 18px -10px rgba(201, 101, 143, .8); }
#story-gen-page .story-steps-actions button:not(:first-child) { color: var(--jx-soft) !important; }
#story-gen-page .sg-tip { color: var(--jx-soft) !important; }
/* 重试按钮：墨色实心、无阴影、带一个小小的重来箭头；粉色只留给封面和胶带 */
#story-gen-page .story-steps-actions button:first-child { position: relative; display: flex; align-items: center; justify-content: center; gap: 8px; min-height: 50px !important; border-radius: 12px !important; background: #3e3237 !important; border: 0 !important; color: #fff !important; font-size: 15.5px !important; font-weight: 500; letter-spacing: .12em; box-shadow: none !important; transition: background .15s, transform .15s; }
#story-gen-page .story-steps-actions button:first-child::before { content: ""; width: 16px; height: 16px; flex-shrink: 0; background: no-repeat center / contain url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23fff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 11a8 8 0 1 0-2.3 5.7'/%3E%3Cpath d='M20 4v7h-7'/%3E%3C/svg%3E"); }
#story-gen-page .story-steps-actions button:first-child:active { background: #2c2327 !important; transform: scale(.985); }
#story-gen-page .story-steps-actions button:not(:first-child) { color: #7d6f76 !important; letter-spacing: .04em; }
#story-gen-page .story-steps-actions button:not(:first-child):active { color: #3e3237 !important; }
/* 每发一次就是一回合：中间一条小分隔「第 N 回合」，下面是你发出去的那句 */
.is-reading .sx-round, .sx-live-wrap .sx-round { display: flex; align-items: center; gap: 10px; margin: 18px 0 10px; font-size: 11px; color: #c4a6b2; letter-spacing: .12em; font-family: -apple-system, "PingFang SC", sans-serif; }
.is-reading .sx-round::before, .is-reading .sx-round::after, .sx-live-wrap .sx-round::before, .sx-live-wrap .sx-round::after { content: ''; flex: 1; height: 1px; background: #f0dde5; }
.sx-live-wrap { display: flex; flex-direction: column; }
.is-reading .sx-me, .sx-me-live { background: #3e3237 !important; color: #fff !important; border-radius: 14px 14px 4px 14px !important; padding: 8px 13px !important; font-size: 14px !important; line-height: 1.6; }
.is-reading .sx-me::before, .sx-me-live::before { color: rgba(255,255,255,.55) !important; }
.is-reading .sx-turn.has-sep { border-top: 0 !important; }
/* 回合之间已经有「第 N 回合」分隔了，原来的「· · ·」不要 */
.is-reading .sx-turn.has-sep::before { content: none !important; }
.is-reading .sx-turn.has-sep { margin-top: 6px !important; padding-top: 0 !important; }
/* 你发的那句：轻一点，不加「你」，像一行淡淡的引用 */
.is-reading .sx-me, .sx-me-live { background: transparent !important; color: #8a7480 !important; border: 0 !important; border-right: 2px solid #e9cdd8 !important; border-radius: 0 !important; padding: 2px 10px 2px 0 !important; font-size: 13.5px !important; line-height: 1.7 !important; text-align: right; box-shadow: none !important; }
.is-reading .sx-me::before, .sx-me-live::before { content: none !important; display: none !important; }

/* 批注：收在笔里；有批注时笔右上角一个小数字 */
html body .sx-panel .sx-note-bar { display: none !important; }
html body .sx-panel .sx-note-btn { position: relative; }
html body .sx-panel .sx-note-btn[data-count]:not([data-count=""])::after { content: attr(data-count); position: absolute; top: -5px; right: -5px; min-width: 16px; height: 16px; padding: 0 4px; box-sizing: border-box; border-radius: 8px; background: #3e3237; color: #fff; font-size: 10px; line-height: 16px; text-align: center; font-family: -apple-system, sans-serif; }
/* 批注面板里的「加上」：墨色实心 */
html body .sx-panel [data-note-add] { display: block !important; width: calc(100% - 32px) !important; margin: 12px 16px 4px !important; min-height: 46px !important; padding: 0 !important; border: 0 !important; border-radius: 12px !important; background: #3e3237 !important; color: #fff !important; font-size: 15px !important; font-weight: 500; letter-spacing: .1em; box-shadow: none !important; }
html body .sx-panel [data-note-add]:active { background: #2c2327 !important; }
/* 剧情还很短（或者还没有）时，输入栏贴在屏幕底部，不顶在上面 */
html body .phone-frame > .sx-panel.selector-overlay:has(.story-create-sheet [data-content]) > .story-create-sheet.is-reading { display: flex !important; flex-direction: column !important; }
html body .phone-frame > .sx-panel.selector-overlay:has(.story-create-sheet [data-content]) > .story-create-sheet.is-reading > .sx-head { flex-shrink: 0; }
html body .phone-frame > .sx-panel.selector-overlay:has(.story-create-sheet [data-content]) > .story-create-sheet.is-reading > [data-content] { flex: 1 0 auto !important; display: flex !important; flex-direction: column !important; }
html body .phone-frame > .sx-panel.selector-overlay:has(.story-create-sheet [data-content]) > .story-create-sheet.is-reading .sx-composer { margin-top: auto !important; }
.is-reading .sx-turns:empty { display: none !important; }
