:root {
  --ink: #101c46;
  --muted: #60708f;
  --line: rgba(80, 103, 146, 0.18);
  --panel: rgba(255, 255, 255, 0.72);
  --primary: #5e6fe8;
  --shadow: 0 18px 52px rgba(70, 94, 143, 0.16);
  --radius: 8px;
}

* {
  box-sizing: border-box;
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  font-family: "Microsoft YaHei", "PingFang SC", Arial, sans-serif;
  background:
    linear-gradient(115deg, rgba(244, 248, 255, 0.96), rgba(232, 246, 250, 0.9) 48%, rgba(248, 245, 255, 0.92)),
    url("Page%201.jpg") center / cover no-repeat fixed;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -2;
  background: rgba(248, 251, 255, 0.7);
  backdrop-filter: blur(18px) saturate(0.9);
}

body::after {
  content: "";
  position: fixed;
  left: -8vw;
  right: -8vw;
  bottom: -18vh;
  z-index: -1;
  height: 38vh;
  background:
    radial-gradient(65% 110% at 65% 18%, rgba(135, 119, 232, 0.28), transparent 52%),
    linear-gradient(180deg, rgba(255, 255, 255, 0), rgba(255, 255, 255, 0.9));
  border-radius: 50% 50% 0 0;
}

.shell {
  width: min(1180px, calc(100vw - 48px));
  margin: 0 auto;
  padding: 72px 0;
}

.panel,
.tool-panel,
.result-panel {
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow: var(--shadow);
  backdrop-filter: blur(22px);
}

.page-header,
.result-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
}

.page-header {
  margin-bottom: 26px;
}

.eyebrow {
  margin: 0 0 8px;
  color: #51627f;
  font-size: 13px;
  font-weight: 800;
}

h1 {
  margin: 0;
  color: var(--ink);
  font-size: clamp(34px, 4vw, 52px);
  line-height: 1.18;
}

h1 span {
  color: #6b55dc;
}

h2,
h3 {
  margin: 0;
  color: var(--ink);
  letter-spacing: 0;
}

h2 {
  font-size: 22px;
  line-height: 1.2;
}

h3 {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 16px;
  line-height: 1.35;
}

h3 span {
  display: grid;
  width: 26px;
  height: 26px;
  place-items: center;
  flex: 0 0 26px;
  border-radius: 999px;
  color: #ffffff;
  background: linear-gradient(135deg, #28a8e3, #75cee4);
  font-size: 14px;
}

p {
  max-width: 680px;
  margin: 16px 0 0;
  color: #263764;
  font-size: 16px;
  line-height: 1.7;
  font-weight: 700;
}

.ghost-link,
.back-link,
.ghost-button,
.primary-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 0 16px;
  border: 0;
  border-radius: var(--radius);
  cursor: pointer;
  font: inherit;
  font-weight: 800;
  text-decoration: none;
  transition:
    background 160ms ease,
    color 160ms ease,
    transform 160ms ease,
    box-shadow 160ms ease;
}

.primary-action,
.back-link {
  color: #ffffff;
  background: var(--primary);
  box-shadow: 0 10px 22px rgba(77, 96, 216, 0.26);
}

.ghost-link,
.ghost-button {
  color: #263764;
  background: rgba(255, 255, 255, 0.58);
  border: 1px solid rgba(80, 103, 146, 0.18);
  box-shadow: 0 14px 34px rgba(48, 69, 115, 0.12);
}

.ghost-link:hover,
.ghost-button:hover,
.primary-action:hover,
.back-link:hover {
  color: #ffffff;
  background: #4f60d7;
  transform: translateY(-2px);
  box-shadow: 0 14px 28px rgba(77, 96, 216, 0.32);
}

.tool-panel {
  display: grid;
  gap: 22px;
}

.panel-title {
  display: grid;
  gap: 8px;
}

.panel-title p,
.muted,
.hint {
  max-width: none;
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.65;
  font-weight: 700;
}

.muted a {
  color: var(--primary);
  font-weight: 800;
}

.step-block {
  display: grid;
  gap: 12px;
}

