@import url(https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@400;500;600;700&family=JetBrains+Mono:wght@400;600&display=swap);
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg:         #080c10;
  --bg2:        #0d1218;
  --surface:    #111720;
  --surface2:   #161e28;
  --surface3:   #1b2533;
  --border:     #1f2d3d;
  --border2:    #253447;
  --muted:      #37506a;
  --dim:        #5882a4;
  --text:       #b8cfe0;
  --bright:     #e8f2fa;
  --blue:       #2196f3;
  --blue-lt:    #42a5f5;
  --blue-glow:  rgba(33,150,243,0.15);
  --blue-glow2: rgba(33,150,243,0.08);
  --cyan:       #00bcd4;
  --green:      #26c96e;
  --red:        #e05252;
  --yellow:     #f0a030;
  --card-shadow: 0 32px 80px rgba(0,0,0,0.6), 0 0 0 1px var(--border);
  --mono: 'JetBrains Mono', monospace;
  --sans: 'Space Grotesk', sans-serif;
}

html { font-size: 14px; }

body {
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  line-height: 1.6;
  overflow-x: hidden;
}

#app {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.app-main {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 20px 60px;
  width: 100%;
}

.app-card {
  width: 100%;
  max-width: 480px;
}


.card-header {
  padding: 28px 26px 22px;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
  border-radius: 14px 14px 0 0;
  text-align: center;
}

.card-title {
  font-size: 22px;
  font-weight: 700;
  color: var(--bright);
  letter-spacing: -0.03em;
  margin-bottom: 6px;
}

.card-desc {
  font-size: 12.5px;
  color: var(--dim);
  line-height: 1.7;
  max-width: 360px;
  margin: 0 auto;
}

.tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 0;
  overflow: hidden;
}

.tab {
  background: none;
  border: none;
  color: var(--dim);
  font-family: var(--sans);
  font-size: 13px;
  font-weight: 600;
  padding: 15px;
  cursor: pointer;
  transition: color 0.15s, background 0.15s;
  position: relative;
  letter-spacing: 0.01em;
}

.tab:first-child { border-right: 1px solid var(--border); }

.tab:hover:not(.active) {
  color: var(--text);
  background: rgba(255,255,255,0.02);
}

.tab.active {
  color: var(--blue);
  background: rgba(33,150,243,0.05);
}

.tab.active::after {
  content: '';
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--blue), var(--cyan));
  border-radius: 2px 2px 0 0;
}

.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-top: none;
  border-radius: 0 0 14px 14px;
  padding: 28px 26px 26px;
  box-shadow: var(--card-shadow);
}

.section { display: none; }
.section.active { display: block; }

.stepper {
  display: flex;
  align-items: center;
  gap: 0;
  margin-bottom: 28px;
}

.step-dot {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  flex-shrink: 0;
}

.step-dot-circle {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 2px solid var(--border2);
  background: var(--surface2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  color: var(--muted);
  font-family: var(--mono);
  transition: all 0.3s;
  position: relative;
  z-index: 1;
}

.step-dot.active .step-dot-circle {
  border-color: var(--blue);
  background: rgba(33,150,243,0.12);
  color: var(--blue);
  box-shadow: 0 0 0 3px rgba(33,150,243,0.12);
}

.step-dot.done .step-dot-circle {
  border-color: var(--green);
  background: rgba(38,201,110,0.12);
  color: var(--green);
}

.step-dot.done .step-dot-circle::after {
  content: '';
  position: absolute;
  font-size: 12px;
}

.step-dot.done .step-dot-circle span { display: none; }

.step-dot-label {
  font-size: 9.5px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  white-space: nowrap;
}

.step-dot.active .step-dot-label { color: var(--blue); }
.step-dot.done .step-dot-label { color: var(--green); }

.step-line {
  flex: 1;
  height: 2px;
  background: var(--border2);
  margin-bottom: 20px;
  position: relative;
  overflow: hidden;
}

.step-line.done::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, var(--green), var(--blue));
  animation: fillLine 0.4s ease forwards;
}

@keyframes fillLine {
  from { transform: scaleX(0); transform-origin: left; }
  to   { transform: scaleX(1); transform-origin: left; }
}

.step { display: none; }
.step.on { display: block; animation: stepIn 0.3s ease; }

@keyframes stepIn {
  from { opacity: 0; transform: translateX(12px); }
  to   { opacity: 1; transform: translateX(0); }
}

.step-header { margin-bottom: 22px; }

.step-title {
  font-size: 20px;
  font-weight: 700;
  color: var(--bright);
  letter-spacing: -0.025em;
  margin-bottom: 7px;
}

.step-desc {
  font-size: 13px;
  color: var(--dim);
  line-height: 1.75;
}

.step-desc strong {
  color: var(--text);
  font-weight: 500;
}

.field { margin-bottom: 14px; }

