:root {
  --bg: #faf6f0;
  --panel: #ffffff;
  --ink: #2e2a33;
  --muted: #7a7381;
  --accent: #7a4f9e;
  --accent-soft: #efe7f6;
  --line: #e7e0d8;
  --good: #2e7d4f;
  --warn: #b5720f;
  --serp-title: #1a0dab;
  --serp-url: #202124;
  --radius: 14px;
  --shadow: 0 1px 3px rgba(46, 42, 51, 0.08), 0 8px 24px rgba(46, 42, 51, 0.06);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--ink);
  line-height: 1.55;
}

.wrap { max-width: 1180px; margin: 0 auto; padding: 0 20px; }

.site-header {
  background: linear-gradient(135deg, #5f3a80, #8b5cb8);
  color: #fff;
  padding: 34px 0 26px;
}
.site-header h1 { margin: 0 0 6px; font-size: 1.9rem; letter-spacing: -0.5px; }
.site-header .glow { color: #ffd98a; }
.site-header .tagline { margin: 0 0 12px; max-width: 62ch; opacity: 0.94; }
.site-header code { background: rgba(255,255,255,0.16); padding: 1px 5px; border-radius: 5px; }
.badges { margin: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.badge {
  background: rgba(255,255,255,0.16);
  border: 1px solid rgba(255,255,255,0.3);
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 0.78rem;
}

main { padding: 26px 20px 10px; }

.grid {
  display: grid;
  grid-template-columns: minmax(340px, 1fr) minmax(340px, 1fr);
  gap: 20px;
  align-items: start;
}

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 22px 24px;
  margin-bottom: 20px;
}

.panel h2 { margin: 0 0 14px; font-size: 1.25rem; }
.panel h3 { margin: 20px 0 6px; font-size: 1rem; }
.panel pre > code { display: block; }

.field { margin: 12px 0 14px; }
.field label { display: block; font-weight: 600; font-size: 0.9rem; margin-bottom: 4px; }
.field input[type="text"], .field textarea, .field select {
  width: 100%;
  padding: 9px 11px;
  border: 1px solid var(--line);
  border-radius: 9px;
  font: inherit;
  background: #fdfbf8;
  color: var(--ink);
}
.field input:focus, .field textarea:focus, .field select:focus {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
  border-color: var(--accent);
}
.field.three-col { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 10px; }
.field.three-col > span { display: block; }
.field.extras label {
  display: flex;
  gap: 8px;
  align-items: baseline;
  font-weight: 500;
  padding: 4px 0;
}
.color-row { display: flex; gap: 8px; align-items: center; }
.color-row input[type="color"] { width: 44px; height: 38px; border: 1px solid var(--line); border-radius: 8px; padding: 2px; background: #fff; }
.color-row input[type="text"] { flex: 1; }

.count { float: right; font-weight: 500; color: var(--muted); font-size: 0.8rem; }
.count.over { color: var(--warn); }
.hint { color: var(--muted); font-size: 0.84rem; margin: 8px 0 0; }
.mild { color: var(--muted); font-weight: 400; font-size: 0.82rem; }
#robots-explain { background: var(--accent-soft); border-radius: 9px; padding: 8px 12px; }

pre > code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }

.serp {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 16px 18px;
  background: #fff;
  font-family: arial, sans-serif;
}
.serp-top { display: flex; gap: 10px; align-items: center; margin-bottom: 6px; }
.serp-fav {
  width: 26px; height: 26px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.8rem;
  flex-shrink: 0;
}
.serp-site { display: flex; flex-direction: column; line-height: 1.25; }
.serp-site span:first-child { font-size: 0.9rem; color: var(--serp-url); }
.serp-crumb { font-size: 0.8rem; color: #5f6368; white-space: pre; overflow: hidden; text-overflow: ellipsis; }
.serp-title {
  color: var(--serp-title);
  font-size: 1.28rem;
  margin: 2px 0 4px;
  text-decoration: underline;
  text-decoration-color: transparent;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}
.serp-desc { color: #4d5156; font-size: 0.88rem; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }

.share-card {
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
  background: #fff;
  margin-bottom: 6px;
}
.share-img {
  width: 100%;
  aspect-ratio: 1.91 / 1;
  background: linear-gradient(135deg, #8b5cb8 0%, #c8836e 100%);
  background-size: cover;
  background-position: center;
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(255,255,255,0.9);
  font-size: 0.9rem;
}
.share-body { padding: 10px 14px 12px; }
.share-domain { font-size: 0.75rem; text-transform: uppercase; color: var(--muted); letter-spacing: 0.4px; }
.share-title { font-weight: 600; margin: 3px 0; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.share-desc { font-size: 0.86rem; color: #4d5156; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; }
.share-footer { display: flex; align-items: center; gap: 6px; margin-top: 8px; color: var(--muted); font-size: 0.8rem; }
.share-logo { font-size: 0.95rem; color: var(--accent); }

.tweet {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  padding: 12px 14px;
  display: flex;
  gap: 10px;
}
.tweet-avatar {
  width: 40px; height: 40px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  flex-shrink: 0;
}
.tweet-main { flex: 1; min-width: 0; }
.tweet-name { display: flex; gap: 6px; align-items: baseline; font-size: 0.9rem; }
.tweet-msg { font-size: 0.9rem; margin: 2px 0 8px; color: #40474f; }
.x-card {
  border: 1px solid #cfd9de;
  border-radius: 16px;
  overflow: hidden;
}
.share-img, .tweet .x-img { margin: 0; }
.x-img {
  width: 100%;
  aspect-ratio: 1.91 / 1;
  background: linear-gradient(135deg, #8b5cb8 0%, #c8836e 100%);
  background-size: cover;
  background-position: center;
}
.x-card.small .x-img { aspect-ratio: 1 / 1; width: 116px; float: left; border-right: 1px solid #cfd9de; }
.x-card.small::after { content: ""; display: block; clear: both; }
.x-card.small .x-title, .x-card.small .x-desc, .x-card.small .x-footer {
  -webkit-line-clamp: 1;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.x-body { padding: 9px 13px 11px; }
.x-title { font-weight: 600; font-size: 0.9rem; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; }
.x-desc { font-size: 0.84rem; color: #536471; margin-top: 2px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.x-footer { font-size: 0.78rem; color: #536471; margin-top: 6px; }

.warnings { margin: 0; padding: 0; list-style: none; }
.warnings li { padding: 8px 12px; border-radius: 9px; margin: 6px 0; font-size: 0.9rem; }
.warnings li.warn { background: #fdf3e2; color: #7a5518; }
.warnings li.good { background: #e9f4ee; color: #235c3f; }

.codebox-wrap { position: relative; margin: 10px 0 6px; }
.codebox {
  margin: 0;
  background: #2b2430;
  color: #e8dff0;
  border-radius: 12px;
  padding: 16px 18px;
  overflow-x: auto;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.82rem;
  line-height: 1.6;
  white-space: pre;
}
.copy-btn {
  position: absolute;
  top: 10px;
  right: 10px;
  background: rgba(255,255,255,0.12);
  color: #fff;
  border: 1px solid rgba(255,255,255,0.28);
  border-radius: 8px;
  padding: 4px 12px;
  font: inherit;
  font-size: 0.8rem;
  cursor: pointer;
}
.copy-btn:hover { background: rgba(255,255,255,0.22); }
.copy-btn.done { background: #2e7d4f; border-color: #2e7d4f; }

.forge-row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin: 14px 0; }
.file-btn {
  background: var(--accent);
  color: #fff;
  border-radius: 9px;
  padding: 9px 16px;
  cursor: pointer;
  font-weight: 600;
  font-size: 0.9rem;
}
.file-btn:hover { background: #6a4090; }
.letter-row { display: flex; align-items: center; gap: 6px; }
.letter-row input[type="text"] { width: 64px; padding: 7px 9px; border: 1px solid var(--line); border-radius: 8px; font: inherit; text-align: center; }
.letter-row input[type="color"] { width: 40px; height: 36px; padding: 2px; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
button.primary {
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 9px;
  padding: 9px 18px;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}
button.primary:hover { background: #6a4090; }
button.primary:disabled { opacity: 0.55; cursor: wait; }

.fav-strip { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 6px; }
.fav-item { text-align: center; width: 92px; }
.fav-item canvas { border: 1px solid var(--line); border-radius: 8px; background: repeating-conic-gradient(#f4f0ea 0 25%, #ffffff 0 50%) 0 0 / 12px 12px; }
.fav-item .fav-name { font-size: 0.72rem; color: var(--muted); margin-top: 4px; word-break: break-all; }
.fav-item a {
  display: inline-block;
  margin-top: 3px;
  font-size: 0.75rem;
  color: var(--accent);
  font-weight: 600;
  text-decoration: none;
  border: 1px solid var(--accent-soft);
  background: var(--accent-soft);
  border-radius: 6px;
  padding: 2px 8px;
}

.site-footer { padding: 10px 0 34px; color: var(--muted); font-size: 0.85rem; text-align: center; }
.site-footer a { color: var(--accent); }
.site-footer p { margin: 4px 0; }

@media (max-width: 900px) {
  .grid { grid-template-columns: 1fr; }
  .field.three-col { grid-template-columns: 1fr; }
  .site-header h1 { font-size: 1.5rem; }
}
