:root {
  --bg-a: #071419;
  --bg-b: #0f2a36;
  --panel: rgba(14, 33, 42, 0.82);
  --panel-border: rgba(144, 187, 210, 0.24);
  --text: #e8f1f4;
  --muted: #abc1cb;
  --accent: #3dd8bf;
  --accent-2: #f7b267;
  --danger: #ff6d6d;
  --ok: #5be28e;
  --warn: #f7d56b;
  --font-main: "Avenir Next", "Trebuchet MS", "Gill Sans", sans-serif;
  --font-mono: "IBM Plex Mono", "Fira Mono", "Menlo", monospace;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  font-family: var(--font-main);
  color: var(--text);
  background:
    radial-gradient(circle at 15% 10%, #17445a 0, transparent 35%),
    radial-gradient(circle at 85% 20%, #3d2e58 0, transparent 38%),
    linear-gradient(160deg, var(--bg-a), var(--bg-b));
  padding: 1rem;
}

.bg {
  position: fixed;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  z-index: 0;
}

.bg-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(40px);
  opacity: 0.18;
  animation: drift 18s ease-in-out infinite alternate;
}

.bg-orb-1 {
  width: 340px;
  height: 340px;
  background: #0fd2b3;
  top: -80px;
  right: -40px;
}

.bg-orb-2 {
  width: 260px;
  height: 260px;
  background: #ff9f68;
  left: -70px;
  top: 35%;
  animation-duration: 24s;
}

.bg-orb-3 {
  width: 280px;
  height: 280px;
  background: #79a8ff;
  bottom: -80px;
  right: 30%;
  animation-duration: 30s;
}

@keyframes drift {
  from {
    transform: translateY(-12px) translateX(-10px) scale(1);
  }
  to {
    transform: translateY(18px) translateX(12px) scale(1.08);
  }
}

.app-shell {
  position: relative;
  z-index: 1;
  max-width: 1480px;
  margin: 0 auto;
  display: grid;
  gap: 1rem;
}

.panel {
  background: var(--panel);
  border: 1px solid var(--panel-border);
  border-radius: 14px;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.24);
  backdrop-filter: blur(6px);
  padding: 1rem 1rem 1.1rem;
}

.hero h1 {
  margin: 0 0 0.4rem;
  font-size: clamp(1.4rem, 3vw, 2.2rem);
}

.hero p {
  margin: 0.22rem 0;
  color: var(--muted);
}

.notice {
  color: #d6ffe8;
  font-size: 0.93rem;
}