.field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.field-row .field { margin-bottom: 0; }

label {
  display: block;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--dim);
  margin-bottom: 7px;
}

input, textarea {
  width: 100%;
  background: var(--surface2);
  border: 1px solid var(--border2);
  border-radius: 10px;
  color: var(--bright);
  font-family: var(--sans);
  font-size: 14px;
  padding: 11px 14px;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
  -webkit-appearance: none;
}

input:focus, textarea:focus {
  border-color: var(--blue);
  background: var(--surface3);
  box-shadow: 0 0 0 3px var(--blue-glow2), inset 0 1px 0 rgba(255,255,255,0.03);
}

input::placeholder, textarea::placeholder { color: var(--muted); }

input.code-input {
  text-align: center;
  font-size: 26px;
  font-weight: 700;
  letter-spacing: 0.35em;
  padding: 16px 14px;
  font-family: var(--mono);
}

input.code-input::placeholder {
  font-size: 18px;
  letter-spacing: 0.5em;
  color: var(--muted);
  font-weight: 400;
}

textarea {
  resize: none;
  height: 90px;
  font-size: 11.5px;
  font-family: var(--mono);
  line-height: 1.8;
}

.field-hint {
  font-size: 11.5px;
  color: var(--muted);
  margin-top: 6px;
  margin-bottom: 14px;
  line-height: 1.6;
}

.field-hint strong { color: var(--dim); font-weight: 500; }

.btn-primary {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  background: linear-gradient(135deg, var(--blue) 0%, #1976d2 100%);
  color: #fff;
  border: none;
  border-radius: 10px;
  font-family: var(--sans);
  font-size: 14px;
  font-weight: 600;
  padding: 12px 20px;
  cursor: pointer;
  transition: opacity 0.15s, transform 0.1s, box-shadow 0.2s;
  margin-top: 6px;
  box-shadow: 0 4px 16px rgba(33,150,243,0.25), inset 0 1px 0 rgba(255,255,255,0.1);
  letter-spacing: 0.01em;
}

.btn-primary:hover:not(:disabled) {
  opacity: 0.92;
  box-shadow: 0 6px 24px rgba(33,150,243,0.35), inset 0 1px 0 rgba(255,255,255,0.1);
}

.btn-primary:active:not(:disabled) { transform: scale(0.985); }

.btn-primary:disabled {
  opacity: 0.35;
  cursor: not-allowed;
  box-shadow: none;
}

.btn-primary.btn-red {
  background: linear-gradient(135deg, var(--red) 0%, #c62828 100%);
  box-shadow: 0 4px 16px rgba(224,82,82,0.25), inset 0 1px 0 rgba(255,255,255,0.1);
}

.btn-ghost {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  background: none;
  border: 1px solid var(--border2);
  border-radius: 10px;
  color: var(--dim);
  font-family: var(--sans);
  font-size: 13px;
  font-weight: 500;
  padding: 11px;
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s, background 0.15s;
  margin-top: 8px;
}

.btn-ghost:hover:not(:disabled) {
  border-color: var(--dim);
  color: var(--text);
  background: rgba(255,255,255,0.025);
}

.notice {
  display: none;
  font-size: 12.5px;
  padding: 10px 13px;
  border-radius: 9px;
  margin-top: 10px;
  line-height: 1.65;
  animation: fadeUp 0.2s ease;
}

.notice.on { display: block; }

.notice-err {
  background: rgba(224, 82, 82, 0.07);
  border: 1px solid rgba(224, 82, 82, 0.2);
  color: #e88;
}

.notice-warn {
  background: rgba(240, 160, 48, 0.07);
  border: 1px solid rgba(240, 160, 48, 0.2);
  color: var(--yellow);
}

.notice-ok {
  background: rgba(38, 201, 110, 0.07);
  border: 1px solid rgba(38, 201, 110, 0.2);
  color: var(--green);
}

#result-box {
  display: none;
  margin-top: 14px;
  background: var(--surface);
  border: 1px solid var(--border2);
  border-radius: 14px;
  overflow: hidden;
  box-shadow: var(--card-shadow);
  animation: fadeUp 0.3s ease;
}

#result-box.on { display: block; }

.result-header {
  padding: 14px 18px;
  background: linear-gradient(135deg, rgba(33,150,243,0.08), rgba(0,188,212,0.05));
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.result-meta {}

.result-name {
  font-size: 14px;
  font-weight: 700;
  color: var(--bright);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.result-url {
  font-size: 11px;
  color: var(--dim);
  font-family: var(--mono);
  margin-top: 2px;
}

.result-status {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 600;
  color: var(--green);
  font-family: var(--mono);
  white-space: nowrap;
}

.result-status::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--green);
  animation: blink 2s ease-in-out infinite;
}

.result-body { padding: 16px 18px; }

.result-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 8px;
}

