:root {
  --bg: #f5f8ff;
  --ink: #14213d;
  --muted: #4a5a78;
  --card: rgba(255, 255, 255, 0.88);
  --line: #d6dfef;
  --accent: #006d77;
  --accent-2: #ff7f50;
  --ok: #1f7a45;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Source Han Sans SC", "Noto Sans SC", "PingFang SC", sans-serif;
  color: var(--ink);
  background:
    radial-gradient(1200px 600px at 10% -10%, #d3f4ee 0%, transparent 45%),
    radial-gradient(1000px 500px at 90% 0%, #ffe8dc 0%, transparent 50%),
    var(--bg);
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
}

/* Lock Screen Styles */
.lock-screen {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: linear-gradient(135deg, #a8edea 0%, #fed6e3 100%);
  display: flex;
  justify-content: center;
  align-items: center;
  transition: opacity 0.5s ease, visibility 0.5s ease;
}

.lock-screen.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.lock-card {
  background: rgba(255, 255, 255, 0.9);
  padding: 40px;
  border-radius: 24px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
  text-align: center;
  width: 90%;
  max-width: 360px;
  border: 4px solid #fff;
  animation: popIn 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.lock-icon {
  font-size: 48px;
  margin-bottom: 16px;
  animation: bounce 2s infinite;
}

.lock-card h2 {
  color: #333;
  margin-bottom: 8px;
  font-size: 1.5rem;
}

.lock-card p {
  color: #666;
  margin-bottom: 24px;
}

.input-group {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
}

#passwordInput {
  flex: 1;
  border: 2px solid #e0e0e0;
  border-radius: 50px; /* Fully rounded */
  padding: 12px 20px;
  font-size: 1rem;
  outline: none;
  transition: border-color 0.3s;
}

#passwordInput:focus {
  border-color: var(--accent);
}

#unlockBtn {
  border-radius: 50px;
  padding: 12px 24px;
  background: var(--accent);
  color: white;
  border: none;
  font-weight: bold;
}

.error-msg {
  color: #ff4d4f;
  font-size: 0.9rem;
  min-height: 1.2em;
  margin: 0;
}

@keyframes popIn {
  from { transform: scale(0.8); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

@keyframes bounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}

/* Guard Mask (Original) */
.guard-mask {
  position: fixed;
  inset: 0;
  z-index: 99;
  display: grid;
  place-items: center;
  background: #ffffff;
  color: #2e4466;
  font-size: 1.05rem;
  letter-spacing: 0.2px;
}

.guard-mask.hidden {
  display: none;
}

.bg-orb {
  position: fixed;
  width: 280px;
  height: 280px;
  border-radius: 50%;
  filter: blur(28px);
  opacity: 0.35;
  pointer-events: none;
  z-index: 0;
  animation: float 8s ease-in-out infinite;
}

.orb-a {
  left: -90px;
  top: 20vh;
  background: #00b4d8;
}

.orb-b {
  right: -70px;
  bottom: 18vh;
  background: #ff9f1c;
  animation-delay: 1.2s;
}

.container {
  width: min(1060px, calc(100% - 28px));
  margin: 28px auto 36px;
  position: relative;
  z-index: 1;
}

.hero {
  margin-bottom: 18px;
  animation: reveal 0.55s ease-out;
}

h1 {
  margin: 0;
  font-size: clamp(1.6rem, 2.6vw, 2.1rem);
  letter-spacing: 0.4px;
}

h2 {
  margin: 0 0 12px;
  font-size: 1.05rem;
}

.hero p,
.hint p {
  margin: 8px 0 0;
  color: var(--muted);
}

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 16px;
  margin-bottom: 14px;
  box-shadow: 0 8px 24px rgba(16, 42, 67, 0.06);
  backdrop-filter: blur(2px);
  animation: reveal 0.55s ease-out;
}

.controls {
  animation-delay: 0.08s;
}

.control-row {
  display: flex;
  flex-direction: row; /* Change to row to align items horizontally */
  align-items: flex-end; /* Align inputs and labels nicely */
  flex-wrap: wrap; /* Allow wrapping on small screens */
  gap: 16px;
  margin-bottom: 12px;
}

.compact-row {
  flex-direction: row;
  align-items: flex-end;
  gap: 12px;
  flex-wrap: wrap;
}

.count-group {
  min-width: 120px;
  flex: 0 1 auto; /* Allow items to shrink/grow based on content but not take full width */
}

.two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

label {
  font-size: 0.92rem;
  color: var(--muted);
}

input,
select,
button,
textarea {
  font: inherit;
}

input[type="file"],
input[type="number"],
input[type="text"],
select,
textarea {
  border: 1px solid #c6d4ec;
  border-radius: 10px;
  padding: 10px 12px;
  background: #fff;
}

button {
  border: 1px solid #b9c6dd;
  border-radius: 10px;
  padding: 9px 13px;
  background: #fff;
  cursor: pointer;
  transition: transform 0.1s ease, border-color 0.2s ease;
}

button:hover:not(:disabled) {
  transform: translateY(-1px);
  border-color: #8da2c8;
}

button.primary {
  background: linear-gradient(120deg, var(--accent), #0a9396);
  color: #fff;
  border-color: transparent;
}

button:disabled {
  opacity: 0.58;
  cursor: not-allowed;
}

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

.status {
  margin: 4px 0 0;
  color: var(--ok);
  font-size: 0.92rem;
}

.result-grid {
  display: grid;
  gap: 12px;
}

.result-grid.empty {
  padding: 12px;
  border: 1px solid #d6dfef;
  border-radius: 10px;
  background: #fff;
  color: var(--muted);
}

.result-card {
  border: 1px solid #d6dfef;
  border-radius: 10px;
  background: #fff;
  padding: 12px;
}

.result-card h3 {
  margin: 0 0 10px;
  font-size: 0.96rem;
  color: #355070;
}

.field-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 8px;
}

.copy-field {
  text-align: left;
  background: #f8fbff;
  border: 1px solid #e0e8f8;
  border-radius: 8px;
  padding: 8px 10px;
  cursor: copy;
  transition: background-color 0.15s ease, border-color 0.15s ease;
}

.copy-field:hover {
  background: #eef6ff;
  border-color: #c8daf7;
}

.copy-field.copied-cell {
  background: #dff6e8;
  border-color: #9bd5b1;
}

.field-key {
  display: block;
  font-size: 0.8rem;
  color: var(--muted);
  margin-bottom: 4px;
}

.field-value {
  display: block;
  color: var(--ink);
  white-space: normal;
  word-break: break-word;
  line-height: 1.35;
}

table {
  border-collapse: collapse;
  width: 100%;
  min-width: 640px;
}

th,
td {
  border-bottom: 1px solid #e5ebf7;
  text-align: left;
  padding: 8px 10px;
  font-size: 0.92rem;
}

th {
  background: #f7fbff;
  position: sticky;
  top: 0;
  z-index: 1;
}

.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

textarea {
  width: 100%;
  min-height: 260px;
  resize: none;
  overflow: hidden;
  font-family: "Cascadia Code", Consolas, monospace;
  font-size: 0.85rem;
  line-height: 1.45;
}

code {
  background: #eef3fb;
  border-radius: 6px;
  padding: 1px 5px;
}

@keyframes reveal {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes float {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-18px);
  }
}

@media (max-width: 760px) {
  .two-col {
    grid-template-columns: 1fr;
  }

  .compact-row {
    align-items: stretch;
  }

  .count-group {
    min-width: 100%;
    flex-basis: 100%;
  }

  .section-head {
    flex-direction: column;
    align-items: flex-start;
  }
}
