* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: "Montserrat", -apple-system, BlinkMacSystemFont, sans-serif;
  background: linear-gradient(135deg, #0a0a1a 0%, #1a1a3e 50%, #0d0d2b 100%);
  color: #e8e8f0;
  min-height: 100vh;
  line-height: 1.55;
}

.wrap { max-width: 860px; margin: 0 auto; padding: 0 24px; }

header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: rgba(10, 10, 26, 0.88);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid rgba(138, 99, 255, 0.12);
}

.header-inner {
  min-height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo {
  color: #fff;
  font-weight: 700;
  text-decoration: none;
}

.back {
  color: #b7b7d8;
  text-decoration: none;
  font-size: 14px;
}

.back:hover { color: #8a63ff; }

.hero {
  padding: 48px 0 20px;
  text-align: center;
}

.hero h1 {
  font-size: clamp(28px, 4vw, 42px);
  margin-bottom: 12px;
  background: linear-gradient(135deg, #ffffff 0%, #d8ccff 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero p {
  color: #a8a8c0;
  font-size: 16px;
}

.panel {
  border: 1px solid rgba(138, 99, 255, 0.18);
  border-radius: 16px;
  background: linear-gradient(180deg, rgba(32, 32, 64, 0.65), rgba(18, 18, 44, 0.65));
  padding: 22px;
  margin-bottom: 40px;
}

.drop {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 120px;
  border: 1.5px dashed rgba(138, 99, 255, 0.35);
  border-radius: 12px;
  padding: 20px;
  text-align: center;
  cursor: pointer;
  color: #c8c8e0;
  margin-bottom: 18px;
  transition: border-color .15s, background .15s;
}

.drop.drag {
  border-color: #8a63ff;
  background: rgba(138, 99, 255, 0.08);
}

.drop input { display: none; }

fieldset {
  border: none;
  margin: 0 0 16px;
}

legend {
  font-size: 13px;
  color: #9a9ab8;
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.radio, .check {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin: 8px 0;
  font-size: 15px;
  cursor: pointer;
}

.radio .muted, .check .muted {
  color: #8f8faf;
  font-size: 13px;
  font-weight: 400;
}

.scale {
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 13px;
  color: #9a9ab8;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 18px;
}

.scale select {
  font: inherit;
  text-transform: none;
  letter-spacing: normal;
  color: #e8e8f0;
  background: rgba(10, 10, 26, 0.7);
  border: 1px solid rgba(138, 99, 255, 0.25);
  border-radius: 10px;
  padding: 10px 12px;
}

button[type="submit"] {
  width: 100%;
  border: none;
  border-radius: 12px;
  padding: 14px 18px;
  font: inherit;
  font-weight: 600;
  color: #fff;
  background: linear-gradient(135deg, #7b4dff, #5a2fd6);
  cursor: pointer;
}

button[type="submit"]:disabled {
  opacity: 0.55;
  cursor: wait;
}

button[type="submit"]:hover:not(:disabled) {
  filter: brightness(1.06);
}

.status {
  margin-top: 14px;
  font-size: 14px;
  color: #c8c8e0;
}

.status.error { color: #ff8f8f; }
.status.ok { color: #9dffb0; }

.hint {
  margin-top: 14px;
  font-size: 13px;
  color: #8f8faf;
}

.hint code {
  font-size: 12px;
  color: #c8c8e0;
}

.result {
  margin: 0 0 48px;
  border: 1px solid rgba(138, 99, 255, 0.18);
  border-radius: 16px;
  background: linear-gradient(180deg, rgba(32, 32, 64, 0.55), rgba(18, 18, 44, 0.55));
  padding: 18px;
}

.result-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.result-bar h2 {
  font-size: 16px;
  font-weight: 600;
  color: #fff;
  max-width: 100%;
}

.result-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.btn {
  border: 1px solid rgba(138, 99, 255, 0.35);
  border-radius: 10px;
  padding: 10px 14px;
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  color: #e8e8f0;
  background: rgba(10, 10, 26, 0.55);
  cursor: pointer;
}

.btn.primary {
  border-color: transparent;
  color: #fff;
  background: linear-gradient(135deg, #7b4dff, #5a2fd6);
}

.btn:hover { filter: brightness(1.06); }
.btn:disabled { opacity: 0.55; cursor: wait; }

.copy-hint {
  font-size: 13px;
  color: #8f8faf;
  margin-bottom: 12px;
}

.article-frame {
  background: #faf9f7;
  color: #1a1a1a;
  border-radius: 12px;
  padding: 28px 24px 40px;
  max-height: 70vh;
  overflow: auto;
  outline: none;
  font-family: Georgia, "Times New Roman", serif;
  line-height: 1.55;
  box-shadow: inset 0 0 0 1px rgba(0,0,0,.06);
}

.article-frame:focus {
  box-shadow: inset 0 0 0 2px rgba(138, 99, 255, 0.45);
}

.article-frame h1 {
  font-family: system-ui, -apple-system, sans-serif;
  font-size: 1.55rem;
  margin: 0 0 1.1rem;
}

.article-frame h2 {
  font-family: system-ui, -apple-system, sans-serif;
  font-size: 1.05rem;
  margin: 1.6rem 0 0.6rem;
  color: #444;
  border-bottom: 1px solid #ddd;
  padding-bottom: 0.3rem;
}

.article-frame p { margin: 0.5rem 0; }
.article-frame figure { margin: 1rem 0; }
.article-frame img {
  max-width: 100%;
  height: auto;
  border-radius: 6px;
  box-shadow: 0 1px 8px rgba(0,0,0,.08);
}
.article-frame .page-shot img { border: 1px solid #ddd; }

footer {
  padding: 0 24px 36px;
  color: #8f8faf;
  font-size: 14px;
}

@media (max-width: 640px) {
  .wrap { max-width: 100%; }
  .article-frame { padding: 18px 14px 28px; max-height: 60vh; }
}