#result-value {
  font-family: var(--mono);
  font-size: 10.5px;
  color: var(--blue-lt);
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px 14px;
  word-break: break-all;
  user-select: all;
  cursor: text;
  line-height: 2;
  margin-bottom: 12px;
  position: relative;
}

.result-actions {
  display: flex;
  gap: 8px;
  margin-bottom: 14px;
}

.act {
  flex: 1;
  background: var(--blue-glow2);
  border: 1px solid rgba(33,150,243,0.2);
  border-radius: 8px;
  color: var(--blue);
  font-family: var(--sans);
  font-size: 12px;
  font-weight: 600;
  padding: 8px 14px;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}

.act:hover { background: var(--blue-glow); border-color: rgba(33,150,243,0.35); }

.act.ok {
  background: rgba(38,201,110,0.08);
  border-color: rgba(38,201,110,0.25);
  color: var(--green);
}

.act-ghost {
  background: none;
  border: 1px solid var(--border2);
  color: var(--dim);
}

.act-ghost:hover {
  background: rgba(255,255,255,0.03);
  border-color: var(--dim);
  color: var(--text);
}

.result-warn {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 11.5px;
  color: var(--yellow);
  line-height: 1.65;
  padding: 10px 12px;
  background: rgba(240,160,48,0.05);
  border: 1px solid rgba(240,160,48,0.15);
  border-radius: 8px;
}

.result-info {
  display: none;
  font-size: 12px;
  color: var(--dim);
  line-height: 1.75;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}

.result-info.on { display: block; }
.result-info strong { color: var(--text); font-weight: 500; }

#feed-box {
  display: none;
  margin-top: 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
  box-shadow: var(--card-shadow);
  animation: fadeUp 0.25s ease;
}

#feed-box.on { display: block; }

#feed-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  background: var(--surface2);
  border-bottom: 1px solid var(--border);
}

.feed-left {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--dim);
  font-family: var(--mono);
}

.pulse {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--green);
  flex-shrink: 0;
  animation: blink 1.8s ease-in-out infinite;
  box-shadow: 0 0 6px rgba(38,201,110,0.5);
}

.pulse.off { background: var(--muted); animation: none; box-shadow: none; }

#feed-count { font-size: 11px; color: var(--muted); font-family: var(--mono); }

#feed-list {
  max-height: 340px;
  overflow-y: auto;
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.feed-empty {
  text-align: center;
  color: var(--muted);
  font-size: 13px;
  padding: 36px 16px;
  line-height: 2;
}

.msg-card {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px 14px;
  animation: fadeUp 0.15s ease;
}

.msg-card.code {
  border-color: rgba(33,150,243,0.25);
  background: rgba(33,150,243,0.05);
}

.msg-time {
  font-size: 10px;
  color: var(--muted);
  margin-bottom: 6px;
  font-weight: 600;
  font-family: var(--mono);
  letter-spacing: 0.03em;
}

.msg-text {
  font-size: 13px;
  color: var(--text);
  line-height: 1.7;
  word-break: break-word;
  white-space: pre-wrap;
}

.code-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 10px;
  padding: 11px 14px;
  background: var(--bg2);
  border: 1px solid rgba(33,150,243,0.2);
  border-radius: 8px;
}

.code-digits {
  font-size: 26px;
  font-weight: 700;
  color: var(--blue);
  letter-spacing: 0.2em;
  font-family: var(--mono);
}

.copy-code {
  background: var(--blue);
  border: none;
  border-radius: 7px;
  color: #fff;
  font-family: var(--sans);
  font-size: 12px;
  font-weight: 600;
  padding: 7px 15px;
  cursor: pointer;
  transition: opacity 0.15s;
  flex-shrink: 0;
}

.copy-code:hover { opacity: 0.85; }
.copy-code.ok { background: var(--green); }

.spinner {
  display: inline-block;
  width: 14px;
  height: 14px;
  border: 2px solid rgba(255,255,255,0.2);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.65s linear infinite;
  vertical-align: middle;
}

::-webkit-scrollbar { width: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border2); border-radius: 4px; }

@keyframes blink { 0%,100%{opacity:1} 50%{opacity:0.2} }
@keyframes spin   { to { transform: rotate(360deg); } }
@keyframes fadeUp {
  from { opacity:0; transform:translateY(8px); }
  to   { opacity:1; transform:translateY(0); }
}

@media (max-width: 799px) {
  .app-main { padding: 24px 16px 56px; align-items: flex-start; }
  .field-row { grid-template-columns: 1fr; gap: 0; }
  .field-row .field { margin-bottom: 14px; }
  .panel { padding: 22px 18px 20px; }
}

@media (max-width: 400px) {
  .stepper { gap: 0; }
  .step-dot-label { display: none; }
  .step-dot-circle { width: 24px; height: 24px; font-size: 10px; }
}

