: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;
}

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;
  border-radius: 999px;
  color: #ffffff;
  background: linear-gradient(135deg, #28a8e3, #75cee4);
  font-size: 14px;
}

h1 span {
  color: #6b55dc;
}

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: min(420px, 100%);
  min-height: 46px;
  padding: 0 14px;
  border: 1px solid rgba(100, 115, 153, 0.22);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.66);
  color: var(--ink);
  font: inherit;
  font-weight: 800;
  outline: none;
  box-shadow: 0 10px 22px rgba(70, 94, 143, 0.08);
  transition:
    border-color 160ms ease,
    box-shadow 160ms ease,
    background 160ms ease;
}

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

.step-copy {
  display: grid;
  gap: 8px;
}

.element-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
}

.element-grid label {
  position: relative;
  display: grid;
  min-height: 46px;
  place-items: center;
  border: 1px solid rgba(100, 115, 153, 0.22);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.48);
  color: var(--ink);
  cursor: pointer;
  text-align: center;
  box-shadow: 0 10px 22px rgba(70, 94, 143, 0.08);
  transition:
    background 160ms ease,
    color 160ms ease,
    border-color 160ms ease,
    transform 160ms ease,
    box-shadow 160ms ease;
}

.element-grid input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.element-grid span {
  font-size: 14px;
  font-weight: 800;
}

.element-grid label:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 28px rgba(70, 94, 143, 0.12);
}

.element-grid label:has(input:checked) {
  border-color: rgba(255, 255, 255, 0.62);
  background: linear-gradient(135deg, #28a8e3, #75cee4);
  color: #ffffff;
  box-shadow: 0 14px 28px rgba(40, 168, 227, 0.22);
}

textarea {
  width: 100%;
  min-height: 108px;
  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;
}

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

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

.topic-list {
  display: grid;
  gap: 12px;
  margin: 18px 0 0;
  padding: 0;
  list-style: none;
}

.topic-card {
  position: relative;
  isolation: isolate;
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  overflow: hidden;
  padding: 14px;
  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);
}

.topic-card::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 180ms ease;
  animation: topicBorderFlow 2.2s linear infinite;
  -webkit-mask:
    linear-gradient(#000 0 0) content-box,
    linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
}

.topic-card:hover::before,
.topic-card:focus-within::before {
  opacity: 1;
}

.topic-content {
  min-width: 0;
}

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

.topic-card strong {
  display: block;
  margin-bottom: 8px;
  color: var(--ink);
  font-size: 16px;
  line-height: 1.45;
}

.topic-card p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.55;
}

.topic-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
  opacity: 0;
  transform: translateX(8px);
  pointer-events: none;
  transition:
    opacity 180ms ease,
    transform 180ms ease;
}

.topic-card:hover .topic-actions,
.topic-card:focus-within .topic-actions {
  opacity: 1;
  transform: translateX(0);
  pointer-events: auto;
}

.topic-action-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  padding: 0 13px;
  border: 1px solid rgba(80, 103, 146, 0.18);
  border-radius: var(--radius);
  color: #263764;
  background: rgba(255, 255, 255, 0.72);
  box-shadow: 0 8px 18px rgba(48, 69, 115, 0.1);
  font: 900 13px/1 "Microsoft YaHei", "PingFang SC", Arial, sans-serif;
  white-space: nowrap;
  cursor: pointer;
  transition: transform 160ms ease, box-shadow 160ms ease, background 160ms ease, color 160ms ease;
}

.topic-action-button:hover,
.topic-action-button:focus-visible {
  color: #ffffff;
  background: #5e6fe8;
  transform: translateY(-1px);
  box-shadow: 0 12px 24px rgba(77, 96, 216, 0.22);
  outline: none;
}

.topic-action-button.primary {
  color: #ffffff;
  border-color: rgba(40, 168, 227, 0.32);
  background: #28a8e3;
  box-shadow: 0 12px 24px rgba(40, 168, 227, 0.22);
}

.topic-action-button.primary:hover,
.topic-action-button.primary:focus-visible {
  background: #178fca;
}

.topic-loading-card {
  min-height: 108px;
  grid-template-columns: 36px minmax(0, 1fr) auto;
  overflow: hidden;
}

.topic-loading-card::before {
  display: none;
}

.topic-loading-visual {
  position: relative;
  display: grid;
  gap: 7px;
  min-height: 76px;
  overflow: hidden;
  padding: 10px 12px;
  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);
}

.topic-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: 8px;
  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%;
}

.topic-loading-status {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 86px;
  min-height: 36px;
  border: 1px solid rgba(80, 103, 146, 0.16);
  border-radius: var(--radius);
  color: var(--primary);
  background: rgba(255, 255, 255, 0.72);
  font-size: 13px;
  font-weight: 900;
}

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

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

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

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

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

.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 {
    flex-direction: column;
  }

  .element-grid {
    grid-template-columns: 1fr;
  }

  .topic-card {
    grid-template-columns: 32px minmax(0, 1fr);
  }

  .topic-actions {
    grid-column: 1 / -1;
    justify-content: flex-start;
    opacity: 1;
    transform: none;
    pointer-events: auto;
  }

  .topic-loading-card {
    grid-template-columns: 32px minmax(0, 1fr);
  }

  .topic-loading-status {
    grid-column: 1 / -1;
    justify-content: flex-start;
    width: 100%;
    padding: 0 13px;
  }

  .topic-action-button {
    flex: 1 1 0;
  }
}

@media (min-width: 621px) and (max-width: 980px) {
  .element-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}
