:root {
  --bg: #0f172a;
  --panel: #111827;
  --border: #1f2937;
  --accent: #22c55e;
  --accent-2: #f97316;
  --text: #e5e7eb;
  --muted: #94a3b8;
  --error: #ef4444;
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: radial-gradient(circle at 20% 20%, rgba(56, 189, 248, 0.15), transparent 35%),
    radial-gradient(circle at 80% 0%, rgba(34, 197, 94, 0.12), transparent 30%),
    var(--bg);
  color: var(--text);
  font-family: "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 32px;
}

header {
  margin-bottom: 24px;
  text-align: center;
}

h1 {
  font-size: 24px;
  margin: 0 0 4px 0;
}

header p {
  color: var(--muted);
  margin: 0;
}

.layout {
  width: min(1200px, 100%);
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: var(--shadow);
  padding: 24px;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 16px;
}

.panel-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 16px;
  color: var(--muted);
  margin-bottom: 8px;
}

.editor {
  display: grid;
  grid-template-columns: auto 1fr;
  background: #0b1220;
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  min-height: 320px;
}

.line-numbers {
  background: #0c1322;
  color: var(--muted);
  padding: 12px 8px;
  min-width: 48px;
  text-align: right;
  white-space: pre;
  user-select: none;
  font-family: "SFMono-Regular", "Menlo", "Consolas", monospace;
  font-size: 12px;
  line-height: 1.5;
  border-right: 1px solid var(--border);
  overflow: hidden;
}

textarea {
  width: 100%;
  min-height: 320px;
  background: transparent;
  color: var(--text);
  border: none;
  padding: 12px;
  font-size: 14px;
  line-height: 1.5;
  resize: vertical;
  outline: none;
  transition: border 0.2s ease, box-shadow 0.2s ease;
  font-family: "SFMono-Regular", "Menlo", "Consolas", monospace;
  white-space: pre;
  overflow: auto;
}

textarea:focus {
  box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.15);
}

.actions {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
}

button {
  background: linear-gradient(135deg, var(--accent), #16a34a);
  border: none;
  color: #0b1220;
  padding: 12px 18px;
  border-radius: 12px;
  font-weight: 700;
  letter-spacing: 0.5px;
  cursor: pointer;
  min-width: 120px;
  box-shadow: 0 10px 20px rgba(34, 197, 94, 0.25);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

button:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 28px rgba(34, 197, 94, 0.3);
}

button:active {
  transform: translateY(0);
}

.helper {
  font-size: 12px;
  color: var(--muted);
  text-align: center;
  max-width: 120px;
}

.status {
  grid-column: 1 / -1;
  background: #0b1220;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px 14px;
  font-size: 13px;
  color: var(--text);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin-top: 16px;
}

.status .tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 8px;
  background: #1f2937;
  color: var(--muted);
  font-size: 12px;
}

.status .tag.success {
  color: var(--accent);
}

.status .tag.error {
  color: var(--error);
}

.status-list {
  grid-column: 1 / -1;
  display: grid;
  gap: 8px;
  margin-top: 16px;
}

.status-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 12px;
  border-radius: 10px;
  background: #111826;
  border: 1px solid var(--border);
  color: var(--muted);
  font-size: 14px;
}

.status-item.error {
  border-color: rgba(239, 68, 68, 0.7);
  color: var(--error);
  background: rgba(239, 68, 68, 0.08);
}

.status-item .line {
  color: var(--text);
}

.push-status {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
}

@media (max-width: 960px) {
  .layout {
    grid-template-columns: 1fr;
  }

  .actions {
    flex-direction: row;
  }

  .helper {
    max-width: none;
  }
}

/* Loading Overlay */
.lock-screen {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(15, 23, 42, 0.95);
  backdrop-filter: blur(8px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  transition: opacity 0.3s ease;
}

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

.load-spin {
  width: 40px;
  height: 40px;
  border: 4px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin-bottom: 16px;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}
