:root{
  --qh-bg:#eef3f9;
  --qh-card:#ffffff;
  --qh-text:#0f172a;
  --qh-muted:#64748b;
  --qh-line:#dbe3ef;
  --qh-code:#171527;
}

*{box-sizing:border-box}

body{
  margin:0;
  background:#edf3f8;
  color:var(--qh-text);
  font-family:Inter,system-ui,-apple-system,Segoe UI,Roboto,sans-serif;
}
.main-content {width: 100%;}
.page-wrap {max-width: 1200px;
  margin: 0 auto;
  padding: 20px 20px 30px;}
.loading-screen{
  min-height:100vh;
  display:flex;
  align-items:center;
  justify-content:center;
  flex-direction:column;
  gap:14px;
}

.logo{
  font-size:32px;
  font-weight:900;
}
.logo span{color:#7c3aed}

.spinner{
  width:34px;
  height:34px;
  border-radius:50%;
  border:3px solid #dbe3ef;
  border-top-color:#7c3aed;
  animation:spin .7s linear infinite;
}
@keyframes spin{to{transform:rotate(360deg)}}

#toasts{
  position:fixed;
  right:16px;
  bottom:16px;
  z-index:12000;
  display:flex;
  flex-direction:column;
  gap:10px;
}

.toast{
  min-width:260px;
  max-width:420px;
  padding:12px 14px;
  border-radius:14px;
  background:#111827;
  color:#fff;
  display:flex;
  gap:10px;
  align-items:flex-start;
  box-shadow:0 16px 38px rgba(0,0,0,.18);
  opacity:0;
  transform:translateY(10px);
  transition:opacity .2s ease, transform .2s ease;
  font-size:14px;
  line-height:1.5;
}
.toast.show{
  opacity:1;
  transform:translateY(0);
}
.toast.t-ok{background:linear-gradient(135deg, #0f766e, #10b981)}
.toast.t-err{background:linear-gradient(135deg, #b91c1c, #ef4444)}

.nav{
  position:sticky;
  top:0;
  z-index:20;
  background:rgba(255,255,255,.72);
  backdrop-filter:blur(12px);
  -webkit-backdrop-filter:blur(12px);
  border-bottom:1px solid rgba(148,163,184,.18);
}
.nav-in{
  max-width:1200px;
  margin:0 auto;
  padding:10px 20px;
}
.nav-links{
  display:flex;
  gap:10px;
  flex-wrap:wrap;
}
.nl{
  border:1px solid #dbe3ef;
  background:#fff;
  color:#0f172a;
  border-radius:12px;
  padding:10px 14px;
  font-size:14px;
  font-weight:700;
  cursor:pointer;
  transition:.2s ease;
}
.nl:hover{
  transform:translateY(-1px);
  box-shadow:0 10px 24px rgba(15,23,42,.06);
}
.nl.on{
  color:#fff;
  border-color:transparent;
  background:linear-gradient(135deg, #7c3aed, #06b6d4);
}

.qh-gen{display:grid;gap:22px}
.qh-grid{
  display:grid;
  grid-template-columns:minmax(320px, 500px) minmax(320px, 1fr);
  gap:22px;
  align-items:start;
}

.qh-card{
  background:#fff;
  border:1px solid var(--qh-line);
  border-radius:22px;
  padding:22px;
  box-shadow:0 14px 34px rgba(15,23,42,.05);
}

.qh-title{
  margin:0 0 8px;
  font-size:34px;
  line-height:1.15;
  color:#0f172a;
}
.qh-sub{
  margin:0 0 18px;
  color:var(--qh-muted);
  line-height:1.7;
  font-size:15px;
}

.qh-form-grid{
  display:grid;
  grid-template-columns:repeat(2, minmax(0, 1fr));
  gap:16px;
}
.qh-span-2{grid-column:1 / -1}

.qh-field label{
  display:block;
  margin-bottom:8px;
  font-size:14px;
  font-weight:700;
  color:#0f172a;
}
.qh-field input[type="text"],
.qh-field select{
  width:100%;
  min-height:46px;
  padding:0 14px;
  border-radius:12px;
  border:1px solid #d8e2ed;
  background:#fff;
  color:#0f172a;
  font-size:15px;
  outline:none;
  transition:border-color .2s ease, box-shadow .2s ease;
}
.qh-field input[type="text"]:focus,
.qh-field select:focus{
  border-color:#8b5cf6;
  box-shadow:0 0 0 4px rgba(139,92,246,.12);
}
.qh-field input[type="color"]{
  width:100%;
  height:46px;
  border-radius:12px;
  border:1px solid #d8e2ed;
  background:#fff;
  padding:6px;
  cursor:pointer;
}

.qh-tip-box{
  margin-top:18px;
  padding:14px 16px;
  border-radius:14px;
  border:1px solid rgba(124,58,237,.12);
  background:linear-gradient(135deg, rgba(124,58,237,.07), rgba(6,182,212,.08));
  color:#334155;
  line-height:1.65;
  font-size:14px;
}

.qh-actions{
  margin-top:18px;
  display:flex;
  flex-wrap:wrap;
  gap:12px;
}

.qh-btn{
  appearance:none;
  border:1px solid #d8e2ed;
  background:#fff;
  color:#0f172a;
  border-radius:12px;
  padding:12px 16px;
  font-size:14px;
  font-weight:700;
  text-decoration:none;
  cursor:pointer;
  transition:.2s ease;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:8px;
}
.qh-btn:hover{
  transform:translateY(-1px);
  box-shadow:0 10px 24px rgba(15,23,42,.06);
}
.qh-btn.pri{
  color:#fff;
  border-color:transparent;
  background:linear-gradient(135deg, #7c3aed, #06b6d4);
}
.qh-btn.danger{
  color:#fff;
  border-color:transparent;
  background:linear-gradient(135deg, #dc2626, #ef4444);
}

.qh-preview{
  width:100%;
  height:700px;
  border:1px solid #dbe3ef;
  border-radius:18px;
  background:#fff;
}

.qh-code-head{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:16px;
  flex-wrap:wrap;
  margin-bottom:14px;
}
.qh-tabs{
  display:flex;
  flex-wrap:wrap;
  gap:10px;
}
.qh-tab{
  appearance:none;
  border:1px solid #d8e2ed;
  background:#fff;
  color:#0f172a;
  border-radius:12px;
  padding:10px 14px;
  font-size:14px;
  font-weight:700;
  cursor:pointer;
  transition:.2s ease;
}
.qh-tab.on{
  color:#fff;
  border-color:transparent;
  background:linear-gradient(135deg, #7c3aed, #06b6d4);
}

.qh-code{
  margin:0;
  min-height:320px;
  max-height:760px;
  overflow:auto;
  padding:18px;
  border-radius:18px;
  border:1px solid #26223d;
  background:var(--qh-code);
  color:#eef2ff;
  font:13px/1.65 ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  white-space:pre-wrap;
  word-break:break-word;
}

.qh-saved-list{
  display:grid;
  gap:14px;
  margin-top:18px;
}
.qh-saved-item{
  display:flex;
  justify-content:space-between;
  gap:16px;
  align-items:center;
  padding:16px;
  border:1px solid #dbe3ef;
  border-radius:16px;
  background:#fff;
}
.qh-saved-main{min-width:0}
.qh-saved-name{
  font-size:18px;
  font-weight:800;
  color:#0f172a;
  margin-bottom:6px;
  word-break:break-word;
}
.qh-saved-meta{
  display:flex;
  flex-wrap:wrap;
  gap:12px;
  color:#64748b;
  font-size:13px;
}
.qh-saved-actions{
  display:flex;
  flex-wrap:wrap;
  gap:10px;
  justify-content:flex-end;
}

.qh-empty{
  margin-top:14px;
  padding:20px;
  border-radius:16px;
  border:1px dashed #cbd5e1;
  background:#f8fafc;
  color:#475569;
  line-height:1.7;
}
.qh-empty--error{
  border-style:solid;
  border-color:#fecaca;
  background:#fef2f2;
  color:#991b1b;
}
.qh-empty-actions{margin-top:14px}

.qh-seo-grid{
  display:grid;
  grid-template-columns:repeat(2, minmax(0, 1fr));
  gap:16px;
  margin-top:18px;
}
.qh-seo-item{
  border:1px solid #dbe3ef;
  border-radius:18px;
  padding:18px;
  background:#fff;
}
.qh-seo-item h3{
  margin:0 0 8px;
  font-size:20px;
  color:#0f172a;
}
.qh-seo-item p{
  margin:0;
  color:#64748b;
  line-height:1.7;
}

@media (max-width: 1024px){
  .qh-grid{grid-template-columns:1fr}
  .qh-seo-grid{grid-template-columns:1fr}
}

@media (max-width: 720px){
  .nav-in{padding-left:14px;padding-right:14px}
  .qh-card{padding:16px;border-radius:18px}
  .qh-title{font-size:28px}
  .qh-form-grid{grid-template-columns:1fr}
  .qh-span-2{grid-column:auto}
  .qh-preview{height:560px}
  .qh-code{padding:14px}
  .qh-saved-item{flex-direction:column;align-items:flex-start}
  .qh-saved-actions{width:100%;justify-content:flex-start}
  #toasts{left:14px;right:14px;bottom:14px}
  .toast{min-width:0;max-width:none}
}