:root {
  --bg: #f7f8ff;
  --card: #ffffff;
  --text: #111827;
  --muted: #6b7280;
  --line: #e8eaf4;
  --soft: #f5f3ff;
  --primary: #6139f5;
  --primary-2: #7c3aed;
  --success: #22c55e;
  --danger: #ef4444;
  --radius: 12px;
  --shadow: 0 18px 50px rgba(31, 41, 55, .08);
  font-family: Inter, "PingFang SC", "Microsoft YaHei", ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; min-height: 100vh; color: var(--text); background: var(--bg); }
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(circle at 12% 4%, rgba(97, 57, 245, .12), transparent 28%),
    radial-gradient(circle at 78% 0%, rgba(124, 58, 237, .10), transparent 28%),
    linear-gradient(180deg, #fbfbff 0%, #f8f9ff 52%, #eef2ff 100%);
}
a { color: inherit; text-decoration: none; }
button, a, label, .catalog-card { cursor: pointer; }
button, input, textarea, select { font: inherit; }
svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.shared-photo-input {
  position: fixed;
  left: -9999px;
  top: 0;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: grid;
  grid-template-columns: 250px 1fr minmax(430px, auto);
  align-items: center;
  gap: 20px;
  height: 72px;
  padding: 0 clamp(22px, 3vw, 40px);
  border-bottom: 1px solid rgba(232, 234, 244, .84);
  background: rgba(255, 255, 255, .86);
  backdrop-filter: blur(18px);
}
.brand { display: inline-flex; align-items: center; gap: 10px; font-size: 20px; font-weight: 950; }
.brand-mark {
  display: inline-grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 10px;
  color: #fff;
  background: linear-gradient(135deg, var(--primary), #7c3aed);
}
.top-links { display: flex; justify-content: center; gap: 44px; color: #374151; font-size: 14px; }
.top-links a { position: relative; padding: 25px 0; }
.top-links a.active, .top-links a:hover { color: var(--primary); }
.top-links a.active::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 14px;
  height: 2px;
  border-radius: 99px;
  background: var(--primary);
}
.top-key {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 18px;
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #f7f5ff;
}
.top-key span {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--primary);
  font-weight: 800;
  font-size: 13px;
  white-space: nowrap;
}
.top-key svg { width: 16px; height: 16px; }
.top-key small { color: var(--primary); font-size: 13px; white-space: nowrap; }
.top-key button,
.top-key .share-entry {
  border: 0;
  border-left: 1px solid #ddd6fe;
  padding: 0 0 0 18px;
  color: var(--primary);
  background: transparent;
  font-weight: 900;
  white-space: nowrap;
}
.menu-btn { display: none; border: 0; background: transparent; }
.menu-btn span { display: block; width: 18px; height: 2px; margin: 4px 0; background: #111827; }
.top-guide-link {
  display: none;
  justify-self: end;
  min-height: 34px;
  align-items: center;
  justify-content: center;
  padding: 0 14px;
  border: 1px solid #ded7ff;
  border-radius: 999px;
  color: var(--primary);
  background: #fff;
  font-size: 13px;
  font-weight: 950;
}
.top-guide-link.active {
  color: #fff;
  border-color: transparent;
  background: linear-gradient(135deg, var(--primary), var(--primary-2));
}

.studio-layout {
  width: min(1840px, calc(100% - 48px));
  margin: 0 auto 52px;
  display: flex;
  flex-direction: column;
}
.home-hero { order: 1; }
.guide-section { order: 2; }
.template-market { order: 3; margin-top: 0; }
.maker-shell { order: 4; }
.home-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 34px;
  align-items: center;
  padding: 66px 36px 44px;
}
.home-copy h1 {
  margin: 0;
  font-size: clamp(42px, 4vw, 68px);
  line-height: 1.12;
  font-weight: 950;
  letter-spacing: 0;
}
.home-copy h1 span { color: var(--primary); }
.home-copy p { margin: 22px 0 42px; max-width: 620px; color: #4b5563; font-size: 19px; line-height: 1.8; }
.hero-flow { display: flex; gap: 28px; flex-wrap: wrap; }
.hero-flow article { display: grid; grid-template-columns: 48px 1fr; gap: 12px; align-items: center; min-width: 190px; }
.hero-flow article span {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  color: var(--primary);
  background: #fff;
  box-shadow: 0 8px 24px rgba(97, 57, 245, .12);
}
.hero-flow strong { display: block; font-size: 14px; }
.hero-flow small { display: block; margin-top: 4px; color: var(--muted); font-size: 12px; }
.hero-sample { position: relative; justify-self: center; width: 280px; }
.hero-sample > small {
  position: absolute;
  top: 4px;
  left: -92px;
  color: #111827;
  transform: rotate(-12deg);
}
.hero-sample > small::after {
  content: "";
  display: block;
  width: 62px;
  height: 38px;
  border-left: 2px solid #111827;
  border-bottom: 2px solid #111827;
  border-radius: 0 0 0 40px;
  transform: translate(66px, -8px) rotate(16deg);
}

.section-title { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; }
.section-title h2 { margin: 0; font-size: 20px; }
.section-title a { color: var(--primary); font-weight: 800; }
.guide-section {
  margin-bottom: 28px;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255,255,255,.9);
  box-shadow: var(--shadow);
}
.guide-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 22px;
  align-items: stretch;
}
.guide-steps {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}
.guide-steps article {
  display: grid;
  grid-template-columns: 42px 1fr;
  gap: 12px;
  min-height: 136px;
  padding: 18px;
  border: 1px solid #ece9ff;
  border-radius: 10px;
  background: #fff;
}
.guide-steps span {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  color: #fff;
  background: var(--primary);
  font-weight: 950;
}
.guide-steps strong, .guide-aside h3 { font-size: 17px; }
.guide-steps p {
  margin: 8px 0 0;
  color: var(--muted);
  line-height: 1.75;
}
.guide-aside {
  padding: 22px;
  border: 1px solid #ded7ff;
  border-radius: 10px;
  background: #fbfaff;
}
.guide-aside h3 { margin: 0 0 16px; }
.guide-aside dl { margin: 0; display: grid; gap: 14px; }
.guide-aside div {
  padding-bottom: 14px;
  border-bottom: 1px solid #ebe6ff;
}
.guide-aside div:last-child { padding-bottom: 0; border-bottom: 0; }
.guide-aside dt { color: var(--text); font-weight: 900; }
.guide-aside dd { margin: 6px 0 0; color: var(--muted); line-height: 1.7; }
.tutorial-page {
  min-height: 100vh;
  background:
    radial-gradient(circle at 14% 6%, rgba(124, 58, 237, .16), transparent 28%),
    linear-gradient(180deg, #f8f5ff 0%, #f7f8fb 46%, #eef2ff 100%);
}
.tutorial-layout {
  width: min(1040px, calc(100% - 40px));
  margin: 34px auto 72px;
  display: grid;
  gap: 18px;
}
.tutorial-hero,
.tutorial-card {
  border: 1px solid #eee7ff;
  border-radius: 24px;
  background: rgba(255,255,255,.94);
  box-shadow: 0 18px 46px rgba(31,41,55,.08);
}
.tutorial-hero {
  display: grid;
  gap: 16px;
  padding: clamp(24px, 5vw, 42px);
}
.tutorial-hero h1 {
  max-width: 720px;
  margin: 0;
  color: #151226;
  font-size: clamp(32px, 5vw, 52px);
  line-height: 1.12;
  letter-spacing: 0;
}
.tutorial-hero p:not(.eyebrow) {
  max-width: 720px;
  margin: 0;
  color: #4b5563;
  font-size: 16px;
  line-height: 1.8;
}
.tutorial-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  max-width: 440px;
}
.tutorial-actions .ghost-btn {
  color: var(--primary);
  border-color: #ded7ff;
  background: #fff;
}
.tutorial-card {
  padding: 24px;
}
.tutorial-flow {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}
.tutorial-flow article {
  display: grid;
  gap: 10px;
  padding: 16px;
  border: 1px solid #eee7ff;
  border-radius: 18px;
  background: #fbfaff;
}
.tutorial-flow span {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 12px;
  color: #fff;
  background: linear-gradient(135deg, var(--primary), var(--primary-2));
  font-weight: 950;
}
.tutorial-flow strong,
.tutorial-card h2,
.tutorial-faq dt {
  color: #151226;
}
.tutorial-flow p,
.tutorial-card li,
.tutorial-faq dd {
  margin: 0;
  color: #667085;
  line-height: 1.7;
}
.tutorial-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}
.tutorial-card h2 {
  margin: 0 0 14px;
  font-size: 22px;
  letter-spacing: 0;
}
.tutorial-card ul {
  display: grid;
  gap: 10px;
  margin: 0;
  padding-left: 20px;
}
.tutorial-faq {
  display: grid;
  gap: 12px;
  margin: 0;
}
.tutorial-faq div {
  padding: 14px;
  border: 1px solid #eee7ff;
  border-radius: 16px;
  background: #fbfaff;
}
.tutorial-faq dt {
  font-weight: 950;
}
.tutorial-faq dd {
  margin-top: 6px;
}
.category-tabs {
  display: flex;
  gap: 16px;
  align-items: center;
  overflow-x: auto;
  padding-bottom: 4px;
  margin-bottom: 20px;
}
.category-tabs::-webkit-scrollbar,
.template-picker-list::-webkit-scrollbar {
  display: none;
}
.category-tabs button {
  flex: 0 0 auto;
  min-width: 64px;
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: #374151;
  transition: .2s ease;
}
.category-tabs button.active, .category-tabs button:hover { color: #fff; border-color: var(--primary); background: var(--primary); }
.catalog-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 22px; }
.catalog-card {
  position: relative;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  box-shadow: var(--shadow);
}
.catalog-card.selected { border-color: var(--primary); box-shadow: 0 0 0 2px rgba(97, 57, 245, .14), var(--shadow); }
.catalog-card b {
  position: absolute;
  top: 12px;
  left: 12px;
  z-index: 2;
  padding: 4px 8px;
  border-radius: 6px;
  color: #fff;
  background: #ef4444;
  font-size: 12px;
}
.catalog-card strong { display: block; margin-top: 12px; font-size: 16px; }
.catalog-card small { display: block; margin-top: 4px; color: var(--muted); }
.catalog-card a {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 38px;
  margin-top: 12px;
  border-radius: 7px;
  color: #fff;
  font-weight: 900;
  background: var(--primary);
}