.persona-select {
  width: 100%;
  min-height: 48px;
  padding: 0 14px;
  border: 1px solid rgba(100, 93, 221, 0.34);
  border-radius: var(--radius);
  outline: none;
  background: rgba(255, 255, 255, 0.58);
  color: var(--ink);
  font: 800 15px/1.45 "Microsoft YaHei", "PingFang SC", Arial, sans-serif;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.52);
}

.persona-select:focus {
  border-color: rgba(94, 111, 232, 0.74);
  background: rgba(255, 255, 255, 0.86);
  box-shadow: 0 0 0 4px rgba(94, 111, 232, 0.13);
}

textarea {
  width: 100%;
  min-height: 118px;
  resize: vertical;
  padding: 16px;
  border: 1px solid rgba(100, 93, 221, 0.34);
  border-radius: var(--radius);
  outline: none;
  background: rgba(255, 255, 255, 0.58);
  color: var(--ink);
  font: 600 15px/1.65 "Microsoft YaHei", "PingFang SC", Arial, sans-serif;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.52);
}

textarea:focus {
  border-color: rgba(94, 111, 232, 0.74);
  background: rgba(255, 255, 255, 0.86);
  box-shadow: 0 0 0 4px rgba(94, 111, 232, 0.13);
}

textarea::placeholder {
  color: #96a3bb;
}

.large-textarea {
  min-height: 150px;
}

.submit-row {
  display: grid;
  grid-template-columns: minmax(150px, 190px) minmax(0, 1fr);
  gap: 12px;
  align-items: end;
}

.count-field {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 900;
}

.count-field select {
  width: 100%;
  min-height: 52px;
  padding: 0 14px;
  border: 1px solid rgba(100, 93, 221, 0.34);
  border-radius: var(--radius);
  outline: none;
  background: rgba(255, 255, 255, 0.58);
  color: var(--ink);
  font: 900 15px/1.45 "Microsoft YaHei", "PingFang SC", Arial, sans-serif;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.52);
}

.count-field select:focus {
  border-color: rgba(94, 111, 232, 0.74);
  background: rgba(255, 255, 255, 0.86);
  box-shadow: 0 0 0 4px rgba(94, 111, 232, 0.13);
}

.primary-action {
  width: 100%;
  min-height: 52px;
  font-size: 16px;
}

.qa-submit-button {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  border: 1px solid transparent;
}

.qa-submit-button::before {
  content: "";
  position: absolute;
  inset: -2px;
  z-index: -1;
  padding: 2px;
  border-radius: inherit;
  background: conic-gradient(
    from 0deg,
    rgba(40, 168, 227, 0),
    rgba(40, 168, 227, 0.95),
    rgba(94, 111, 232, 0.95),
    rgba(117, 206, 228, 0.95),
    rgba(40, 168, 227, 0)
  );
  opacity: 0;
  pointer-events: none;
  transform: rotate(0turn);
  transition: opacity 160ms ease;
  animation: qaButtonBorderFlow 1.8s linear infinite;
  -webkit-mask:
    linear-gradient(#000 0 0) content-box,
    linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
}

.qa-submit-button:hover,
.qa-submit-button:focus-visible {
  color: #101c46;
  background: #ffffff;
  transform: translateY(-2px) scale(1.015);
  box-shadow:
    0 16px 30px rgba(77, 96, 216, 0.24),
    0 0 22px rgba(40, 168, 227, 0.26);
}

.qa-submit-button:hover::before,
.qa-submit-button:focus-visible::before {
  opacity: 1;
}

.qa-submit-button:disabled::before {
  opacity: 0;
}

.result-panel {
  margin-top: 22px;
}

.script-list {
  display: grid;
  gap: 14px;
  margin-top: 18px;
}

.script-card {
  display: grid;
  gap: 12px;
  padding: 16px;
  border: 1px solid rgba(80, 103, 146, 0.16);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.84);
  box-shadow: 0 12px 28px rgba(70, 94, 143, 0.09);
}

