.script-reader-overlay[hidden],
.script-reader [hidden] { display: none !important; }
.script-reader-overlay {
  position: fixed;
  z-index: 400;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 20px;
  background: #0000003d;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  overscroll-behavior: contain;
}
.script-reader {
  display: flex;
  flex-direction: column;
  width: min(1100px, calc(100vw - 40px));
  height: min(900px, calc(100vh - 40px));
  height: min(900px, calc(100dvh - 40px));
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  border: 1px solid #ffffffb3;
  border-radius: 28px;
  background: #fff;
  color: #1d1d1f;
  box-shadow: 0 24px 90px #00000029;
  text-align: left;
}
.script-reader-header {
  display: flex;
  flex: 0 0 auto;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  padding: 28px 30px 20px;
}
.script-reader-heading { min-width: 0; }
.script-reader-eyebrow {
  display: block;
  margin-bottom: 9px;
  color: #6e6e73;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 1px;
}
.script-reader-title {
  margin: 0;
  font-size: clamp(23px, 2.2vw, 32px);
  font-weight: 650;
  line-height: 1.3;
  letter-spacing: -.7px;
  overflow-wrap: anywhere;
}
.script-reader-metadata {
  margin: 9px 0 0;
  color: #6e6e73;
  font-size: 12px;
  line-height: 1.7;
  overflow-wrap: anywhere;
}
.script-reader-close {
  display: grid;
  flex: 0 0 34px;
  place-items: center;
  width: 34px;
  height: 34px;
  padding: 0 0 2px;
  border: 0;
  border-radius: 50%;
  background: #f0f0f2;
  color: #6e6e73;
  font-size: 26px;
  font-weight: 300;
  line-height: 1;
}
.script-reader-close:hover { background: #e7e7eb; color: #1d1d1f; }
.script-reader-toolbar {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 53px;
  padding: 0 30px 15px;
  border-bottom: 1px solid #e8e8ed;
}
.script-reader-tools { display: flex; flex-wrap: wrap; min-width: 0; gap: 9px; }
.script-reader-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  padding: 7px 15px;
  border: 0;
  border-radius: 18px;
  background: #f0f0f2;
  color: #1d1d1f;
  font-size: 12px;
  font-weight: 500;
  line-height: 20px;
  text-decoration: none;
  white-space: nowrap;
}
.script-reader-button:hover { background: #e8e8ed; text-decoration: none; }
.script-reader-download { background: #0071e3; color: #fff; }
.script-reader-download:hover { background: #0077ed; }
.script-reader-feedback { color: #6e6e73; font-size: 11px; line-height: 1.6; overflow-wrap: anywhere; }
.script-reader-body {
  position: relative;
  flex: 1 1 auto;
  min-width: 0;
  min-height: 0;
  overflow: auto;
  overscroll-behavior: contain;
  background: #fafafa;
  scrollbar-width: thin;
  scrollbar-color: #d2d2d7 transparent;
}
.script-reader-body-text { padding: 32px clamp(22px, 4vw, 58px) 50px; }
.script-reader-text {
  max-width: 880px;
  margin: 0 auto;
  padding: 0;
  border: 0;
  background: transparent;
  color: #29292c;
  font-family: var(--font, "PingFang SC", "Microsoft YaHei", sans-serif);
  font-size: 16px;
  font-weight: 400;
  line-height: 1.95;
  tab-size: 4;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  user-select: text;
  -webkit-user-select: text;
}
.script-reader-body-pdf { overflow: auto; background: #e8e8ed; }
.script-reader-body-word { overflow: hidden; background: #e8e8ed; }
.script-reader-word-frame { display: block; width: 100%; height: 100%; border: 0; background: #e8e8ed; }
.script-reader-pdf-pages { display: grid; gap: 24px; width: 100%; min-width: 0; padding: 20px 26px 34px; }
.script-reader-pdf-page { width: min(860px, 100%); min-width: 0; margin: 0 auto; }
.script-reader-pdf-label { display: flex; justify-content: space-between; gap: 12px; padding: 0 2px 9px; color: #6e6e73; font-size: 11px; line-height: 1.5; }
.script-reader-pdf-page-status { color: #86868b; }
.script-reader-pdf-sheet { position: relative; width: 100%; min-width: 0; overflow: hidden; background: #fff; box-shadow: 0 2px 12px #00000012; }
.script-reader-pdf-canvas { display: block; width: 100%; height: 100%; }
.script-reader-pdf-placeholder { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 16px; padding: 24px; color: #86868b; font-size: 13px; text-align: center; overflow-wrap: anywhere; }
.script-reader-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100%;
  padding: 35px;
  text-align: center;
}
.script-reader-state-symbol {
  display: grid;
  place-items: center;
  width: 50px;
  height: 50px;
  margin-bottom: 17px;
  border-radius: 15px;
  background: #edf4fc;
  color: #0071e3;
  font-size: 30px;
  line-height: 1;
}
.script-reader-state-error .script-reader-state-symbol { background: #f9eded; color: #b3261e; }
.script-reader-state h3 { margin: 0; color: #1d1d1f; font-size: 19px; font-weight: 600; }
.script-reader-state p { max-width: 470px; margin: 10px 0 0; color: #6e6e73; font-size: 13px; line-height: 1.9; overflow-wrap: anywhere; }
.script-reader-footer {
  flex: 0 0 auto;
  min-height: 43px;
  padding: 12px 30px;
  border-top: 1px solid #e8e8ed;
  background: #fff;
  color: #86868b;
  font-size: 11px;
  line-height: 1.7;
  overflow-wrap: anywhere;
}
.script-reader-footer:empty { display: none; }
.script-reader button:focus-visible,
.script-reader a:focus-visible,
.script-reader-body:focus-visible { outline: 3px solid #2997ff; outline-offset: 3px; }
.script-reader-body:focus-visible { outline-offset: -4px; }
@media (max-width: 600px) {
  .script-reader-overlay { padding: 12px; }
  .script-reader {
    width: calc(100vw - 24px);
    height: calc(100vh - 24px);
    height: calc(100dvh - 24px);
    border-radius: 23px;
  }
  .script-reader-header { gap: 14px; padding: 22px 20px 17px; }
  .script-reader-title { font-size: 23px; letter-spacing: -.5px; }
  .script-reader-eyebrow { font-size: 10px; }
  .script-reader-metadata { font-size: 11px; }
  .script-reader-toolbar { flex-wrap: wrap; justify-content: flex-start; gap: 8px; padding: 0 20px 14px; }
  .script-reader-feedback:empty { display: none; }
  .script-reader-body-text { padding: 24px 20px 36px; }
  .script-reader-text { font-size: 15px; line-height: 1.9; }
  .script-reader-footer { padding: 10px 20px calc(10px + env(safe-area-inset-bottom)); font-size: 10px; }
  .script-reader-state { padding: 24px; }
  .script-reader-pdf-pages { gap: 18px; padding: 15px 12px 24px; }
  .script-reader-pdf-label { font-size: 10px; }
}
