:root {
  --ink: #1a1f2c;
  --muted: #5c6578;
  --line: #e2e8f2;
  --paper: #f4f6fa;
  --panel: #ffffff;
  --brand: #1e4fd6;
  --brand-2: #0f9d8a;
  --danger: #c62828;
  --warn: #c77d1a;
  --radius: 14px;
  --shadow: 0 12px 40px rgba(20, 36, 80, 0.08);
  --font-display: "Source Han Serif SC", "Noto Serif SC", "Songti SC", Georgia, serif;
  --font-body: "IBM Plex Sans", "PingFang SC", "Microsoft YaHei", sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font-body);
  color: var(--ink);
  background:
    radial-gradient(1200px 600px at 10% -10%, rgba(30, 79, 214, 0.12), transparent 60%),
    radial-gradient(900px 500px at 100% 0%, rgba(15, 157, 138, 0.10), transparent 55%),
    linear-gradient(180deg, #eef2f8 0%, #f7f8fb 40%, #f4f6fa 100%);
  min-height: 100vh;
}

a { color: var(--brand); text-decoration: none; }
button, .btn {
  appearance: none; border: 0; cursor: pointer;
  font: inherit; border-radius: 10px;
  padding: 10px 16px; background: var(--brand); color: #fff;
  transition: transform .15s ease, opacity .15s ease;
}
button:hover, .btn:hover { transform: translateY(-1px); }
button.ghost, .btn.ghost { background: transparent; color: var(--ink); border: 1px solid var(--line); }
button.soft, .btn.soft { background: #e8eefc; color: var(--brand); }
button.danger { background: var(--danger); }
button:disabled { opacity: .5; cursor: not-allowed; transform: none; }

.wrap { width: min(1180px, 92vw); margin: 0 auto; }
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 0; gap: 16px;
}
.brand {
  font-family: var(--font-display);
  font-size: 28px; letter-spacing: 0.04em; font-weight: 700;
  color: var(--ink);
}
.brand span { color: var(--brand); }
.nav { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.user-chip {
  display: flex; align-items: center; gap: 8px;
  background: var(--panel); border: 1px solid var(--line);
  border-radius: 999px; padding: 6px 12px 6px 6px; font-size: 13px;
}
.avatar {
  width: 28px; height: 28px; border-radius: 50%;
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  color: #fff; display: grid; place-items: center; font-size: 12px;
}

.hero {
  display: grid; grid-template-columns: 1.1fr .9fr; gap: 36px;
  align-items: center; padding: 48px 0 72px;
}
.hero h1 {
  font-family: var(--font-display);
  font-size: clamp(36px, 5vw, 56px);
  line-height: 1.15; margin: 0 0 16px;
}
.hero p { color: var(--muted); font-size: 17px; line-height: 1.7; margin: 0 0 24px; max-width: 36em; }
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; }
.hero-visual {
  min-height: 420px; border-radius: 28px; position: relative; overflow: hidden;
  background:
    linear-gradient(145deg, rgba(30,79,214,.92), rgba(15,157,138,.85)),
    repeating-linear-gradient(90deg, rgba(255,255,255,.06) 0 1px, transparent 1px 28px),
    repeating-linear-gradient(0deg, rgba(255,255,255,.05) 0 1px, transparent 1px 28px);
  box-shadow: var(--shadow);
}
.hero-visual .block {
  position: absolute; border-radius: 16px; background: rgba(255,255,255,.16);
  border: 1px solid rgba(255,255,255,.22); backdrop-filter: blur(4px);
  animation: float 6s ease-in-out infinite;
}
.hero-visual .b1 { width: 58%; height: 84px; left: 10%; top: 16%; animation-delay: 0s; }
.hero-visual .b2 { width: 42%; height: 140px; right: 10%; top: 34%; animation-delay: .8s; }
.hero-visual .b3 { width: 70%; height: 72px; left: 12%; bottom: 16%; animation-delay: 1.4s; }
@keyframes float {
  0%,100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}