.script-card header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.script-title-wrap {
  display: grid;
  gap: 8px;
  min-width: 0;
}

.script-card-actions {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 8px;
}

.script-icon-button {
  display: inline-grid;
  place-items: center;
  width: 34px;
  height: 34px;
  padding: 0;
  border: 1px solid rgba(80, 103, 146, 0.2);
  border-radius: var(--radius);
  color: #344054;
  background: rgba(255, 255, 255, 0.7);
  cursor: pointer;
  transition:
    background 160ms ease,
    border-color 160ms ease,
    color 160ms ease,
    transform 160ms ease,
    box-shadow 160ms ease;
}

.script-icon-button svg {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.script-icon-button:hover,
.script-icon-button:focus-visible,
.script-icon-button.is-active,
.script-icon-button.is-favorited {
  color: #ffffff;
  background: #4f60d7;
  border-color: #4f60d7;
  transform: translateY(-1px);
  box-shadow: 0 10px 22px rgba(77, 96, 216, 0.22);
  outline: none;
}

.script-icon-button.is-favorited svg {
  fill: currentColor;
}

.script-card h3 {
  display: block;
  font-size: 18px;
}

.script-tag {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  color: #ffffff;
  background: linear-gradient(135deg, #8f6bea, #75cee4);
  font-size: 12px;
  font-weight: 900;
  white-space: nowrap;
}

.script-body {
  display: grid;
  gap: 10px;
}

.script-body p {
  max-width: none;
  margin: 0;
  color: #263764;
  font-size: 15px;
  line-height: 1.75;
  font-weight: 700;
}

.script-loading-card {
  overflow: hidden;
}

.script-loading-visual {
  position: relative;
  display: grid;
  gap: 7px;
  min-height: 118px;
  overflow: hidden;
  padding: 14px;
  border: 1px solid rgba(40, 168, 227, 0.18);
  border-radius: var(--radius);
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.78), rgba(235, 248, 255, 0.7)),
    repeating-linear-gradient(0deg, rgba(40, 168, 227, 0.07) 0 1px, transparent 1px 10px);
}

.script-loading-visual::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(94, 111, 232, 0.18), transparent);
  transform: translateX(-100%);
  animation: loadingSweep 1.7s ease-in-out infinite;
}

.data-row {
  position: relative;
  height: 9px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(80, 103, 146, 0.1);
}

.data-row::before {
  content: "010011 101100 011010 110101 001101 101011 010110 110010";
  position: absolute;
  top: 50%;
  left: 0;
  min-width: 200%;
  color: rgba(40, 168, 227, 0.82);
  font: 900 10px/1 "Consolas", "Microsoft YaHei", monospace;
  letter-spacing: 1px;
  white-space: nowrap;
  transform: translateY(-50%);
  animation: dataStream 2.4s linear infinite;
}

.row-b::before,
.row-d::before {
  animation-duration: 3s;
  animation-direction: reverse;
  color: rgba(94, 111, 232, 0.72);
}

.row-a {
  width: 92%;
}

.row-b {
  width: 76%;
}

.row-c {
  width: 100%;
}

.row-d {
  width: 84%;
}

.row-e {
  width: 66%;
}

@keyframes dataStream {
  from {
    transform: translate(-48%, -50%);
  }

  to {
    transform: translate(0, -50%);
  }
}

@keyframes loadingSweep {
  0% {
    transform: translateX(-100%);
  }

  55%,
  100% {
    transform: translateX(100%);
  }
}

@keyframes qaButtonBorderFlow {
  to {
    transform: rotate(1turn);
  }
}

.qa-card {
  gap: 16px;
}

.qa-card-head {
  align-items: flex-start;
}

.qa-card-subtitle {
  max-width: none;
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.55;
  font-weight: 800;
}

.qa-body {
  display: grid;
  gap: 18px;
  padding: 18px;
  border: 1px solid rgba(80, 103, 146, 0.12);
  border-radius: var(--radius);
  background: rgba(38, 55, 100, 0.08);
}