.maker-shell {
  margin-top: 24px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255,255,255,.88);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.maker-header {
  display: grid;
  grid-template-columns: 170px 1fr auto 170px;
  gap: 16px;
  align-items: center;
  min-height: 70px;
  padding: 0 22px;
  border-bottom: 1px solid var(--line);
}
.maker-header a { display: inline-flex; align-items: center; gap: 8px; color: #4b5563; }
.maker-header h2 { margin: 0; text-align: center; font-size: 19px; }
.maker-header button {
  border: 0;
  border-radius: 8px;
  padding: 9px 14px;
  color: var(--primary);
  background: #f4f1ff;
  font-weight: 900;
}
.maker-key {
  display: grid;
  gap: 2px;
  justify-self: end;
  padding: 9px 12px;
  border-radius: 9px;
  background: #f9fafb;
}
.maker-key span { font-size: 13px; font-weight: 900; }
.maker-key small { color: var(--muted); font-size: 12px; }
.stepper {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 26px;
  padding: 32px 56px 24px;
}
.stepper span {
  position: relative;
  display: grid;
  justify-items: center;
  gap: 8px;
  color: #4b5563;
  font-size: 14px;
}
.stepper span:not(:last-child)::after {
  content: "";
  position: absolute;
  top: 14px;
  left: calc(50% + 32px);
  width: calc(100% - 44px);
  height: 1px;
  background: #d9ddec;
}
.stepper b {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #eef0f6;
}
.stepper .active { color: var(--primary); font-weight: 900; }
.stepper .active b { color: #fff; background: var(--primary); }

.maker-grid {
  display: grid;
  grid-template-columns: 310px minmax(0, 1fr);
  gap: 24px;
  padding: 0 22px 28px;
}
.maker-card {
  width: min(760px, calc(100% - 44px));
  margin: 0 auto 34px;
  padding: 34px 40px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
  box-shadow: var(--shadow);
}
.maker-step + .maker-step,
.maker-submit {
  margin-top: 26px;
}
.upload-row {
  display: grid;
  grid-template-columns: 180px 170px;
  gap: 34px;
  align-items: center;
}
.avatar-preview {
  position: relative;
  width: 180px;
  height: 180px;
  overflow: hidden;
  border-radius: 50%;
  background: linear-gradient(155deg, #eef0f6, #fde68a);
}
.avatar-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.compact-upload {
  width: 170px;
  height: 148px;
}
.template-tabs {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 16px;
}
.template-tabs button {
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: 7px;
  color: #374151;
  background: #fff;
}
.template-tabs button.active,
.template-tabs button:hover {
  color: #fff;
  border-color: var(--primary);
  background: var(--primary);
}
.template-picker-list {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}
.template-thumb-card {
  display: grid;
  gap: 8px;
}
.template-thumb-card input {
  position: absolute;
  inline-size: 1px;
  block-size: 1px;
  min-height: 0;
  opacity: 0;
  pointer-events: none;
}
.template-thumb-card .preview-grid {
  border: 2px solid transparent;
  border-radius: 8px;
}
.template-thumb-card:has(input:checked) .preview-grid {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(97, 57, 245, .12);
}
.template-thumb-card .catalog-preview figcaption {
  display: none;
}
.template-thumb-card strong {
  color: #374151;
  font-size: 13px;
  text-align: center;
}
.template-thumb-card.fake {
  pointer-events: none;
}
.copy-step .step-head button {
  margin-left: auto;
  border: 0;
  color: var(--primary);
  background: transparent;
  font-weight: 900;
}
.maker-submit .primary-btn {
  min-height: 56px;
  font-size: 18px;
}
.panel {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  box-shadow: 0 10px 28px rgba(31, 41, 55, .045);
  padding: 22px;
}
.upload-panel { grid-row: span 2; }
.effect-panel { min-height: 420px; }
.text-panel { grid-column: 1 / 2; }
.settings-panel { grid-column: 2 / 3; }
.step-head { display: flex; gap: 8px; align-items: center; margin-bottom: 14px; }
.step-head span, .step-head em {
  display: inline-grid;
  place-items: center;
  border-radius: 999px;
  font-style: normal;
  font-weight: 900;
}
.step-head span { width: 22px; height: 22px; color: #fff; background: var(--primary); font-size: 13px; }
.step-head em { padding: 3px 8px; color: #16a34a; background: #dcfce7; font-size: 12px; }
.step-head strong { font-size: 18px; }
.step-head small { color: var(--muted); }
.panel p { margin: 0 0 18px; color: var(--muted); }
.panel h3 { margin: 18px 0 12px; font-size: 16px; }
.panel h3 small { color: var(--muted); font-weight: 500; }

.upload-box {
  display: grid;
  place-items: center;
  gap: 10px;
  height: 190px;
  border: 1.5px dashed #b7a8ff;
  border-radius: 10px;
  color: var(--primary);
  background: linear-gradient(180deg, #fff, #fbfaff);
  text-align: center;
}
.upload-box.compact-upload {
  width: 170px;
  height: 148px;
}
.upload-box input { position: absolute; inline-size: 1px; block-size: 1px; opacity: 0; pointer-events: none; }
.upload-box svg { width: 42px; height: 42px; }
.upload-box small { color: var(--muted); }
.default-photo {
  position: relative;
  overflow: hidden;
  border: 1.5px solid var(--primary);
  border-radius: 12px;
  aspect-ratio: 4 / 3;
  background: linear-gradient(155deg, #f3f4f6, #fde68a);
}
.default-photo img { width: 100%; height: 100%; object-fit: cover; }
.default-photo i {
  position: absolute;
  top: 12px;
  right: 12px;
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  color: #fff;
  background: var(--primary);
}
.tips-card {
  margin-top: 18px;
  padding: 16px;
  border: 1px solid #ded7ff;
  border-radius: 10px;
  color: var(--primary);
  background: #fbfaff;
}
.tips-card ul { margin: 10px 0 0; padding-left: 18px; color: #4b5563; line-height: 1.8; }

.preview-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 4px;
  overflow: hidden;
  border-radius: 9px;
  background: #d1d5db;
}
.preview-grid figure {
  position: relative;
  margin: 0;
  aspect-ratio: 1;
  overflow: hidden;
  background: linear-gradient(155deg, #e5e7eb, #fef3c7);
}
.mini-grid { width: min(280px, 100%); box-shadow: 0 18px 40px rgba(31,41,55,.14); }
.catalog-preview { grid-template-columns: repeat(3, 1fr); }
.big-preview { max-width: 690px; }
.template-cover-img {
  grid-column: 1 / -1;
  display: block;
  width: 100%;
  aspect-ratio: 1.24;
  object-fit: cover;
  background: #fff;
}
.template-thumb-card .template-cover-img { aspect-ratio: 1; }
.face-placeholder {
  position: absolute;
  inset: 14% 22% 22%;
  border-radius: 45% 45% 40% 40%;
  background:
    radial-gradient(circle at 38% 42%, #111827 0 3px, transparent 4px),
    radial-gradient(circle at 63% 42%, #111827 0 3px, transparent 4px),
    radial-gradient(circle at 50% 62%, #ef4444 0 8px, transparent 9px),
    linear-gradient(#fde68a, #f9a8d4);
  box-shadow: 0 32px 0 18px #d1d5db;
}
.face-placeholder.portrait { inset: 13% 28% 22%; }
.preview-grid figcaption {
  position: absolute;
  left: 5px;
  right: 5px;
  bottom: 7px;
  color: #fff;
  font-size: clamp(13px, 1.1vw, 24px);
  font-weight: 950;
  text-align: center;
  text-shadow: 0 2px 0 #111827, 2px 0 0 #111827, -2px 0 0 #111827, 0 -2px 0 #111827;
}
.template-preview {
  --bg-a: #f8fafc;
  --bg-b: #dbeafe;
  --accent: #6d5dfc;
  --accent-2: #ff7a90;
  background: color-mix(in srgb, var(--accent) 28%, #eef2ff);
}
.template-preview figure {
  background:
    radial-gradient(circle at 78% 18%, rgba(255,255,255,.72) 0 9px, transparent 10px),
    linear-gradient(145deg, var(--bg-a), var(--bg-b));
}
.template-preview figure:nth-child(2n) { filter: saturate(1.06) hue-rotate(5deg); }
.template-preview figure:nth-child(3n) { filter: saturate(1.12) hue-rotate(-7deg); }
.template-preview .face-placeholder {
  inset: 17% 24% 24%;
  border-radius: 46% 46% 38% 38%;
  background:
    radial-gradient(circle at 37% 43%, #111827 0 2px, transparent 3px),
    radial-gradient(circle at 63% 43%, #111827 0 2px, transparent 3px),
    radial-gradient(ellipse at 50% 64%, #ef4444 0 5px, transparent 6px),
    linear-gradient(#ffe5c2, #ffd0ac);
  box-shadow:
    0 21px 0 15px color-mix(in srgb, var(--accent) 35%, #cbd5e1),
    0 -10px 0 4px color-mix(in srgb, var(--accent) 45%, #1f2937);
}
.template-preview .face-placeholder::before,
.template-preview .face-placeholder::after {
  content: "";
  position: absolute;
  pointer-events: none;
}
.template-preview .face-placeholder::before {
  left: -20%;
  right: -20%;
  bottom: -48%;
  height: 42%;
  border-radius: 999px 999px 0 0;
  background: color-mix(in srgb, var(--accent) 74%, #fff);
}
.template-preview .face-placeholder::after {
  right: -22%;
  top: -16%;
  width: 26%;
  height: 26%;
  border-radius: 50%;
  background: var(--accent-2);
  box-shadow: 0 0 0 3px rgba(255,255,255,.7);
}
.tpl-office { --bg-a: #eef2ff; --bg-b: #c7d2fe; --accent: #4f46e5; --accent-2: #22c55e; }
.tpl-office figure:nth-child(1)::before,
.tpl-office figure:nth-child(4)::before {
  content: "";
  position: absolute;
  left: 9px;
  top: 9px;
  width: 22px;
  height: 14px;
  border-radius: 4px;
  background: rgba(79,70,229,.76);
  box-shadow: 0 3px 0 rgba(255,255,255,.55) inset;
}
.tpl-cat { --bg-a: #fff1f2; --bg-b: #fbcfe8; --accent: #f472b6; --accent-2: #f59e0b; }
.tpl-cat .face-placeholder::after {
  left: -18%;
  right: auto;
  top: -28%;
  width: 42%;
  height: 34%;
  border-radius: 55% 55% 8px 8px;
  background: var(--accent);
  transform: rotate(-18deg);
  box-shadow: 46px 13px 0 -2px var(--accent);
}
.tpl-panda { --bg-a: #f8fafc; --bg-b: #d1d5db; --accent: #111827; --accent-2: #34d399; }
.tpl-panda .face-placeholder {
  border-radius: 50%;
  background:
    radial-gradient(circle at 34% 42%, #111827 0 8px, transparent 9px),
    radial-gradient(circle at 66% 42%, #111827 0 8px, transparent 9px),
    radial-gradient(circle at 50% 64%, #ef4444 0 5px, transparent 6px),
    #fff;
  box-shadow: -12px -8px 0 1px #111827, 12px -8px 0 1px #111827, 0 22px 0 14px #111827;
}
.tpl-pet { --bg-a: #fff7ed; --bg-b: #fed7aa; --accent: #b45309; --accent-2: #60a5fa; }
.tpl-pet .face-placeholder { border-radius: 42% 42% 48% 48%; }
.tpl-pet .face-placeholder::after {
  left: -28%;
  top: 12%;
  width: 30%;
  height: 44%;
  border-radius: 999px;
  background: #92400e;
  box-shadow: 66px 0 0 #92400e;
}
.tpl-funny { --bg-a: #fef08a; --bg-b: #f97316; --accent: #7c2d12; --accent-2: #ef4444; }
.tpl-funny figure { transform: rotate(var(--tilt, 0deg)); }
.tpl-funny figure:nth-child(odd) { --tilt: -1.5deg; }
.tpl-funny figure:nth-child(even) { --tilt: 1.4deg; }
.tpl-funny .face-placeholder { box-shadow: 0 20px 0 15px #7c2d12, 0 -9px 0 5px #111827; }
.tpl-holiday { --bg-a: #fee2e2; --bg-b: #fca5a5; --accent: #dc2626; --accent-2: #facc15; }
.tpl-holiday .face-placeholder::after {
  left: 22%;
  top: -30%;
  width: 56%;
  height: 26%;
  border-radius: 999px 999px 8px 8px;
  background: #dc2626;
  box-shadow: 0 -7px 0 -2px #fff;
}
.tpl-idol { --bg-a: #ede9fe; --bg-b: #a5b4fc; --accent: #7c3aed; --accent-2: #22d3ee; }
.tpl-idol figure::after {
  content: "";
  position: absolute;
  inset: 7px;
  border: 1px solid rgba(255,255,255,.75);
  border-radius: 8px;
  box-shadow: 0 0 18px rgba(34,211,238,.5);
}
.tpl-duck { --bg-a: #fef9c3; --bg-b: #fde68a; --accent: #facc15; --accent-2: #f97316; }
.tpl-duck .face-placeholder {
  border-radius: 50% 50% 44% 44%;
  background:
    radial-gradient(circle at 38% 43%, #111827 0 2px, transparent 3px),
    radial-gradient(circle at 62% 43%, #111827 0 2px, transparent 3px),
    radial-gradient(ellipse at 50% 64%, #fb923c 0 9px, transparent 10px),
    #fde047;
  box-shadow: 0 22px 0 14px #facc15;
}

.compact-template-list {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin-bottom: 16px;
}
.template-card {
  display: grid;
  gap: 4px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #fff;
}
.template-card input, .mode-card input {
  position: absolute;
  inline-size: 1px;
  block-size: 1px;
  min-height: 0;
  opacity: 0;
  pointer-events: none;
}
.template-card span { font-weight: 900; }
.template-card small { color: var(--muted); font-size: 12px; }
.template-card:has(input:checked) { border-color: var(--primary); box-shadow: 0 0 0 2px rgba(97, 57, 245, .12); }
.text-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}
.text-grid label { position: relative; display: block; }
.text-grid label span {
  position: absolute;
  top: 50%;
  left: 14px;
  transform: translateY(-50%);
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  color: #6b7280;
  background: #f3f4f6;
  font-size: 12px;
}
input, textarea, select {
  width: 100%;
  min-height: 46px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #fff;
  color: var(--text);
  outline: none;
  padding: 11px 14px;
}
.text-grid input { padding-left: 48px; }
input:focus, textarea:focus, select:focus, button:focus-visible, a:focus-visible {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(97, 57, 245, .14);
}
.text-actions { display: flex; gap: 12px; margin-top: 18px; }
.text-actions button {
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f9fafb;
  color: #4b5563;
  padding: 0 16px;
}
.mode-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.mode-card {
  display: grid;
  gap: 6px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
}
.mode-card.active { border-color: var(--primary); background: #fbfaff; box-shadow: 0 0 0 2px rgba(97, 57, 245, .10); }
.mode-card strong { color: var(--primary); }
.mode-card small { color: var(--muted); }
.count-control {
  display: inline-grid;
  grid-template-columns: 44px 70px 44px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
}
.count-control button { border: 0; background: #f9fafb; }
.count-control span { display: grid; place-items: center; min-height: 40px; background: #fff; }

.primary-btn, .ghost-btn, .key-form button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
  border-radius: 9px;
  border: 1px solid transparent;
  padding: 0 18px;
  font-weight: 950;
  text-decoration: none;
}
.primary-btn, .key-form button { width: 100%; color: #fff; background: linear-gradient(135deg, var(--primary), #7c3aed); }
.primary-btn:disabled { opacity: .55; cursor: wait; }
.cost-hint { display: block; margin: 10px 0; text-align: center; color: var(--muted); }
.form-message { min-height: 24px; margin: 10px 0 0; color: var(--primary); font-weight: 900; }
.global-toast {
  position: fixed;
  top: max(14px, env(safe-area-inset-top));
  left: 50%;
  z-index: 9999;
  width: min(560px, calc(100% - 32px));
  min-height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px 18px;
  border: 1px solid #ded7ff;
  border-radius: 12px;
  color: var(--primary);
  background: rgba(255, 255, 255, .96);
  box-shadow: 0 18px 45px rgba(37, 32, 84, .18);
  backdrop-filter: blur(16px);
  text-align: center;
  line-height: 1.55;
  font-weight: 950;
  pointer-events: none;
  opacity: 0;
  transform: translate(-50%, -14px);
  transition: opacity .2s ease, transform .2s ease;
}
.global-toast.is-visible {
  opacity: 1;
  transform: translate(-50%, 0);
}
.global-toast.is-success { border-color: #bbf7d0; color: #15803d; background: rgba(240, 253, 244, .96); }
.global-toast.is-error { border-color: #fecaca; color: #b91c1c; background: rgba(254, 242, 242, .97); }

.results {
  margin-top: 28px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  box-shadow: var(--shadow);
  padding: 24px;
}
.result-page {
  min-height: 100vh;
  background:
    radial-gradient(circle at 18% 8%, rgba(139, 92, 246, .16), transparent 28%),
    linear-gradient(180deg, #f7f4ff 0%, #f8fafc 42%, #ffffff 100%);
}
.result-page .workspace {
  width: min(1040px, calc(100% - 40px));
  margin: 0 auto;
  padding: 34px 0 72px;
}
.results.results--standalone {
  margin-top: 0;
  border-color: #ebe7ff;
  border-radius: 24px;
  padding: clamp(20px, 4vw, 34px);
  background: rgba(255, 255, 255, .94);
  box-shadow: 0 24px 64px rgba(42, 35, 80, .12);
}
.section-head { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin-bottom: 18px; }
.eyebrow { margin: 0 0 4px; color: var(--primary); font-weight: 900; text-transform: uppercase; }
.result-head {
  align-items: flex-start;
  padding-bottom: 18px;
  border-bottom: 1px solid #f0edff;
}
.result-head h1 {
  margin: 8px 0 8px;
  color: #151226;
  font-size: clamp(28px, 4.2vw, 42px);
  line-height: 1.12;
  letter-spacing: 0;
}
.result-subtitle {
  max-width: 560px;
  margin: 0;
  color: #667085;
  font-size: 15px;
  line-height: 1.7;
}
.result-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin: 0 0 16px;
}
.result-summary article {
  display: grid;
  gap: 6px;
  padding: 14px;
  border: 1px solid #eee7ff;
  border-radius: 16px;
  background: linear-gradient(180deg, #fbfaff, #fff);
}
.result-summary small {
  color: #8a819f;
  font-size: 12px;
  font-weight: 850;
}
.result-summary strong {
  color: #221a3d;
  font-size: 20px;
  line-height: 1.1;
}
.download-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}
.download-actions .primary-btn,
.download-actions .ghost-btn {
  width: auto;
  min-width: 150px;
  white-space: nowrap;
}
.result-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-top: 18px; }
.result-grid a { position: relative; display: block; border-radius: 9px; overflow: hidden; background: #f3f4f6; }
.result-grid a span {
  position: absolute;
  left: 7px;
  top: 7px;
  z-index: 1;
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 999px;
  color: #fff;
  background: rgba(17, 24, 39, .32);
  box-shadow: 0 4px 12px rgba(17, 24, 39, .10);
  backdrop-filter: blur(5px);
  font-size: 11px;
  font-weight: 950;
}
.result-grid img { display: block; width: 100%; aspect-ratio: 1; object-fit: cover; }
.result-status-card {
  display: grid;
  justify-items: center;
  gap: 12px;
  padding: clamp(28px, 7vw, 52px) 18px;
  border: 1px dashed #c4b5fd;
  border-radius: 14px;
  color: #312e81;
  background: linear-gradient(180deg, #faf8ff, #fff);
  text-align: center;
}
.result-status-card strong { font-size: 24px; }
.result-status-card p {
  max-width: 560px;
  margin: 0;
  color: var(--text);
  line-height: 1.7;
}
.result-status-card small { color: var(--muted); }
.result-status-card--failed {
  border-color: #fecaca;
  color: #991b1b;
  background: #fff7f7;
}
.result-empty-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 180px));
  gap: 10px;
  justify-content: center;
  width: 100%;
}
.result-empty-actions .ghost-btn {
  color: var(--primary);
  border-color: #ddd6fe;
  background: #fff;
}
.loading-ring {
  width: 54px;
  height: 54px;
  border: 5px solid #e9e3ff;
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}
.notice { border: 1px solid #ddd6fe; border-radius: 9px; padding: 12px 14px; color: #5b21b6; background: #f5f3ff; }
.notice--danger { border-color: #fecaca; color: #b91c1c; background: #fef2f2; }
.share-panel {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  margin-top: 18px;
  padding: 18px;
  border-radius: 10px;
  color: #fff;
  background: linear-gradient(135deg, #6139f5, #7c3aed);
}
.share-panel button { border: 1px solid rgba(255,255,255,.45); border-radius: 8px; color: #fff; background: rgba(255,255,255,.12); padding: 0 16px; }
.share-panel small { display: block; color: rgba(255,255,255,.78); }
.share-panel code { grid-column: 1 / -1; padding: 12px; border-radius: 8px; color: var(--primary); background: #fff; overflow-wrap: anywhere; }

.share-layout {
  width: min(980px, calc(100% - 40px));
  margin: 42px auto 64px;
  display: grid;
  gap: 18px;
}
.share-hero-card,
.share-card,
.share-rules article {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255,255,255,.92);
  box-shadow: var(--shadow);
}
.share-hero-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 24px;
  align-items: center;
  padding: 34px;
}
.share-hero-card h1 {
  margin: 0;
  font-size: clamp(32px, 4vw, 52px);
  line-height: 1.12;
  font-weight: 950;
  letter-spacing: 0;
}
.share-hero-card p:not(.eyebrow) {
  margin: 16px 0 0;
  color: var(--muted);
  font-size: 17px;
  line-height: 1.8;
}
.share-stats {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}
.share-stats article {
  min-height: 116px;
  padding: 18px;
  border-radius: 10px;
  color: var(--primary);
  background: #f7f5ff;
}
.share-stats small { display: block; color: var(--muted); }
.share-stats strong { display: inline-block; margin-top: 10px; font-size: 38px; line-height: 1; }
.share-stats span { margin-left: 4px; font-weight: 900; }
.share-card { padding: 24px; }
.share-card h2 { margin: 0 0 14px; font-size: 22px; }
.distributor-code-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.distributor-code-grid article {
  padding: 18px;
  border: 1px solid #ded7ff;
  border-radius: 10px;
  background: #fbfaff;
}
.distributor-code-grid small,
.distributor-code-grid span {
  display: block;
  color: var(--muted);
}
.distributor-code-grid strong {
  display: block;
  margin: 8px 0;
  color: var(--primary);
  font-size: 20px;
  overflow-wrap: anywhere;
}
.share-url-box {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  padding: 10px;
  border: 1px solid #ded7ff;
  border-radius: 10px;
  background: #fbfaff;
}
.share-url-box code {
  display: flex;
  align-items: center;
  min-height: 46px;
  padding: 0 12px;
  border-radius: 8px;
  background: #fff;
  color: var(--primary);
  overflow-wrap: anywhere;
}
.share-url-box button {
  border: 0;
  border-radius: 8px;
  padding: 0 18px;
  color: #fff;
  background: var(--primary);
  font-weight: 950;
}
.share-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 16px;
}
.ghost-btn { color: var(--primary); border-color: #ded7ff; background: #fff; }
.share-rules {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}
.share-rules article {
  padding: 18px;
}
.share-rules span {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  margin-bottom: 12px;
  border-radius: 50%;
  color: #fff;
  background: var(--primary);
  font-weight: 950;
}
.share-rules strong { display: block; font-size: 16px; }
.share-rules p { margin: 8px 0 0; color: var(--muted); line-height: 1.7; }

.records-layout {
  width: min(980px, calc(100% - 40px));
  margin: 38px auto 64px;
  display: grid;
  gap: 18px;
}
.records-head,
.records-empty,
.record-card {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255,255,255,.92);
  box-shadow: var(--shadow);
}
.records-head { padding: 30px; }
.records-head h1 { margin: 0; font-size: clamp(30px, 4vw, 48px); line-height: 1.15; }
.records-head p:not(.eyebrow) { margin: 12px 0 0; color: var(--muted); line-height: 1.8; }
.record-scope-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
}
.record-scope-tabs a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  padding: 0 14px;
  border: 1px solid #e8ddff;
  border-radius: 999px;
  color: #4b5563;
  background: #fff;
  font-size: 13px;
  font-weight: 900;
}
.record-scope-tabs a.active {
  color: #fff;
  border-color: transparent;
  background: linear-gradient(135deg, var(--primary), var(--primary-2));
}
.records-empty {
  display: grid;
  gap: 12px;
  justify-items: start;
  padding: 28px;
}
.records-empty strong { font-size: 20px; }
.records-empty p { margin: 0; color: var(--muted); }
.records-list { display: grid; gap: 12px; }
.record-card {
  display: grid;
  grid-template-columns: 112px minmax(0, 1fr) 130px;
  gap: 16px;
  align-items: center;
  padding: 18px;
}
.record-thumb {
  display: block;
  overflow: hidden;
  width: 112px;
  aspect-ratio: 1;
  border: 1px solid #eee7ff;
  border-radius: 14px;
  background: #faf8ff;
  box-shadow: 0 8px 22px rgba(31,41,55,.08);
}
.record-thumb img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.record-thumb-placeholder {
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  color: var(--primary);
  background: linear-gradient(135deg, #faf8ff, #eef2ff);
}
.record-thumb-placeholder .loading-ring {
  width: 34px;
  height: 34px;
  border-width: 4px;
}
.record-thumb-placeholder svg {
  width: 34px;
  height: 34px;
  opacity: .72;
}
.record-card strong { display: inline-block; margin-right: 8px; font-size: 17px; }
.record-card p { margin: 8px 0 0; color: var(--muted); line-height: 1.6; }
.record-license-badge {
  display: block;
  margin-top: 8px;
  color: #7c3aed;
  font-size: 12px;
  font-style: normal;
  font-weight: 900;
}
.record-error { color: var(--danger) !important; }
.record-status {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 9px;
  border-radius: 999px;
  background: #eef0f6;
  color: #4b5563;
  font-size: 12px;
  font-weight: 900;
}
.record-status--success { color: #047857; background: #d1fae5; }
.record-status--running,
.record-status--pending { color: var(--primary); background: #ede9fe; }
.record-status--failed { color: #b91c1c; background: #fee2e2; }
.record-actions {
  display: grid;
  justify-items: end;
  gap: 8px;
}
.record-actions small { color: var(--muted); }
.record-actions a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  padding: 0 13px;
  border-radius: 8px;
  color: #fff;
  background: var(--primary);
  font-weight: 900;
}

.mobile-pages, .mobile-tabbar { display: none; }

.entry, .login-page { display: grid; min-height: 100vh; place-items: center; padding: 24px; }
.entry__panel, .login-card, .admin-panel, .metric-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  box-shadow: var(--shadow);
}
.entry__panel, .login-card { width: min(560px, 100%); padding: clamp(24px, 6vw, 48px); }
.entry__panel--compact {
  width: min(420px, 100%);
  display: grid;
  gap: 14px;
  padding: 28px;
  border-radius: 24px;
}
.entry-mark {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border-radius: 16px;
  color: #fff;
  background: linear-gradient(135deg, var(--primary), var(--primary-2));
  box-shadow: 0 14px 28px rgba(97,57,245,.22);
}
.entry-mark svg { width: 24px; height: 24px; }
.entry__panel--compact .eyebrow { margin: 0; }
.entry__panel--compact h1 {
  margin: 0;
  font-size: clamp(28px, 7vw, 40px);
  line-height: 1.12;
  letter-spacing: 0;
}
.entry__panel--compact p:not(.eyebrow) {
  margin: 0;
  color: #4b5563;
  font-size: 15px;
  line-height: 1.7;
}
.key-form { display: grid; gap: 8px; margin-top: 2px; }
.key-form div { display: grid; grid-template-columns: 1fr 132px; gap: 10px; margin-top: 0; }
.entry-hints {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.entry-hints span {
  padding: 6px 9px;
  border: 1px solid #ede9fe;
  border-radius: 999px;
  color: #5b21b6;
  background: #faf8ff;
  font-size: 12px;
  font-weight: 900;
}
.login-card { display: grid; gap: 16px; }
.admin-shell { display: grid; grid-template-columns: 148px 1fr; min-height: 100vh; background: #f6f7ff; color: #111827; }
.admin-nav { position: sticky; top: 0; height: 100vh; display: grid; align-content: start; gap: 8px; padding: 18px 12px; color: #dbeafe; background: linear-gradient(180deg, #111827, #1f2937); }
.admin-nav strong { color: #fff; font-size: 13px; padding: 6px 8px 12px; }
.admin-nav a { border-radius: 6px; padding: 10px 12px; color: #dbeafe; text-decoration: none; font-size: 13px; }
.admin-nav a:hover { color: #fff; background: var(--primary); }
.admin-main { width: min(100%, 1320px); margin: 0 auto; padding: 22px clamp(18px, 2.2vw, 30px); }
.admin-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; }
.admin-head h1 { margin: 0; font-size: clamp(24px, 2vw, 34px); letter-spacing: 0; }
.metric-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin-bottom: 10px; }
.metric-card, .admin-panel { background: #fff; box-shadow: 0 10px 28px rgba(27, 31, 59, .06); padding: 16px; margin-bottom: 14px; }
.admin-panel h2 { margin: 0 0 14px; font-size: 18px; letter-spacing: 0; }
.admin-section-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; align-items: start; margin-bottom: 14px; }
.admin-section-grid .admin-panel { margin-bottom: 0; }
.admin-form { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; align-items: end; }
.admin-form--wide { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.admin-form--compact { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.admin-form--template { grid-template-columns: repeat(6, minmax(0, 1fr)); }
.admin-form--template label:nth-of-type(1),
.admin-form--template label:nth-of-type(2),
.admin-form--template label:nth-of-type(3),
.admin-form--template label:nth-of-type(4),
.admin-form--template label:nth-of-type(5),
.admin-form--template label:nth-of-type(6) { grid-column: span 2; }
.admin-form--template label:nth-of-type(7),
.admin-form--template label:nth-of-type(8) { grid-column: span 3; }
.admin-form--template button { grid-column: 5 / 7; justify-self: end; }
.admin-form label, .login-card label { display: grid; gap: 7px; color: #374151; font-weight: 800; font-size: 13px; }
.admin-form input,
.admin-form textarea,
.admin-form select {
  min-height: 40px;
  border-radius: 8px;
  padding: 9px 12px;
  font-size: 14px;
}
.admin-form textarea { min-height: 116px; resize: vertical; }
.admin-form .primary-btn {
  width: min(100%, 220px);
  min-height: 40px;
  border-radius: 8px;
  justify-self: start;
}
.batch-result-box {
  margin-top: 12px;
  min-height: 150px;
  color: #312e81;
  background: #faf8ff;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  line-height: 1.6;
}
.admin-help {
  margin: -4px 0 10px;
  color: #6b7280;
  font-size: 13px;
  line-height: 1.7;
}
.admin-link-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  margin-bottom: 8px;
  padding: 0 14px;
  border-radius: 8px;
  color: #fff;
  background: linear-gradient(135deg, var(--primary), var(--primary-2));
  font-weight: 900;
  font-size: 13px;
}
.span-2 { grid-column: span 2; }
.check-row { display: flex !important; align-items: center; gap: 8px; }
.check-row input { width: auto; min-height: auto; }
.table-wrap { overflow-x: auto; }
table { width: 100%; min-width: 760px; border-collapse: collapse; }
th, td { padding: 10px 12px; border-bottom: 1px solid #eef0f6; text-align: left; font-size: 13px; vertical-align: middle; }
td small { display: block; margin-top: 4px; color: #6b7280; font-size: 12px; white-space: nowrap; }
.inline-delete-form { margin: 0; }
.inline-delete-form button {
  min-height: 32px;
  border: 1px solid #fecaca;
  border-radius: 8px;
  padding: 0 11px;
  color: #b91c1c;
  background: #fff5f5;
  font-weight: 900;
}
.inline-delete-form button:hover { background: #fee2e2; }
th { color: #6b7280; background: #fafbff; }

@media (max-width: 1180px) {
  .studio-layout { width: min(100% - 28px, 960px); }
  .home-hero { grid-template-columns: 1fr; padding-inline: 0; }
  .hero-sample { display: none; }
  .catalog-grid { grid-template-columns: repeat(3, 1fr); }
  .guide-layout { grid-template-columns: 1fr; }
  .maker-grid { grid-template-columns: 1fr; }
  .upload-panel, .text-panel, .settings-panel { grid-column: auto; grid-row: auto; }
  .maker-header { grid-template-columns: 1fr auto; }
  .maker-header h2 { text-align: left; }
  .maker-key { display: none; }
}

@media (max-width: 980px) {
  .topbar {
    grid-template-columns: 1fr auto;
    height: auto;
    min-height: 64px;
    padding: 12px 18px;
    gap: 8px 12px;
  }
  .brand { grid-column: 1; grid-row: 1; }
  .top-links { display: none; }
  .menu-btn {
    grid-column: 2;
    grid-row: 1;
    display: block;
    justify-self: end;
    width: 32px;
    padding: 0;
  }
  .top-guide-link {
    grid-column: 2;
    grid-row: 1;
    display: inline-flex;
  }
  .top-guide-link + .menu-btn,
  .menu-btn {
    display: none;
  }
  .top-key {
    grid-column: 1 / -1;
    grid-row: 2;
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    gap: 10px;
    margin-top: 8px;
    padding: 8px 12px;
  }
  .topbar .top-key span { display: none; }
  .top-key small { font-size: 12px; white-space: nowrap; }
  .top-key button,
  .top-key .share-entry {
    border-left: 0;
    padding-left: 0;
    font-size: 12px;
    white-space: nowrap;
  }
}

@media (max-width: 720px) {
  body { padding-bottom: 78px; }
  .topbar {
    position: sticky;
    border-bottom: 1px solid var(--line);
  }
  .brand { font-size: 16px; }
  .brand-mark { width: 30px; height: 30px; }
  .studio-layout { width: 100%; margin: 0; }
  .share-layout {
    width: 100%;
    margin: 0;
    padding: 22px 18px 34px;
  }
  .share-hero-card {
    grid-template-columns: 1fr;
    gap: 18px;
    padding: 22px;
  }
  .share-hero-card h1 { font-size: 32px; }
  .share-hero-card p:not(.eyebrow) { font-size: 15px; }
  .share-stats,
  .share-actions,
  .share-rules,
  .distributor-code-grid {
    grid-template-columns: 1fr;
  }
  .share-url-box {
    grid-template-columns: 1fr;
  }
  .share-url-box button {
    min-height: 46px;
  }
  .records-layout {
    width: 100%;
    margin: 0;
    padding: 22px 18px 34px;
  }
  .tutorial-layout {
    width: 100%;
    max-width: 430px;
    margin: 0 auto;
    padding: 18px 16px 96px;
    gap: 14px;
  }
  .tutorial-hero,
  .tutorial-card {
    border-radius: 22px;
    box-shadow: 0 12px 32px rgba(31,41,55,.08);
  }
  .tutorial-hero,
  .tutorial-card {
    padding: 22px;
  }
  .tutorial-hero h1 {
    font-size: 30px;
  }
  .tutorial-hero p:not(.eyebrow) {
    font-size: 14px;
    line-height: 1.7;
  }
  .tutorial-actions,
  .tutorial-grid,
  .tutorial-flow {
    grid-template-columns: 1fr;
  }
  .tutorial-actions {
    display: grid;
    max-width: none;
  }
  .tutorial-flow {
    gap: 10px;
  }
  .tutorial-flow article {
    grid-template-columns: 40px 1fr;
    align-items: start;
  }
  .tutorial-flow article strong,
  .tutorial-flow article p {
    grid-column: 2;
  }
  .records-head,
  .records-empty {
    padding: 22px;
  }
  .record-card {
    grid-template-columns: 1fr;
  }
  .record-actions {
    justify-items: start;
  }
  .home-hero, .guide-section, .template-market, .maker-shell { display: none; }
  .mobile-pages { display: block; }
  .mobile-work-page { display: none; }
  .mobile-work-page:target { display: block; }
  .mobile-pages:has(.mobile-work-page:target) .mobile-home { display: none; }
  .mobile-page {
    min-height: calc(100vh - 106px);
    padding: 24px 22px 92px;
  }
  .mobile-hero h1 {
    margin: 0;
    font-size: 36px;
    line-height: 1.16;
    font-weight: 950;
  }
  .mobile-hero h1 span {
    display: block;
    color: var(--primary);
  }
  .mobile-hero p {
    margin: 14px 0 26px;
    color: #4b5563;
    font-size: 15px;
    line-height: 1.75;
  }
  .mobile-features {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
    margin-bottom: 24px;
  }
  .mobile-features span {
    display: grid;
    justify-items: center;
    gap: 5px;
    text-align: center;
  }
  .mobile-features svg {
    width: 42px;
    height: 42px;
    padding: 10px;
    border: 1px solid var(--line);
    border-radius: 50%;
    color: var(--primary);
    background: #fff;
    box-shadow: var(--shadow);
  }
  .mobile-features b { font-size: 11px; }
  .mobile-features small { color: var(--muted); font-size: 10px; line-height: 1.35; }
  .mobile-section-title {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
  }
  .mobile-section-title h2 { margin: 0; font-size: 18px; }
  .mobile-section-title a { color: var(--primary); font-weight: 900; }
  .mobile-categories {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    margin-bottom: 14px;
    padding-bottom: 3px;
  }
  .mobile-categories::-webkit-scrollbar, .mobile-template-grid::-webkit-scrollbar { display: none; }
  .mobile-categories button {
    flex: 0 0 auto;
    min-width: 54px;
    min-height: 32px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: #fff;
  }
  .mobile-categories .active { color: #fff; border-color: var(--primary); background: var(--primary); }
  .mobile-template-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
  }
  .mobile-template-card {
    position: relative;
    display: block;
    padding: 8px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: #fff;
    box-shadow: var(--shadow);
  }
  .mobile-template-card b {
    position: absolute;
    top: 8px;
    left: 8px;
    z-index: 2;
    padding: 3px 7px;
    border-radius: 5px;
    color: #fff;
    background: #ef4444;
    font-size: 11px;
  }
  .mobile-template-card strong { display: block; margin-top: 8px; font-size: 14px; }
  .mobile-template-card small { display: block; margin-top: 4px; color: var(--muted); font-size: 12px; }
  .mobile-work-page { padding: 0 0 92px; background: #fff; }
  .mobile-work-page { scroll-margin-top: 112px; }
  .mobile-work-head {
    display: grid;
    grid-template-columns: 40px 1fr auto;
    align-items: center;
    gap: 8px;
    min-height: 64px;
    padding: 0 18px;
    border-bottom: 1px solid var(--line);
    background: #fff;
  }
  .mobile-work-head a {
    display: grid;
    place-items: center;
    width: 32px;
    height: 32px;
    border: 1px solid var(--line);
    border-radius: 50%;
  }
  .mobile-work-head strong { font-size: 16px; }
  .mobile-work-head span {
    display: grid;
    gap: 2px;
    padding: 8px 10px;
    border-radius: 9px;
    background: #f9fafb;
    color: var(--muted);
    font-size: 11px;
  }
  .mobile-work-head b { color: var(--text); font-size: 12px; }
  .mobile-stepper {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 6px;
    padding: 18px 18px 20px;
    border-bottom: 1px solid var(--line);
    background: #fff;
  }
  .mobile-stepper span {
    position: relative;
    display: grid;
    justify-items: center;
    gap: 6px;
    color: #4b5563;
    font-size: 12px;
  }
  .mobile-stepper span:not(:last-child)::after {
    content: "";
    position: absolute;
    top: 14px;
    left: calc(50% + 22px);
    width: calc(100% - 28px);
    height: 1px;
    background: #dfe3ee;
  }
  .mobile-stepper b {
    display: grid;
    place-items: center;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: #eef0f6;
  }
  .mobile-stepper .active { color: var(--primary); font-weight: 900; }
  .mobile-stepper .active b { color: #fff; background: var(--primary); }
  .mobile-card {
    padding: 22px;
    background: #fff;
  }
  .mobile-card h2 {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0 0 10px;
    font-size: 18px;
  }
  .mobile-card h2 em {
    padding: 3px 8px;
    border-radius: 999px;
    color: #16a34a;
    background: #dcfce7;
    font-size: 12px;
    font-style: normal;
  }
  .mobile-card h2 small { color: var(--muted); font-size: 12px; font-weight: 500; }
  .mobile-card h2 button {
    margin-left: auto;
    border: 0;
    color: var(--primary);
    background: transparent;
    font-weight: 900;
  }
  .mobile-card p { color: var(--muted); }
  .mobile-upload-box {
    display: grid;
    place-items: center;
    gap: 12px;
    height: 230px;
    margin: 20px 0 26px;
    border: 1.5px dashed #b7a8ff;
    border-radius: 10px;
    color: var(--primary);
    background: linear-gradient(180deg, #fff, #fbfaff);
    text-align: center;
  }
  .mobile-upload-box svg { width: 48px; height: 48px; }
  .mobile-upload-box small { color: var(--muted); }
  .mobile-default-photo {
    position: relative;
    overflow: hidden;
    margin-top: 14px;
    border: 1.5px solid var(--primary);
    border-radius: 12px;
    aspect-ratio: 4 / 3;
    background: linear-gradient(155deg, #f3f4f6, #fde68a);
  }
  .mobile-default-photo img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
  }
  .mobile-default-photo.has-upload {
    background: #f3f4f6;
  }
  .mobile-default-photo i {
    position: absolute;
    top: 12px;
    right: 12px;
    display: grid;
    place-items: center;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    color: #fff;
    background: var(--primary);
  }
  .mobile-tips {
    margin-top: 22px;
    padding: 16px;
    border: 1px solid #ded7ff;
    border-radius: 10px;
    color: var(--primary);
    background: #fbfaff;
  }
  .mobile-tips ul { margin: 10px 0 0; padding-left: 18px; color: #4b5563; line-height: 1.9; }
  .mobile-guide-hero {
    padding: 18px;
    border: 1px solid #ded7ff;
    border-radius: 10px;
    background: #fbfaff;
  }
  .mobile-guide-hero strong {
    display: block;
    color: var(--text);
    font-size: 20px;
    line-height: 1.35;
  }
  .mobile-guide-hero p {
    margin: 8px 0 0;
    line-height: 1.75;
  }
  .mobile-guide-list {
    display: grid;
    gap: 12px;
    margin-top: 18px;
  }
  .mobile-guide-list article {
    display: grid;
    grid-template-columns: 36px 1fr;
    gap: 12px;
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: #fff;
  }
  .mobile-guide-list span {
    display: grid;
    place-items: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    color: #fff;
    background: var(--primary);
    font-weight: 950;
  }
  .mobile-guide-list strong { display: block; font-size: 15px; }
  .mobile-guide-list p {
    margin: 4px 0 0;
    color: var(--muted);
    line-height: 1.65;
    font-size: 13px;
  }
  .mobile-guide-note {
    margin-top: 18px;
    padding: 16px;
    border-radius: 10px;
    color: #065f46;
    background: #ecfdf5;
  }
  .mobile-guide-note p {
    margin: 8px 0 0;
    color: #047857;
    line-height: 1.7;
  }
  .mobile-generate-status {
    display: grid;
    justify-items: center;
    gap: 12px;
    padding: 28px 18px;
    border: 1px solid #ded7ff;
    border-radius: 12px;
    background: #fbfaff;
    text-align: center;
  }
  .mobile-generate-status strong { font-size: 20px; }
  .mobile-generate-status p {
    max-width: 280px;
    margin: 0;
    line-height: 1.7;
  }
  .mobile-generate-status.is-error {
    border-color: #fecaca;
    background: #fff7f7;
  }
  .mobile-generate-status.is-error strong { color: var(--danger); }
  .loading-ring {
    width: 54px;
    height: 54px;
    border: 5px solid #e9e3ff;
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
  }
  .mobile-generate-status.is-error .loading-ring {
    border-color: #fecaca;
    border-top-color: var(--danger);
    animation: none;
  }
  .mobile-status-steps {
    display: grid;
    gap: 10px;
    margin-top: 18px;
  }
  .mobile-status-steps span {
    padding: 12px 14px;
    border: 1px solid var(--line);
    border-radius: 9px;
    background: #fff;
    color: #4b5563;
    font-weight: 800;
  }
  .mobile-status-steps .active {
    color: var(--primary);
    border-color: #ded7ff;
    background: #fbfaff;
  }
  .mobile-record-link {
    display: flex;
    justify-content: center;
    margin-top: 22px;
    color: var(--primary);
    font-weight: 950;
  }
  .mobile-primary {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 50px;
    margin-top: 28px;
    border: 0;
    border-radius: 9px;
    color: #fff;
    background: linear-gradient(135deg, var(--primary), #7c3aed);
    font-weight: 950;
  }
  .mobile-copy-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
  }
  .mobile-copy-grid label { position: relative; display: block; }
  .mobile-copy-grid span {
    position: absolute;
    top: 50%;
    left: 12px;
    transform: translateY(-50%);
    display: grid;
    place-items: center;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    color: #6b7280;
    background: #f3f4f6;
    font-size: 12px;
  }
  .mobile-copy-grid input { padding-left: 48px; }
  .mobile-copy-actions {
    display: grid;
    grid-template-columns: 1fr 1.6fr;
    gap: 12px;
    margin-top: 24px;
  }
  .mobile-copy-actions button, .mobile-copy-actions a {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 46px;
    border-radius: 9px;
    font-weight: 900;
  }
  .mobile-copy-actions button { border: 1px solid var(--line); background: #f9fafb; color: #4b5563; }
  .mobile-copy-actions a { color: #fff; background: linear-gradient(135deg, var(--primary), #7c3aed); }
  .mobile-mode-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin-bottom: 22px;
  }
  .mobile-mode-grid label {
    display: grid;
    gap: 6px;
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: #fff;
  }
  .mobile-mode-grid .active { border-color: var(--primary); background: #fbfaff; box-shadow: 0 0 0 2px rgba(97, 57, 245, .10); }
  .mobile-mode-grid strong { color: var(--primary); font-size: 13px; }
  .mobile-mode-grid small { color: var(--muted); font-size: 11px; }
  .category-tabs { gap: 10px; }
  .category-tabs button { min-width: 54px; min-height: 32px; font-size: 12px; }
  .catalog-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
  .catalog-card { padding: 8px; }
  .catalog-card a { display: none; }
  .catalog-card strong { font-size: 14px; }
  .catalog-card small { font-size: 12px; }
  .maker-shell {
    margin: 28px 0 0;
    border-left: 0;
    border-right: 0;
    border-radius: 18px 18px 0 0;
  }
  .maker-header {
    grid-template-columns: 32px 1fr auto;
    min-height: 62px;
    padding: 0 18px;
  }
  .maker-header a { font-size: 0; }
  .maker-header h2 { font-size: 16px; text-align: left; }
  .maker-header button { display: none; }
  .stepper {
    gap: 8px;
    padding: 22px 18px;
  }
  .stepper span { font-size: 12px; }
  .stepper span:not(:last-child)::after { left: calc(50% + 22px); width: calc(100% - 28px); }
  .stepper b { width: 28px; height: 28px; }
  .maker-grid { display: grid; gap: 14px; padding: 0 18px 22px; }
  .maker-card {
    width: calc(100% - 36px);
    padding: 22px 18px;
    margin-bottom: 22px;
  }
  .maker-step + .maker-step,
  .maker-submit {
    margin-top: 24px;
  }
  .upload-row {
    grid-template-columns: 118px 1fr;
    gap: 18px;
  }
  .avatar-preview {
    width: 118px;
    height: 118px;
  }
  .upload-box.compact-upload {
    width: 100%;
    height: 118px;
  }
  .template-tabs {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
  }
  .template-picker-list {
    display: flex;
    gap: 12px;
    overflow-x: auto;
    padding: 2px 2px 4px;
    scroll-snap-type: x proximity;
  }
  .template-thumb-card {
    flex: 0 0 118px;
    scroll-snap-align: start;
  }
  .panel { padding: 18px; box-shadow: none; }
  .upload-box { height: 228px; }
  .default-photo { aspect-ratio: 1.25; }
  .big-preview { max-width: none; }
  .effect-panel { order: 2; min-height: 0; }
  .upload-panel { order: 1; }
  .text-panel { order: 3; }
  .settings-panel { order: 4; }
  .compact-template-list { grid-template-columns: 1fr; }
  .text-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .mode-grid { grid-template-columns: 1fr; }
  .share-panel { grid-template-columns: 1fr; }
  .results { margin: 18px; padding: 18px; }
  .result-page .workspace {
    width: 100%;
    padding: 16px 14px 92px;
  }
  .results.results--standalone {
    margin: 0;
    padding: 18px;
    border-radius: 22px;
  }
  .section-head { align-items: flex-start; flex-direction: column; }
  .result-head {
    gap: 14px;
    padding-bottom: 14px;
    margin-bottom: 14px;
  }
  .result-head h1 {
    margin: 8px 0 6px;
    font-size: 27px;
  }
  .result-subtitle {
    font-size: 13px;
    line-height: 1.65;
  }
  .result-summary {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
  }
  .result-summary article {
    padding: 11px 9px;
    border-radius: 14px;
  }
  .result-summary strong {
    font-size: 16px;
  }
  .result-summary small {
    font-size: 11px;
  }
  .download-actions { width: 100%; display: grid; grid-template-columns: 1fr; }
  .download-actions .primary-btn,
  .download-actions .ghost-btn { width: 100%; min-width: 0; }
  .mobile-tabbar {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 30;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    min-height: 70px;
    border-top: 1px solid var(--line);
    background: rgba(255,255,255,.94);
    backdrop-filter: blur(16px);
  }
  .mobile-tabbar a {
    display: grid;
    place-items: center;
    align-content: center;
    gap: 4px;
    color: #4b5563;
    font-size: 11px;
  }
  .mobile-tabbar a.active { color: var(--primary); font-weight: 900; }
  .mobile-tabbar svg { width: 22px; height: 22px; }
  .admin-shell { grid-template-columns: 1fr; overflow-x: hidden; }
  .admin-main { width: 100%; max-width: 100vw; padding: 16px; overflow-x: hidden; }
  .admin-nav { position: relative; height: auto; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .admin-panel { max-width: 100%; overflow: hidden; }
  .admin-section-grid { grid-template-columns: 1fr; }
  .metric-grid, .admin-form, .admin-form--wide, .admin-form--compact, .admin-form--template { grid-template-columns: 1fr; }
  .admin-form, .admin-form label { min-width: 0; }
  .admin-form--template label:nth-of-type(1),
  .admin-form--template label:nth-of-type(2),
  .admin-form--template label:nth-of-type(3),
  .admin-form--template label:nth-of-type(4),
  .admin-form--template label:nth-of-type(5),
  .admin-form--template label:nth-of-type(6),
  .admin-form--template label:nth-of-type(7),
  .admin-form--template label:nth-of-type(8),
  .admin-form--template button,
  .span-2 { grid-column: auto; }
  .admin-form .primary-btn { width: 100%; }
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

@media (max-width: 420px) {
  .home-copy h1 { font-size: 34px; }
  .text-grid { grid-template-columns: 1fr; }
  .preview-grid figcaption { font-size: 12px; }
  .entry {
    padding: 18px;
    align-content: start;
    padding-top: max(28px, env(safe-area-inset-top));
  }
  .entry__panel--compact {
    padding: 22px;
    border-radius: 22px;
  }
  .key-form div {
    grid-template-columns: 1fr;
  }
  .entry-hints {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .entry-hints span {
    text-align: center;
  }
  .result-empty-actions {
    grid-template-columns: 1fr;
  }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; }
}

@media (max-width: 720px) {
  html,
  body {
    max-width: 100%;
    overflow-x: hidden;
  }
  body {
    background: linear-gradient(180deg, #f8f6ff 0%, #f6f7fb 48%, #eef2ff 100%);
  }
  body::before { display: none; }
  .topbar {
    left: 0;
    right: 0;
    width: 100vw;
    max-width: none;
    transform: none;
    padding: 11px 16px 10px;
    border-bottom: 0;
    background: rgba(255,255,255,.96);
  }
  .topbar .top-key {
    margin-top: 4px;
    padding: 9px 11px;
    border-color: #eee7ff;
    border-radius: 14px;
    background: #faf8ff;
    box-shadow: none;
  }
  .top-key small {
    color: #4c1d95;
    font-weight: 900;
  }
  .top-key .share-entry {
    color: var(--primary);
    font-weight: 950;
  }
  .studio-layout {
    width: 100% !important;
    max-width: 100% !important;
    margin-inline: auto;
    background: transparent;
    overflow-x: hidden;
  }
  .mobile-pages,
  .mobile-home,
  .mobile-template-section {
    width: 100%;
    max-width: 100vw;
    min-width: 0;
  }
  .mobile-page {
    width: 100%;
    max-width: 100%;
    min-height: calc(100vh - 120px);
    padding: 14px 0 96px;
  }
  .mobile-quota-card {
    display: none;
  }
  .mobile-hero-convert {
    display: grid;
    gap: 12px;
    padding: 18px 16px 16px;
  }
  .mobile-hero-badge {
    width: max-content;
    padding: 6px 10px;
    border: 1px solid #ede9fe;
    border-radius: 999px;
    color: var(--primary);
    background: #fff;
    font-size: 12px;
    font-weight: 950;
  }
  .mobile-hero-convert h1 {
    max-width: 340px;
    margin: 0;
    color: #151226;
    font-size: 34px;
    line-height: 1.12;
    letter-spacing: 0;
    font-weight: 950;
    overflow-wrap: anywhere;
  }
  .mobile-hero-convert p {
    margin: 0;
    color: #4b5563;
    font-size: 15px;
    line-height: 1.55;
  }
  .mobile-hero-cta {
    width: 100%;
    max-width: 100%;
    min-height: 56px;
    margin-top: 4px;
    border: 0;
    border-radius: 18px;
    color: #fff;
    background: linear-gradient(135deg, #5b35f5, #8b5cf6 58%, #ff8a3d);
    box-shadow: 0 16px 34px rgba(97,57,245,.28);
    font-size: 17px;
    font-weight: 950;
    animation: ctaBreath 2.4s ease-in-out infinite;
  }
  .mobile-hero-convert small {
    color: #7c718f;
    text-align: center;
    font-size: 12px;
  }
  .mobile-feature-strip {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 7px;
    margin: 8px 16px 14px;
  }
  .mobile-feature-strip span {
    display: grid;
    justify-items: center;
    gap: 4px;
    min-width: 0;
    padding: 10px 5px;
    border: 1px solid #eeeef7;
    border-radius: 16px;
    background: rgba(255,255,255,.88);
    text-align: center;
  }
  .mobile-feature-strip svg {
    width: 28px;
    height: 28px;
    padding: 6px;
    border-radius: 10px;
    color: var(--primary);
    background: #f3f0ff;
  }
  .mobile-feature-strip b { font-size: 11px; line-height: 1.2; }
  .mobile-feature-strip small {
    color: #7b8191;
    font-size: 9px;
    line-height: 1.25;
  }
  .mobile-flow-card {
    display: flex;
    align-items: center;
    gap: 7px;
    min-height: 44px;
    margin: 0 16px;
    padding: 10px 12px;
    border: 1px solid #e9ddff;
    border-radius: 16px;
    background: #f6f1ff;
    color: #4b5563;
    font-size: 12px;
    overflow: hidden;
  }
  .mobile-flow-card strong {
    flex: 0 0 auto;
    color: #4c1d95;
    font-size: 13px;
  }
  .mobile-flow-card span { flex: 0 0 auto; white-space: nowrap; }
  .mobile-flow-card i {
    flex: 0 0 14px;
    height: 1px;
    background: #c4b5fd;
  }
  .mobile-live-ticker {
    height: 32px;
    margin: 12px 16px 18px;
    overflow: hidden;
    border: 1px solid #eee7ff;
    border-radius: 999px;
    background: rgba(255,255,255,.88);
    color: #5f6572;
    font-size: 12px;
  }
  .mobile-live-ticker div {
    display: grid;
    animation: tickerY 15s infinite;
  }
  .mobile-live-ticker span {
    display: flex;
    align-items: center;
    height: 32px;
    padding: 0 13px;
    white-space: nowrap;
  }
  .mobile-template-section { scroll-margin-top: 130px; }
  .mobile-section-title { margin: 4px 0 12px; }
  .mobile-template-section .mobile-section-title {
    padding: 0 16px;
  }
  .mobile-section-title h2 {
    font-size: 20px;
    letter-spacing: 0;
  }
  .mobile-categories {
    margin-inline: -16px;
    padding: 0 16px 5px;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }
  .mobile-categories button {
    min-width: auto;
    padding: 0 15px;
    border-color: #e5e7eb;
    color: #1f2937;
    background: #fff;
    font-weight: 900;
  }
  .mobile-categories .active {
    color: #fff;
    border-color: transparent;
    background: linear-gradient(135deg, var(--primary), var(--primary-2));
  }
  .mobile-template-grid {
    width: 100%;
    gap: 12px;
    padding: 0 16px;
  }
  .mobile-template-card {
    min-width: 0;
  }
  .mobile-template-card {
    border-radius: 18px;
    padding: 9px;
    box-shadow: 0 10px 28px rgba(31,41,55,.08);
  }
  .mobile-template-card.is-selected {
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(97,57,245,.16), 0 14px 34px rgba(97,57,245,.14);
  }
  .mobile-template-card.is-selected::after {
    content: "已选";
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 3;
    padding: 3px 8px;
    border-radius: 999px;
    color: #fff;
    background: var(--primary);
    font-size: 11px;
    font-weight: 950;
  }
  .mobile-template-card[hidden] { display: none; }
  .mobile-template-card b {
    top: 10px;
    left: 10px;
    border-radius: 999px;
  }
  .mobile-template-preview {
    position: relative;
    overflow: hidden;
    border-radius: 14px;
    background: #f4f2fb;
  }
  .mobile-template-preview .catalog-preview {
    margin: 0;
    border-radius: 14px;
  }
  .mobile-template-preview ul {
    position: absolute;
    left: 7px;
    right: 7px;
    bottom: 7px;
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin: 0;
    padding: 0;
    list-style: none;
    pointer-events: none;
  }
  .mobile-template-preview li {
    padding: 3px 6px;
    border-radius: 999px;
    color: #fff;
    background: rgba(17,24,39,.72);
    font-size: 10px;
    font-weight: 950;
    text-shadow: 0 1px 2px rgba(0,0,0,.25);
  }
  .mobile-template-card strong {
    margin-top: 9px;
    color: #151226;
  }
  .mobile-template-card small {
    color: #8a90a0;
  }
  .mobile-template-card button {
    width: 100%;
    min-height: 34px;
    margin-top: 8px;
    border: 0;
    border-radius: 11px;
    color: #fff;
    background: linear-gradient(135deg, var(--primary), var(--primary-2));
    font-size: 12px;
    font-weight: 950;
  }
  .mobile-ai-helper {
    position: fixed;
    right: max(16px, calc((100vw - 430px) / 2 + 16px));
    bottom: 100px;
    z-index: 99;
    display: flex;
    align-items: center;
    gap: 7px;
    border: 0;
    background: transparent;
  }
  .mobile-ai-helper span {
    padding: 8px 10px;
    border: 1px solid #e9ddff;
    border-radius: 999px;
    color: #4c1d95;
    background: #fff;
    box-shadow: 0 10px 28px rgba(31,41,55,.12);
    font-size: 12px;
    font-weight: 900;
  }
  .mobile-ai-helper i {
    display: grid;
    place-items: center;
    width: 46px;
    height: 46px;
    border-radius: 50%;
    color: #fff;
    background: linear-gradient(135deg, var(--primary), #8b5cf6);
    box-shadow: 0 12px 28px rgba(97,57,245,.30);
    font-style: normal;
    font-weight: 950;
  }
  .mobile-ai-panel {
    position: fixed;
    right: max(16px, calc((100vw - 430px) / 2 + 16px));
    bottom: 154px;
    z-index: 100;
    display: grid;
    gap: 8px;
    width: 210px;
    padding: 14px;
    border: 1px solid #ede9fe;
    border-radius: 18px;
    background: #fff;
    box-shadow: 0 20px 50px rgba(31,41,55,.18);
  }
  .mobile-ai-panel[hidden] { display: none; }
  .mobile-ai-panel strong { color: #151226; }
  .mobile-ai-panel button {
    min-height: 34px;
    border: 1px solid #eeeef7;
    border-radius: 10px;
    color: #4b5563;
    background: #fafafa;
    text-align: left;
    padding: 0 10px;
    font-size: 12px;
    font-weight: 900;
  }
  .mobile-tabbar {
    left: 50%;
    width: min(100%, 430px);
    transform: translateX(-50%);
    border-radius: 18px 18px 0 0;
  }
  .records-layout,
  .share-layout,
  .workspace {
    width: 100% !important;
    max-width: 430px;
    margin: 0 auto;
    padding: 18px 16px 96px;
    display: grid;
    gap: 14px;
    background: transparent;
  }
  .records-head,
  .records-empty,
  .record-card,
  .share-hero-card,
  .share-card,
  .share-rules article,
  .results.results--standalone {
    border: 1px solid #eee7ff;
    border-radius: 22px;
    background: rgba(255,255,255,.92);
    box-shadow: 0 12px 32px rgba(31,41,55,.08);
  }
  .records-head,
  .share-hero-card,
  .results.results--standalone {
    padding: 22px;
  }
  .records-head .eyebrow,
  .share-hero-card .eyebrow,
  .results .eyebrow {
    width: max-content;
    padding: 6px 10px;
    border: 1px solid #ede9fe;
    border-radius: 999px;
    background: #fff;
    color: var(--primary);
    font-size: 12px;
  }
  .records-head h1,
  .share-hero-card h1,
  .results h1 {
    margin-top: 10px;
    color: #151226;
    font-size: 28px;
    line-height: 1.15;
    letter-spacing: 0;
  }
  .records-head p:not(.eyebrow),
  .share-hero-card p:not(.eyebrow) {
    font-size: 14px;
    line-height: 1.7;
  }
  .record-card {
    padding: 16px;
    gap: 12px;
    grid-template-columns: 82px minmax(0, 1fr);
    align-items: start;
  }
  .record-thumb {
    width: 82px;
    border-radius: 16px;
  }
  .record-actions {
    grid-column: 1 / -1;
    grid-template-columns: auto auto;
    justify-content: space-between;
    align-items: center;
    width: 100%;
  }
  .record-actions a,
  .share-url-box button,
  .share-actions .primary-btn,
  .download-actions .primary-btn {
    border-radius: 14px;
    background: linear-gradient(135deg, var(--primary), var(--primary-2));
    box-shadow: 0 10px 24px rgba(97,57,245,.18);
  }
  .share-hero-card {
    grid-template-columns: 1fr;
  }
  .share-stats,
  .distributor-code-grid,
  .share-actions,
  .share-rules {
    grid-template-columns: 1fr;
  }
  .share-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .share-stats article,
  .distributor-code-grid article,
  .result-status-card {
    border-radius: 18px;
    background: #faf8ff;
  }
  .share-url-box {
    grid-template-columns: 1fr;
    border-radius: 18px;
    background: #faf8ff;
  }
  .share-url-box button {
    min-height: 48px;
  }
  .results.results--standalone {
    margin: 0;
    overflow: hidden;
  }
  .result-page .workspace {
    padding: 14px 14px 96px;
  }
  .result-head {
    gap: 12px;
    padding-bottom: 14px;
    margin-bottom: 14px;
  }
  .result-head h1 {
    margin: 8px 0 6px;
    font-size: 27px;
  }
  .result-subtitle {
    font-size: 13px;
    line-height: 1.65;
  }
  .result-summary {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
  }
  .result-summary article {
    padding: 11px 9px;
    border-radius: 14px;
  }
  .result-summary small {
    font-size: 11px;
  }
  .result-summary strong {
    font-size: 16px;
  }
  .result-grid {
    gap: 8px;
  }
  .result-grid a {
    border-radius: 16px;
  }
  .notice {
    border-radius: 16px;
    background: #faf8ff;
  }
  .entry {
    padding: 18px;
    align-content: start;
    padding-top: max(28px, env(safe-area-inset-top));
  }
  .entry__panel--compact {
    width: 100%;
    padding: 22px;
    border-radius: 22px;
  }
  .key-form div {
    grid-template-columns: 1fr;
  }
  .entry-hints {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .entry-hints span {
    text-align: center;
  }
}

@keyframes ctaBreath {
  0%, 100% { transform: scale(1); box-shadow: 0 16px 34px rgba(97,57,245,.28); }
  50% { transform: scale(1.018); box-shadow: 0 20px 42px rgba(97,57,245,.36); }
}

@keyframes tickerY {
  0%, 16% { transform: translateY(0); }
  20%, 36% { transform: translateY(-32px); }
  40%, 56% { transform: translateY(-64px); }
  60%, 76% { transform: translateY(-96px); }
  80%, 96% { transform: translateY(-128px); }
  100% { transform: translateY(0); }
}

@media (prefers-reduced-motion: reduce) {
  .mobile-hero-cta,
  .mobile-live-ticker div {
    animation: none !important;
  }
}

/* Front pages are intentionally locked to the mobile H5 experience on every device. */
body.site-shell:not(.admin-shell) {
  padding-bottom: 78px;
  background: linear-gradient(180deg, #f8f6ff 0%, #f6f7fb 48%, #eef2ff 100%);
  overflow-x: hidden;
}
body.site-shell:not(.admin-shell)::before { display: none; }
body.site-shell:not(.admin-shell) .topbar {
  left: 50%;
  right: auto;
  width: min(100%, 430px);
  max-width: 430px;
  min-height: 64px;
  height: auto;
  grid-template-columns: 1fr auto;
  gap: 8px 12px;
  transform: translateX(-50%);
  padding: 11px 16px 10px;
  border-bottom: 0;
  background: rgba(255,255,255,.96);
}
body.site-shell:not(.admin-shell) .brand {
  grid-column: 1;
  grid-row: 1;
  font-size: 16px;
}
body.site-shell:not(.admin-shell) .brand-mark { width: 30px; height: 30px; }
body.site-shell:not(.admin-shell) .top-links,
body.site-shell:not(.admin-shell) .menu-btn {
  display: none;
}
body.site-shell:not(.admin-shell) .top-guide-link {
  grid-column: 2;
  grid-row: 1;
  display: inline-flex;
}
body.site-shell:not(.admin-shell) .top-key {
  grid-column: 1 / -1;
  grid-row: 2;
  display: flex;
  width: 100%;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 4px;
  padding: 9px 11px;
  border-color: #eee7ff;
  border-radius: 14px;
  background: #faf8ff;
  box-shadow: none;
}
body.site-shell:not(.admin-shell) .topbar .top-key span { display: none; }
body.site-shell:not(.admin-shell) .top-key small {
  color: #4c1d95;
  font-size: 12px;
  font-weight: 900;
  white-space: nowrap;
}
body.site-shell:not(.admin-shell) .top-key .share-entry,
body.site-shell:not(.admin-shell) .top-key button {
  border-left: 0;
  padding-left: 0;
  color: var(--primary);
  font-size: 12px;
  font-weight: 950;
  white-space: nowrap;
}
body.site-shell:not(.admin-shell) .studio-layout {
  width: 100% !important;
  max-width: 430px !important;
  margin: 0 auto;
  background: transparent;
  overflow-x: hidden;
}
body.site-shell:not(.admin-shell) .home-hero,
body.site-shell:not(.admin-shell) .guide-section,
body.site-shell:not(.admin-shell) .template-market,
body.site-shell:not(.admin-shell) .maker-shell {
  display: none;
}
body.site-shell:not(.admin-shell) .mobile-pages {
  display: block;
  width: 100%;
  max-width: 430px;
}
body.site-shell:not(.admin-shell) .mobile-work-page { display: none; }
body.site-shell:not(.admin-shell) .mobile-work-page:target { display: block; }
body.site-shell:not(.admin-shell) .mobile-pages:has(.mobile-work-page:target) .mobile-home { display: none; }
body.site-shell:not(.admin-shell) .mobile-page {
  width: 100%;
  max-width: 100%;
  min-height: calc(100vh - 120px);
  padding: 14px 0 96px;
}
body.site-shell:not(.admin-shell) .mobile-quota-card { display: none; }
body.site-shell:not(.admin-shell) .mobile-hero-convert {
  display: grid;
  gap: 12px;
  padding: 18px 16px 16px;
}
body.site-shell:not(.admin-shell) .mobile-hero-badge {
  width: max-content;
  padding: 6px 10px;
  border: 1px solid #ede9fe;
  border-radius: 999px;
  color: var(--primary);
  background: #fff;
  font-size: 12px;
  font-weight: 950;
}
body.site-shell:not(.admin-shell) .mobile-hero-convert h1 {
  max-width: 340px;
  margin: 0;
  color: #151226;
  font-size: 34px;
  line-height: 1.12;
  letter-spacing: 0;
  font-weight: 950;
  overflow-wrap: anywhere;
}
body.site-shell:not(.admin-shell) .mobile-hero-convert p {
  margin: 0;
  color: #4b5563;
  font-size: 15px;
  line-height: 1.55;
}
body.site-shell:not(.admin-shell) .mobile-hero-cta {
  width: 100%;
  min-height: 56px;
  margin-top: 4px;
  border: 0;
  border-radius: 18px;
  color: #fff;
  background: linear-gradient(135deg, #5b35f5, #8b5cf6 58%, #ff8a3d);
  box-shadow: 0 16px 34px rgba(97,57,245,.28);
  font-size: 17px;
  font-weight: 950;
  animation: ctaBreath 2.4s ease-in-out infinite;
}
body.site-shell:not(.admin-shell) .mobile-hero-convert small {
  color: #7c718f;
  text-align: center;
  font-size: 12px;
}
body.site-shell:not(.admin-shell) .mobile-feature-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 7px;
  margin: 8px 16px 14px;
}
body.site-shell:not(.admin-shell) .mobile-feature-strip span {
  display: grid;
  justify-items: center;
  gap: 4px;
  min-width: 0;
  padding: 10px 5px;
  border: 1px solid #eeeef7;
  border-radius: 16px;
  background: rgba(255,255,255,.88);
  text-align: center;
}
body.site-shell:not(.admin-shell) .mobile-feature-strip svg {
  width: 28px;
  height: 28px;
  padding: 6px;
  border-radius: 10px;
  color: var(--primary);
  background: #f3f0ff;
}
body.site-shell:not(.admin-shell) .mobile-feature-strip b { font-size: 11px; line-height: 1.2; }
body.site-shell:not(.admin-shell) .mobile-feature-strip small {
  color: #7b8191;
  font-size: 9px;
  line-height: 1.25;
}
body.site-shell:not(.admin-shell) .mobile-flow-card {
  display: flex;
  align-items: center;
  gap: 7px;
  min-height: 44px;
  margin: 0 16px;
  padding: 10px 12px;
  border: 1px solid #e9ddff;
  border-radius: 16px;
  background: #f6f1ff;
  color: #4b5563;
  font-size: 12px;
  overflow: hidden;
}
body.site-shell:not(.admin-shell) .mobile-flow-card strong {
  flex: 0 0 auto;
  color: #4c1d95;
  font-size: 13px;
}
body.site-shell:not(.admin-shell) .mobile-flow-card span { flex: 0 0 auto; white-space: nowrap; }
body.site-shell:not(.admin-shell) .mobile-flow-card i {
  flex: 0 0 14px;
  height: 1px;
  background: #c4b5fd;
}
body.site-shell:not(.admin-shell) .mobile-live-ticker {
  height: 32px;
  margin: 12px 16px 18px;
  overflow: hidden;
  border: 1px solid #eee7ff;
  border-radius: 999px;
  background: rgba(255,255,255,.88);
  color: #5f6572;
  font-size: 12px;
}
body.site-shell:not(.admin-shell) .mobile-live-ticker div {
  display: grid;
  animation: tickerY 15s infinite;
}
body.site-shell:not(.admin-shell) .mobile-live-ticker span {
  display: flex;
  align-items: center;
  height: 32px;
  padding: 0 13px;
  white-space: nowrap;
}
body.site-shell:not(.admin-shell) .mobile-template-section { scroll-margin-top: 130px; }
body.site-shell:not(.admin-shell) .mobile-template-section .mobile-section-title { padding: 0 16px; }
body.site-shell:not(.admin-shell) .mobile-section-title {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 4px 0 12px;
}
body.site-shell:not(.admin-shell) .mobile-section-title h2 {
  margin: 0;
  font-size: 20px;
  letter-spacing: 0;
}
body.site-shell:not(.admin-shell) .mobile-section-title a { color: var(--primary); font-weight: 900; }
body.site-shell:not(.admin-shell) .mobile-categories {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  margin: 0 -16px 14px;
  padding: 0 16px 5px;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
body.site-shell:not(.admin-shell) .mobile-categories::-webkit-scrollbar,
body.site-shell:not(.admin-shell) .mobile-template-grid::-webkit-scrollbar { display: none; }
body.site-shell:not(.admin-shell) .mobile-categories button {
  flex: 0 0 auto;
  min-width: auto;
  min-height: 32px;
  padding: 0 15px;
  border: 1px solid #e5e7eb;
  border-radius: 999px;
  color: #1f2937;
  background: #fff;
  font-weight: 900;
}
body.site-shell:not(.admin-shell) .mobile-categories .active {
  color: #fff;
  border-color: transparent;
  background: linear-gradient(135deg, var(--primary), var(--primary-2));
}
body.site-shell:not(.admin-shell) .mobile-template-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  width: 100%;
  padding: 0 16px;
}
body.site-shell:not(.admin-shell) .mobile-template-card {
  position: relative;
  display: block;
  min-width: 0;
  padding: 9px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 10px 28px rgba(31,41,55,.08);
}
body.site-shell:not(.admin-shell) .mobile-template-card[hidden] { display: none; }
body.site-shell:not(.admin-shell) .mobile-template-card.is-selected {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(97,57,245,.16), 0 14px 34px rgba(97,57,245,.14);
}
body.site-shell:not(.admin-shell) .mobile-template-card.is-selected::after {
  content: "已选";
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 3;
  padding: 3px 8px;
  border-radius: 999px;
  color: #fff;
  background: var(--primary);
  font-size: 11px;
  font-weight: 950;
}
body.site-shell:not(.admin-shell) .mobile-template-card b {
  position: absolute;
  top: 10px;
  left: 10px;
  z-index: 2;
  padding: 3px 7px;
  border-radius: 999px;
  color: #fff;
  background: #ef4444;
  font-size: 11px;
}
body.site-shell:not(.admin-shell) .mobile-template-preview {
  position: relative;
  overflow: hidden;
  border-radius: 14px;
  background: #f4f2fb;
}
body.site-shell:not(.admin-shell) .mobile-template-preview .catalog-preview {
  margin: 0;
  border-radius: 14px;
}
body.site-shell:not(.admin-shell) .mobile-template-preview ul {
  position: absolute;
  left: 7px;
  right: 7px;
  bottom: 7px;
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin: 0;
  padding: 0;
  list-style: none;
  pointer-events: none;
}
body.site-shell:not(.admin-shell) .mobile-template-preview li {
  padding: 3px 6px;
  border-radius: 999px;
  color: #fff;
  background: rgba(17,24,39,.72);
  font-size: 10px;
  font-weight: 950;
  text-shadow: 0 1px 2px rgba(0,0,0,.25);
}
body.site-shell:not(.admin-shell) .mobile-template-card strong {
  display: block;
  margin-top: 9px;
  color: #151226;
  font-size: 14px;
}
body.site-shell:not(.admin-shell) .mobile-template-card small {
  display: block;
  margin-top: 4px;
  color: #8a90a0;
  font-size: 12px;
}
body.site-shell:not(.admin-shell) .mobile-template-card button {
  width: 100%;
  min-height: 34px;
  margin-top: 8px;
  border: 0;
  border-radius: 11px;
  color: #fff;
  background: linear-gradient(135deg, var(--primary), var(--primary-2));
  font-size: 12px;
  font-weight: 950;
}
body.site-shell:not(.admin-shell) .mobile-ai-helper {
  position: fixed;
  right: max(16px, calc((100vw - 430px) / 2 + 16px));
  bottom: 100px;
  z-index: 99;
  display: flex;
  align-items: center;
  gap: 7px;
  border: 0;
  background: transparent;
}
body.site-shell:not(.admin-shell) .mobile-ai-helper span {
  padding: 8px 10px;
  border: 1px solid #e9ddff;
  border-radius: 999px;
  color: #4c1d95;
  background: #fff;
  box-shadow: 0 10px 28px rgba(31,41,55,.12);
  font-size: 12px;
  font-weight: 900;
}
body.site-shell:not(.admin-shell) .mobile-ai-helper i {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  color: #fff;
  background: linear-gradient(135deg, var(--primary), #8b5cf6);
  box-shadow: 0 12px 28px rgba(97,57,245,.30);
  font-style: normal;
  font-weight: 950;
}
body.site-shell:not(.admin-shell) .mobile-ai-panel {
  position: fixed;
  right: max(16px, calc((100vw - 430px) / 2 + 16px));
  bottom: 154px;
  z-index: 100;
  display: grid;
  gap: 8px;
  width: 210px;
  padding: 14px;
  border: 1px solid #ede9fe;
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 20px 50px rgba(31,41,55,.18);
}
body.site-shell:not(.admin-shell) .mobile-ai-panel[hidden] { display: none; }
body.site-shell:not(.admin-shell) .mobile-ai-panel strong { color: #151226; }
body.site-shell:not(.admin-shell) .mobile-ai-panel button {
  min-height: 34px;
  border: 1px solid #eeeef7;
  border-radius: 10px;
  color: #4b5563;
  background: #fafafa;
  text-align: left;
  padding: 0 10px;
  font-size: 12px;
  font-weight: 900;
}
body.site-shell:not(.admin-shell) .mobile-work-page {
  padding: 0 0 92px;
  background: #fff;
  scroll-margin-top: 112px;
}
body.site-shell:not(.admin-shell) .mobile-work-head {
  display: grid;
  grid-template-columns: 40px 1fr auto;
  align-items: center;
  gap: 8px;
  min-height: 64px;
  padding: 0 18px;
  border-bottom: 1px solid var(--line);
  background: #fff;
}
body.site-shell:not(.admin-shell) .mobile-work-head a {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border: 1px solid var(--line);
  border-radius: 50%;
}
body.site-shell:not(.admin-shell) .mobile-work-head strong { font-size: 16px; }
body.site-shell:not(.admin-shell) .mobile-work-head span {
  display: grid;
  gap: 2px;
  padding: 8px 10px;
  border-radius: 9px;
  background: #f9fafb;
  color: var(--muted);
  font-size: 11px;
}
body.site-shell:not(.admin-shell) .mobile-work-head b { color: var(--text); font-size: 12px; }
body.site-shell:not(.admin-shell) .mobile-stepper {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
  padding: 18px 18px 20px;
  border-bottom: 1px solid var(--line);
  background: #fff;
}
body.site-shell:not(.admin-shell) .mobile-stepper span {
  position: relative;
  display: grid;
  justify-items: center;
  gap: 6px;
  color: #4b5563;
  font-size: 12px;
}
body.site-shell:not(.admin-shell) .mobile-stepper span:not(:last-child)::after {
  content: "";
  position: absolute;
  top: 14px;
  left: calc(50% + 22px);
  width: calc(100% - 28px);
  height: 1px;
  background: #dfe3ee;
}
body.site-shell:not(.admin-shell) .mobile-stepper b {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #eef0f6;
}
body.site-shell:not(.admin-shell) .mobile-stepper .active { color: var(--primary); font-weight: 900; }
body.site-shell:not(.admin-shell) .mobile-stepper .active b { color: #fff; background: var(--primary); }
body.site-shell:not(.admin-shell) .mobile-card {
  padding: 22px;
  background: #fff;
}
body.site-shell:not(.admin-shell) .mobile-card h2 {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 10px;
  font-size: 18px;
}
body.site-shell:not(.admin-shell) .mobile-card h2 em {
  padding: 3px 8px;
  border-radius: 999px;
  color: #16a34a;
  background: #dcfce7;
  font-size: 12px;
  font-style: normal;
}
body.site-shell:not(.admin-shell) .mobile-card h2 small { color: var(--muted); font-size: 12px; font-weight: 500; }
body.site-shell:not(.admin-shell) .mobile-card h2 button {
  margin-left: auto;
  border: 0;
  color: var(--primary);
  background: transparent;
  font-weight: 900;
}
body.site-shell:not(.admin-shell) .mobile-card p { color: var(--muted); }
body.site-shell:not(.admin-shell) .mobile-upload-box {
  display: grid;
  place-items: center;
  gap: 12px;
  height: 230px;
  margin: 20px 0 26px;
  border: 1.5px dashed #b7a8ff;
  border-radius: 10px;
  color: var(--primary);
  background: linear-gradient(180deg, #fff, #fbfaff);
  text-align: center;
}
body.site-shell:not(.admin-shell) .mobile-upload-box svg { width: 48px; height: 48px; }
body.site-shell:not(.admin-shell) .mobile-upload-box small { color: var(--muted); }
body.site-shell:not(.admin-shell) .mobile-default-photo {
  position: relative;
  overflow: hidden;
  margin-top: 14px;
  border: 1.5px solid var(--primary);
  border-radius: 12px;
  aspect-ratio: 4 / 3;
  background: linear-gradient(155deg, #f3f4f6, #fde68a);
}
body.site-shell:not(.admin-shell) .mobile-default-photo img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
body.site-shell:not(.admin-shell) .mobile-default-photo.has-upload { background: #f3f4f6; }
body.site-shell:not(.admin-shell) .mobile-default-photo i {
  position: absolute;
  top: 12px;
  right: 12px;
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  color: #fff;
  background: var(--primary);
}
body.site-shell:not(.admin-shell) .mobile-tips,
body.site-shell:not(.admin-shell) .mobile-guide-hero {
  margin-top: 22px;
  padding: 16px;
  border: 1px solid #ded7ff;
  border-radius: 10px;
  background: #fbfaff;
}
body.site-shell:not(.admin-shell) .mobile-tips { color: var(--primary); }
body.site-shell:not(.admin-shell) .mobile-tips ul {
  margin: 10px 0 0;
  padding-left: 18px;
  color: #4b5563;
  line-height: 1.9;
}
body.site-shell:not(.admin-shell) .mobile-copy-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}
body.site-shell:not(.admin-shell) .mobile-copy-grid label { position: relative; display: block; }
body.site-shell:not(.admin-shell) .mobile-copy-grid span {
  position: absolute;
  top: 50%;
  left: 12px;
  transform: translateY(-50%);
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  color: #6b7280;
  background: #f3f4f6;
  font-size: 12px;
}
body.site-shell:not(.admin-shell) .mobile-copy-grid input { padding-left: 48px; }
body.site-shell:not(.admin-shell) .mobile-copy-actions {
  display: grid;
  grid-template-columns: 1fr 1.6fr;
  gap: 12px;
  margin-top: 24px;
}
body.site-shell:not(.admin-shell) .mobile-copy-actions button,
body.site-shell:not(.admin-shell) .mobile-copy-actions a {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  border-radius: 9px;
  font-weight: 900;
}
body.site-shell:not(.admin-shell) .mobile-copy-actions button {
  border: 1px solid var(--line);
  background: #f9fafb;
  color: #4b5563;
}
body.site-shell:not(.admin-shell) .mobile-copy-actions a {
  color: #fff;
  background: linear-gradient(135deg, var(--primary), #7c3aed);
}
body.site-shell:not(.admin-shell) .mobile-mode-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin-bottom: 22px;
}
body.site-shell:not(.admin-shell) .mobile-mode-grid label {
  display: grid;
  gap: 6px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
}
body.site-shell:not(.admin-shell) .mobile-mode-grid .active {
  border-color: var(--primary);
  background: #fbfaff;
  box-shadow: 0 0 0 2px rgba(97, 57, 245, .10);
}
body.site-shell:not(.admin-shell) .mobile-mode-grid strong { color: var(--primary); font-size: 13px; }
body.site-shell:not(.admin-shell) .mobile-mode-grid small { color: var(--muted); font-size: 11px; }
body.site-shell:not(.admin-shell) .mobile-primary {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 50px;
  margin-top: 28px;
  border: 0;
  border-radius: 9px;
  color: #fff;
  background: linear-gradient(135deg, var(--primary), #7c3aed);
  font-weight: 950;
}
body.site-shell:not(.admin-shell) .mobile-tabbar {
  position: fixed;
  left: 50%;
  right: auto;
  bottom: 0;
  z-index: 30;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  width: min(100%, 430px);
  min-height: 70px;
  transform: translateX(-50%);
  border-top: 1px solid var(--line);
  border-radius: 18px 18px 0 0;
  background: rgba(255,255,255,.94);
  backdrop-filter: blur(16px);
}
body.site-shell:not(.admin-shell) .mobile-tabbar a {
  display: grid;
  place-items: center;
  align-content: center;
  gap: 4px;
  color: #4b5563;
  font-size: 11px;
}
body.site-shell:not(.admin-shell) .mobile-tabbar a.active { color: var(--primary); font-weight: 900; }
body.site-shell:not(.admin-shell) .mobile-tabbar svg { width: 22px; height: 22px; }
body.site-shell:not(.admin-shell) .records-layout,
body.site-shell:not(.admin-shell) .share-layout,
body.site-shell:not(.admin-shell) .workspace,
body.site-shell:not(.admin-shell) .tutorial-layout {
  width: 100% !important;
  max-width: 430px;
  margin: 0 auto;
  padding: 18px 16px 96px;
  display: grid;
  gap: 14px;
  background: transparent;
}
body.site-shell:not(.admin-shell) .records-head,
body.site-shell:not(.admin-shell) .records-empty,
body.site-shell:not(.admin-shell) .record-card,
body.site-shell:not(.admin-shell) .share-hero-card,
body.site-shell:not(.admin-shell) .share-card,
body.site-shell:not(.admin-shell) .share-rules article,
body.site-shell:not(.admin-shell) .results.results--standalone,
body.site-shell:not(.admin-shell) .tutorial-hero,
body.site-shell:not(.admin-shell) .tutorial-card {
  border: 1px solid #eee7ff;
  border-radius: 22px;
  background: rgba(255,255,255,.92);
  box-shadow: 0 12px 32px rgba(31,41,55,.08);
}
body.site-shell:not(.admin-shell) .records-head,
body.site-shell:not(.admin-shell) .share-hero-card,
body.site-shell:not(.admin-shell) .results.results--standalone,
body.site-shell:not(.admin-shell) .tutorial-hero,
body.site-shell:not(.admin-shell) .tutorial-card {
  padding: 22px;
}
body.site-shell:not(.admin-shell) .records-head .eyebrow,
body.site-shell:not(.admin-shell) .share-hero-card .eyebrow,
body.site-shell:not(.admin-shell) .results .eyebrow,
body.site-shell:not(.admin-shell) .tutorial-hero .eyebrow {
  width: max-content;
  padding: 6px 10px;
  border: 1px solid #ede9fe;
  border-radius: 999px;
  background: #fff;
  color: var(--primary);
  font-size: 12px;
}
body.site-shell:not(.admin-shell) .records-head h1,
body.site-shell:not(.admin-shell) .share-hero-card h1,
body.site-shell:not(.admin-shell) .results h1,
body.site-shell:not(.admin-shell) .tutorial-hero h1 {
  margin-top: 10px;
  color: #151226;
  font-size: 28px;
  line-height: 1.15;
  letter-spacing: 0;
}
body.site-shell:not(.admin-shell) .tutorial-flow,
body.site-shell:not(.admin-shell) .tutorial-grid,
body.site-shell:not(.admin-shell) .share-hero-card,
body.site-shell:not(.admin-shell) .distributor-code-grid,
body.site-shell:not(.admin-shell) .share-actions,
body.site-shell:not(.admin-shell) .share-rules {
  grid-template-columns: 1fr;
}
body.site-shell:not(.admin-shell) .tutorial-actions {
  display: grid;
  max-width: none;
}
body.site-shell:not(.admin-shell) .share-stats {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
body.site-shell:not(.admin-shell) .record-card {
  padding: 16px;
  gap: 12px;
  grid-template-columns: 82px minmax(0, 1fr);
  align-items: start;
}
body.site-shell:not(.admin-shell) .record-thumb {
  width: 82px;
  border-radius: 16px;
}
body.site-shell:not(.admin-shell) .record-actions {
  grid-column: 1 / -1;
  grid-template-columns: auto auto;
  justify-content: space-between;
  align-items: center;
  width: 100%;
}
body.site-shell:not(.admin-shell) .share-url-box {
  grid-template-columns: 1fr;
  border-radius: 18px;
  background: #faf8ff;
}
body.site-shell:not(.admin-shell) .result-summary {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}
body.site-shell:not(.admin-shell) .result-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}
body.site-shell:not(.admin-shell) .download-actions {
  width: 100%;
  display: grid;
  grid-template-columns: 1fr;
}