.panel {
  background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow);
}
.modal-mask {
  position: fixed; inset: 0; background: rgba(18, 24, 40, .48);
  display: none; align-items: center; justify-content: center; z-index: 50; padding: 20px;
}
.modal-mask.show { display: flex; }
.modal {
  width: min(420px, 100%); background: #fff; border-radius: 18px; padding: 28px;
  text-align: center;
}
.modal h3 { margin: 0 0 8px; font-family: var(--font-display); }
.modal p { color: var(--muted); font-size: 14px; }
.qr-box {
  width: 220px; height: 220px; margin: 18px auto; border-radius: 16px;
  background: #f5f7fa; border: 1px dashed var(--line);
  display: grid; place-items: center; overflow: hidden;
}
.qr-box img { width: 100%; height: 100%; object-fit: cover; }

/* Editor layout */
.editor-shell { height: 100vh; display: grid; grid-template-rows: 56px 1fr; }
.editor-top {
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 16px; background: #fff; border-bottom: 1px solid var(--line); gap: 12px;
}
.editor-main {
  display: grid; grid-template-columns: 320px 1fr; min-height: 0;
}
.side {
  background: #fbfcfe; border-right: 1px solid var(--line);
  overflow: auto; padding: 12px;
}
.canvas-wrap {
  overflow: auto; padding: 24px; background:
    linear-gradient(180deg, #e9eef7, #f5f7fb);
}
.phone {
  width: min(420px, 100%); margin: 0 auto; background: #fff;
  border-radius: 18px; min-height: 720px; padding: 20px 16px 40px;
  box-shadow: var(--shadow); outline: none;
}
.tabs { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.tab {
  padding: 7px 10px; border-radius: 8px; font-size: 12px;
  background: #eef2f8; color: var(--muted); cursor: pointer; border: 0;
}
.tab.active { background: #1e4fd6; color: #fff; }
.comp-grid { display: grid; gap: 8px; }
.comp-item {
  border: 1px solid var(--line); border-radius: 10px; padding: 10px;
  cursor: grab; background: #fff; font-size: 13px;
}
.comp-item:hover { border-color: #b8c7ef; }
.tool-row { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.tool-row button { padding: 7px 10px; font-size: 12px; }
.field { margin-bottom: 10px; }
.field label { display: block; font-size: 12px; color: var(--muted); margin-bottom: 4px; }
.field input, .field textarea, .field select {
  width: 100%; border: 1px solid var(--line); border-radius: 8px;
  padding: 8px 10px; font: inherit; background: #fff;
}
.hit { background: #ffe2e2; color: var(--danger); border-radius: 2px; padding: 0 2px; }
.placeholder-block {
  display: flex; align-items: center; justify-content: center;
  color: #607089; font-size: 13px; border-radius: 10px; cursor: pointer;
  border: 1px dashed rgba(0,0,0,.12); min-height: 120px; margin: 12px 0;
  position: relative; overflow: hidden;
}
.placeholder-block img { width: 100%; height: 100%; object-fit: cover; position: absolute; inset: 0; }
.placeholder-block .meta {
  position: absolute; right: 8px; bottom: 8px; background: rgba(0,0,0,.55);
  color: #fff; font-size: 11px; padding: 2px 6px; border-radius: 6px;
}
.vip-lock { opacity: .55; position: relative; }
.vip-lock::after {
  content: "会员"; position: absolute; right: 8px; top: 8px;
  font-size: 10px; background: #111; color: #fff; padding: 2px 6px; border-radius: 999px;
}
.toast {
  position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%);
  background: #111827; color: #fff; padding: 10px 16px; border-radius: 999px;
  font-size: 13px; opacity: 0; pointer-events: none; transition: .2s; z-index: 99;
}
.toast.show { opacity: 1; }
.section-title { font-size: 12px; color: var(--muted); margin: 14px 0 8px; letter-spacing: .08em; text-transform: uppercase; }

@media (max-width: 900px) {
  .hero { grid-template-columns: 1fr; padding-top: 24px; }
  .editor-main { grid-template-columns: 1fr; }
  .side { max-height: 40vh; }
}
