:root {
  font-family: "Inter", "PingFang SC", "Microsoft YaHei", system-ui, -apple-system, sans-serif;
  --bg: #0b1220;
  --card: rgba(255, 255, 255, 0.96);
  --ink: #0f172a;
  --muted: #475569;
  --line: #dbe5f2;
  --primary: #2563eb;
  --primary-deep: #1e40af;
  --success: #0f766e;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(1200px 650px at 8% -12%, #1d4ed8 0%, transparent 58%),
    radial-gradient(950px 560px at 95% -8%, #0f766e 0%, transparent 62%),
    linear-gradient(180deg, #09101d 0%, #0b1220 65%, #0c1526 100%);
  color: var(--ink);
}

.app-shell {
  max-width: 1320px;
  margin: 20px auto;
  padding: 0 16px 20px;
}

.topbar {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: center;
  padding: 16px 18px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 18px;
  background: linear-gradient(135deg, rgba(15, 23, 42, 0.82), rgba(17, 27, 47, 0.9));
  backdrop-filter: blur(10px);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.09);
  margin-bottom: 16px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  color: #e2e8f0;
}

.logo-dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: linear-gradient(135deg, #38bdf8, #14b8a6);
  box-shadow: 0 0 20px rgba(20, 184, 166, 0.8);
}

.brand h1 { margin: 0 0 4px; font-size: clamp(1.2rem, 2.2vw, 1.8rem); letter-spacing: 0.2px; }
.brand p { margin: 0; color: #94a3b8; font-size: 0.94rem; }

.lang-switch {
  display: flex;
  gap: 8px;
  padding: 4px;
  border: 1px solid #334155;
  border-radius: 12px;
  background: rgba(15, 23, 42, 0.45);
}

.lang-btn {
  border: 1px solid transparent;
  background: transparent;
  color: #cbd5e1;
  border-radius: 9px;
  padding: 8px 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.lang-btn:hover { color: #fff; background: rgba(148, 163, 184, 0.15); }
.lang-btn.active {
  background: linear-gradient(135deg, #2563eb, #1e3a8a);
  color: #fff;
  box-shadow: 0 6px 18px rgba(37, 99, 235, 0.35);
}

.workspace { display: grid; grid-template-columns: 1fr; gap: 16px; }
@media (min-width: 980px) { .workspace { grid-template-columns: 1.1fr 0.9fr; } }

.panel {
  background: var(--card);
  border: 1px solid rgba(255, 255, 255, 0.6);
  border-radius: 18px;
  box-shadow: 0 18px 40px rgba(2, 6, 23, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.8);
  padding: 18px;
}

.panel-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}
.panel-head h2 { margin: 0; font-size: 1.08rem; }

.badge, .preview-status {
  font-size: 0.78rem;
  border-radius: 999px;
  padding: 4px 10px;
  background: #ccfbf1;
  color: #134e4a;
  border: 1px solid #99f6e4;
}

.field-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}
@media (min-width: 720px) { .field-grid { grid-template-columns: 1fr 1fr; } }

label {
  display: block;
  margin: 12px 0 8px;
  font-weight: 600;
  color: #334155;
}

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

input, textarea, select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px 12px;
  background: #f8fafc;
  color: #0f172a;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

input:hover, textarea:hover, select:hover { background: #ffffff; }

input:focus, textarea:focus, select:focus {
  outline: none;
  border-color: #60a5fa;
  box-shadow: 0 0 0 3px rgba(147, 197, 253, 0.45);
}

textarea { min-height: 340px; resize: vertical; line-height: 1.45; }

.actions {
  margin-top: 14px;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  padding: 10px;
  border-radius: 12px;
  background: linear-gradient(180deg, #f8fafc, #f1f5f9);
  border: 1px solid #e2e8f0;
}

button {
  border: 0;
  border-radius: 11px;
  padding: 10px 14px;
  font-weight: 700;
  cursor: pointer;
  color: #fff;
  background: linear-gradient(135deg, var(--primary), var(--primary-deep));
  box-shadow: 0 8px 20px rgba(37, 99, 235, 0.3);
  transition: transform 0.14s ease, box-shadow 0.2s ease, filter 0.2s ease;
}

button:hover {
  transform: translateY(-1px);
  filter: saturate(1.1);
  box-shadow: 0 12px 22px rgba(37, 99, 235, 0.36);
}

button:active {
  transform: translateY(0);
  box-shadow: 0 6px 14px rgba(37, 99, 235, 0.28);
}

button.secondary {
  background: #ffffff;
  color: #0f172a;
  border: 1px solid #cbd5e1;
  box-shadow: 0 6px 14px rgba(15, 23, 42, 0.12);
}

button.ghost {
  background: transparent;
  color: #334155;
  border: 1px dashed #94a3b8;
  box-shadow: none;
}

.msg {
  min-height: 1.5em;
  margin: 12px 0 4px;
  color: var(--success);
  font-weight: 500;
}

.tips {
  margin-top: 12px;
  border-top: 1px dashed #cbd5e1;
  padding-top: 12px;
}
.tips h3 { margin: 0 0 8px; font-size: 0.96rem; }
.tips ol { margin: 0; padding-left: 1.2rem; color: var(--muted); line-height: 1.55; }

code { background: #e2e8f0; border-radius: 6px; padding: 2px 6px; }

.preview-panel { display: flex; flex-direction: column; }
#livePreview {
  width: 100%;
  height: clamp(440px, 68vh, 780px);
  border: 1px solid #cbd5e1;
  border-radius: 12px;
  background: #fff;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9);
}