.qa-body p {
  max-width: none;
  margin: 0;
  color: #1f2e56;
  font-size: 15px;
  line-height: 1.74;
  font-weight: 800;
}

.qa-body strong {
  color: #101c46;
  font-weight: 900;
}

.qa-card-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.qa-action-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 16px;
  border: 1px solid rgba(80, 103, 146, 0.22);
  border-radius: var(--radius);
  color: #263764;
  background: rgba(255, 255, 255, 0.64);
  cursor: pointer;
  font: 900 14px/1 "Microsoft YaHei", "PingFang SC", Arial, sans-serif;
  transition:
    background 160ms ease,
    color 160ms ease,
    transform 160ms ease,
    box-shadow 160ms ease;
}

.qa-action-button:hover,
.qa-action-button.is-favorited {
  color: #ffffff;
  background: #4f60d7;
  transform: translateY(-1px);
  box-shadow: 0 10px 22px rgba(77, 96, 216, 0.22);
}

.storyboard-list {
  display: grid;
  gap: 14px;
  margin-top: 18px;
}

.storyboard-card {
  display: grid;
  gap: 14px;
  padding: 16px;
  border: 1px solid rgba(80, 103, 146, 0.16);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.84);
  box-shadow: 0 12px 28px rgba(70, 94, 143, 0.09);
}

.storyboard-card header {
  display: flex;
  align-items: center;
  gap: 12px;
}

.storyboard-number {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: var(--radius);
  color: #ffffff;
  background: linear-gradient(135deg, #8f6bea, #75cee4);
  font-size: 13px;
  font-weight: 900;
}

.storyboard-card h3 {
  display: block;
  font-size: 18px;
}

.storyboard-card dl {
  display: grid;
  gap: 10px;
  margin: 0;
}

.storyboard-card dl div {
  display: grid;
  grid-template-columns: 86px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
}

.storyboard-card dt,
.storyboard-card dd {
  margin: 0;
  font-size: 15px;
  line-height: 1.65;
  font-weight: 700;
}

.storyboard-card dt {
  color: #51627f;
}

.storyboard-card dd {
  color: #263764;
}

.storyboard-guide {
  display: grid;
  gap: 12px;
  margin-top: 18px;
  padding: 18px;
  border: 1px solid rgba(80, 103, 146, 0.16);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.84);
  box-shadow: 0 12px 28px rgba(70, 94, 143, 0.09);
}

.storyboard-guide[hidden] {
  display: none;
}

.storyboard-guide h3 {
  display: block;
  margin: 0;
  color: var(--ink);
  font-size: 18px;
}

.storyboard-guide ul {
  display: grid;
  gap: 10px;
  margin: 0;
  padding-left: 20px;
  color: #263764;
}

.storyboard-guide li {
  font-size: 15px;
  line-height: 1.7;
  font-weight: 700;
}

.empty-state {
  display: grid;
  gap: 8px;
  min-height: 220px;
  align-content: center;
  justify-items: center;
  padding: 24px;
  border: 1px dashed rgba(100, 115, 153, 0.28);
  border-radius: var(--radius);
  background: rgba(244, 248, 255, 0.68);
  color: var(--muted);
  text-align: center;
}

.empty-state strong {
  color: var(--ink);
  font-size: 18px;
}

.empty-state span {
  max-width: 520px;
  line-height: 1.6;
}

@media (max-width: 620px) {
  .shell {
    width: min(100% - 28px, 980px);
    padding: 48px 0;
  }

  .panel,
  .tool-panel,
  .result-panel {
    padding: 20px;
  }

  .page-header,
  .result-header,
  .script-card header {
    flex-direction: column;
  }

  .script-card header {
    align-items: flex-start;
  }

  .script-card-actions {
    width: 100%;
    justify-content: flex-start;
  }

  .ghost-link,
  .ghost-button {
    width: 100%;
  }

  .submit-row {
    grid-template-columns: 1fr;
  }

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

  .storyboard-card header,
  .storyboard-card dl div {
    grid-template-columns: 1fr;
  }

  .storyboard-card header {
    flex-direction: column;
    align-items: flex-start;
  }
}