.workspace {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.controls h2,
.summary h2,
.panel h2 {
  margin: 0 0 0.8rem;
  font-size: 1.2rem;
}

h3 {
  margin: 1.1rem 0 0.5rem;
  color: #d9ebf2;
  font-size: 1rem;
}

.field {
  display: grid;
  gap: 0.35rem;
  margin: 0.55rem 0;
}

.field span {
  font-size: 0.9rem;
  color: var(--muted);
}

input[type="file"],
input[type="number"],
input[type="password"],
select,
textarea {
  border-radius: 10px;
  border: 1px solid rgba(168, 194, 208, 0.32);
  background: rgba(4, 20, 26, 0.7);
  color: var(--text);
  font-family: var(--font-main);
  padding: 0.58rem 0.65rem;
}

input[type="file"] {
  padding: 0.45rem;
}

textarea {
  width: 100%;
  min-height: 260px;
  resize: vertical;
  font-family: var(--font-mono);
  line-height: 1.3;
}

.checkbox-row {
  display: flex;
  gap: 0.5rem;
  align-items: flex-start;
  color: var(--muted);
  margin-top: 0.4rem;
}

.checkbox-row input {
  margin-top: 0.2rem;
}

.inline {
  display: flex;
  gap: 0.55rem;
  flex-wrap: wrap;
}

.btn {
  border: 0;
  border-radius: 11px;
  padding: 0.56rem 0.9rem;
  cursor: pointer;
  font-weight: 650;
  transition: transform 0.12s ease, filter 0.12s ease;
  font-family: var(--font-main);
}

.btn:hover {
  transform: translateY(-1px);
  filter: brightness(1.08);
}

.btn.btn-copied {
  animation: copy-pop 0.42s ease;
}

.btn.btn-copy-error {
  animation: copy-shake 0.28s ease;
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

.btn-primary {
  background: linear-gradient(130deg, var(--accent), #4feda7);
  color: #04211a;
}

.btn-secondary {
  background: linear-gradient(130deg, #69b6ff, #5ed8ef);
  color: #03222c;
}

.btn-ghost {
  background: rgba(148, 182, 198, 0.2);
  color: #dce9ee;
  border: 1px solid rgba(148, 182, 198, 0.22);
}

.status {
  margin-top: 0.6rem;
  border-left: 3px solid var(--accent);
  padding-left: 0.6rem;
  color: #d2f6eb;
}

.hint {
  color: var(--muted);
  margin-top: 0.35rem;
  font-size: 0.9rem;
}

.key-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.6rem;
}

.cards {
  display: grid;
  grid-template-columns: repeat(4, minmax(120px, 1fr));
  gap: 0.6rem;
}

.card {
  background: rgba(3, 19, 25, 0.62);
  border: 1px solid rgba(115, 166, 191, 0.25);
  border-radius: 12px;
  padding: 0.7rem;
}

.card .label {
  color: var(--muted);
  font-size: 0.8rem;
  margin: 0 0 0.25rem;
}

.card .value {
  margin: 0;
  font-weight: 700;
  font-size: 1.1rem;
}

.list {
  list-style: square;
  margin: 0.3rem 0 0;
  padding-left: 1.2rem;
  color: #dfeef4;
}

.list li {
  margin-bottom: 0.35rem;
  line-height: 1.33;
}

.results-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

.table-wrap {
  overflow: auto;
  max-height: 460px;
  border: 1px solid rgba(124, 174, 197, 0.2);
  border-radius: 10px;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.89rem;
}

thead {
  position: sticky;
  top: 0;
  z-index: 1;
}

th {
  background: rgba(8, 32, 42, 0.95);
  text-align: left;
  border-bottom: 1px solid rgba(136, 171, 191, 0.3);
  padding: 0.55rem;
  color: #d2ecf6;
  white-space: nowrap;
}

td {
  border-bottom: 1px solid rgba(124, 166, 186, 0.16);
  padding: 0.45rem 0.55rem;
  vertical-align: top;
  line-height: 1.3;
}

tr:hover td {
  background: rgba(11, 42, 56, 0.4);
}

.mono {
  font-family: var(--font-mono);
  word-break: break-word;
}

.tag {
  display: inline-block;
  padding: 0.14rem 0.42rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
}

.tag-ok {
  background: rgba(91, 226, 142, 0.18);
  color: var(--ok);
}

.tag-warn {
  background: rgba(247, 213, 107, 0.16);
  color: var(--warn);
}

.tag-danger {
  background: rgba(255, 109, 109, 0.16);
  color: var(--danger);
}

.export {
  grid-column: 1 / -1;
}

.copy-feedback {
  margin: 0.25rem 0 0.05rem;
  min-height: 1.1rem;
  font-size: 0.88rem;
  color: var(--muted);
  opacity: 0;
  transform: translateY(-2px);
  transition: opacity 0.18s ease, transform 0.18s ease;
}

.copy-feedback.show {
  opacity: 1;
  transform: translateY(0);
}

.copy-feedback.ok {
  color: #b4ffd7;
}

.copy-feedback.warn {
  color: #ffd7a8;
}

a {
  color: #81d8ff;
}

code {
  font-family: var(--font-mono);
  background: rgba(150, 186, 205, 0.14);
  border-radius: 5px;
  padding: 0.04rem 0.28rem;
}

@media (max-width: 1080px) {
  .workspace,
  .results-grid {
    grid-template-columns: 1fr;
  }

  .cards {
    grid-template-columns: repeat(2, minmax(120px, 1fr));
  }

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

@media (prefers-reduced-motion: reduce) {
  .bg-orb,
  .btn {
    animation: none;
    transition: none;
  }
}

@keyframes copy-pop {
  0% {
    transform: scale(1);
  }
  45% {
    transform: scale(1.04);
  }
  100% {
    transform: scale(1);
  }
}

@keyframes copy-shake {
  0% {
    transform: translateX(0);
  }
  25% {
    transform: translateX(-2px);
  }
  50% {
    transform: translateX(2px);
  }
  75% {
    transform: translateX(-1px);
  }
  100% {
    transform: translateX(0);
  }
}
