@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

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

:root {
  --bg: #0f1117;
  --bg-card: #1a1d27;
  --bg-card-hover: #1e2230;
  --border: #2a2d3a;
  --text: #e4e4e7;
  --text-dim: #9ca3af;
  --accent: #6366f1;
  --accent-hover: #818cf8;
  --accent-glow: rgba(99, 102, 241, 0.3);
  --warn: #f59e0b;
  --warn-bg: rgba(245, 158, 11, 0.08);
  --warn-border: rgba(245, 158, 11, 0.2);
  --info-bg: rgba(99, 102, 241, 0.08);
  --info-border: rgba(99, 102, 241, 0.2);
  --danger: #ef4444;
  --success: #22c55e;
  --radius: 12px;
  --radius-sm: 8px;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.6;
}

.app {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Header */
.header {
  background: linear-gradient(135deg, #1a1d27 0%, #252836 100%);
  border-bottom: 1px solid var(--border);
  padding: 48px 24px 40px;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.header::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle at 50% 50%, var(--accent-glow) 0%, transparent 50%);
  opacity: 0.4;
  pointer-events: none;
}

.header-content {
  position: relative;
  z-index: 1;
  max-width: 640px;
  margin: 0 auto;
}

.logo {
  font-size: 2rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 8px;
  background: linear-gradient(135deg, #fff 0%, #c7d2fe 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.subtitle {
  color: var(--text-dim);
  font-size: 0.95rem;
  margin-bottom: 20px;
}

.lang-switch {
  display: inline-flex;
  gap: 4px;
  background: rgba(255,255,255,0.06);
  padding: 4px;
  border-radius: 8px;
}

.lang-btn {
  padding: 6px 16px;
  border: none;
  background: transparent;
  color: var(--text-dim);
  font-size: 0.85rem;
  font-weight: 500;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s;
  font-family: inherit;
}

.lang-btn:hover {
  color: var(--text);
}

.lang-btn.active {
  background: var(--accent);
  color: #fff;
}

/* Main */
.main {
  flex: 1;
  max-width: 640px;
  width: 100%;
  margin: 0 auto;
  padding: 24px 16px;
}

/* Notices */
.notices {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 24px;
}

.notice {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  line-height: 1.5;
  position: relative;
  animation: fadeIn 0.3s ease;
}

.notice-warn {
  background: var(--warn-bg);
  border: 1px solid var(--warn-border);
  color: #fbbf24;
}

.notice-info {
  background: var(--info-bg);
  border: 1px solid var(--info-border);
  color: var(--accent-hover);
}

.notice-icon {
  flex-shrink: 0;
  font-size: 1rem;
}

.notice-close {
  position: absolute;
  top: 8px;
  right: 10px;
  background: none;
  border: none;
  color: inherit;
  opacity: 0.5;
  cursor: pointer;
  font-size: 1.1rem;
  line-height: 1;
  padding: 2px 6px;
}

.notice-close:hover {
  opacity: 1;
}

/* Card */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px 24px;
  margin-bottom: 16px;
}

.card-title {
  font-size: 1.2rem;
  font-weight: 600;
  margin-bottom: 20px;
  letter-spacing: -0.01em;
}

/* Instructions */
.instructions {
  background: rgba(99, 102, 241, 0.05);
  border: 1px solid var(--info-border);
  border-radius: var(--radius-sm);
  padding: 16px 20px;
  margin-bottom: 24px;
}

.instructions-title {
  font-weight: 600;
  font-size: 0.9rem;
  margin-bottom: 10px;
  color: var(--accent-hover);
}

.instructions ol {
  padding-left: 20px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.instructions li {
  font-size: 0.85rem;
  color: var(--text-dim);
}

/* Payload Select */
.payload-section {
  margin-bottom: 16px;
}

.field-label {
  display: block;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-dim);
  margin-bottom: 8px;
}

.payload-select {
  width: 100%;
  padding: 10px 14px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 0.9rem;
  font-family: inherit;
  cursor: pointer;
  outline: none;
  transition: border-color 0.2s;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%239ca3af' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
}

.payload-select:focus {
  border-color: var(--accent);
}

.payload-select option {
  background: var(--bg-card);
  color: var(--text);
}

/* Upload */
.upload-section {
  margin-bottom: 16px;
  animation: fadeIn 0.3s ease;
}

.file-input {
  width: 100%;
  padding: 10px;
  background: var(--bg);
  border: 1px dashed var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 0.85rem;
  font-family: inherit;
  cursor: pointer;
}

.file-input::file-selector-button {
  padding: 6px 14px;
  margin-right: 12px;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 6px;
  font-size: 0.8rem;
  font-family: inherit;
  cursor: pointer;
}

/* Debug */
.debug-section {
  padding: 12px 0;
  margin-bottom: 20px;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.debug-label {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.85rem;
  color: var(--text-dim);
  cursor: pointer;
}

.debug-label input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: var(--accent);
  cursor: pointer;
}

/* Go Button */
.btn-go {
  width: 100%;
  padding: 14px;
  background: linear-gradient(135deg, var(--accent) 0%, #8b5cf6 100%);
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 1rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.2s;
  box-shadow: 0 4px 16px var(--accent-glow);
}

.btn-go:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 24px var(--accent-glow);
}

.btn-go:active {
  transform: translateY(0);
}

/* Log */
.log-card {
  padding: 20px 24px;
}

.log-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.log-header h3 {
  font-size: 1rem;
  font-weight: 600;
}

.btn-clear {
  padding: 5px 14px;
  background: rgba(255,255,255,0.06);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text-dim);
  font-size: 0.8rem;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-clear:hover {
  background: rgba(255,255,255,0.1);
  color: var(--text);
}

.log-output {
  height: 200px;
  padding: 12px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow-y: auto;
  font-family: 'SF Mono', 'Fira Code', 'Cascadia Code', monospace;
  font-size: 0.8rem;
  line-height: 1.7;
  color: var(--success);
}

.log-output::-webkit-scrollbar {
  width: 6px;
}

.log-output::-webkit-scrollbar-track {
  background: transparent;
}

.log-output::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 3px;
}

/* Footer */
.footer {
  text-align: center;
  padding: 24px;
  border-top: 1px solid var(--border);
  color: var(--text-dim);
  font-size: 0.8rem;
}

.footer a {
  color: var(--accent-hover);
  text-decoration: none;
}

.footer a:hover {
  text-decoration: underline;
}

.footer-sub {
  margin-top: 4px;
  opacity: 0.6;
}

/* Animation */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Responsive */
@media (max-width: 480px) {
  .header {
    padding: 32px 16px 28px;
  }
  .logo {
    font-size: 1.5rem;
  }
  .card {
    padding: 20px 16px;
  }
}
