:root {
  --bg: #f4f5fb;
  --surface: #ffffff;
  --text: #1a1a2e;
  --muted: #5c6370;
  --border: #e5e7eb;
  --accent: #4f46e5;
  --accent-hover: #4338ca;
  --accent-soft: #eef2ff;
  --ok: #059669;
  --ok-soft: #ecfdf5;
  --danger: #dc2626;
  --radius: 12px;
  --shadow: 0 1px 3px rgba(0,0,0,.06), 0 4px 12px rgba(0,0,0,.04);
  --max: 760px;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "PingFang SC", "Microsoft YaHei", sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

.wrap { width: 100%; max-width: var(--max); margin: 0 auto; padding: 0 1rem; }
@media (max-width: 480px) {
  .wrap { padding: 0 .85rem; }
}

header.site {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 10;
}
header.site .inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
  padding: .85rem 0;
  flex-wrap: wrap;
}
.logo {
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--text);
  text-decoration: none;
  letter-spacing: -.01em;
}
.logo:hover { text-decoration: none; color: var(--accent); }
nav {
  display: flex;
  gap: .25rem .85rem;
  flex-wrap: wrap;
  align-items: center;
  font-size: .92rem;
}
nav a { color: var(--muted); }
nav a:hover, nav a.active { color: var(--accent); text-decoration: none; }

main { flex: 1; padding: 1.75rem 0 3rem; }
@media (max-width: 480px) {
  main { padding: 1.25rem 0 2.5rem; }
}

.hero { text-align: center; padding: 1.25rem 0 1.75rem; }
.brand-chip {
  display: inline-block;
  margin: 0 0 .65rem;
  padding: .2rem .7rem;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: .82rem;
  font-weight: 700;
}
.hero h1 {
  font-size: clamp(1.55rem, 4.5vw, 2.1rem);
  line-height: 1.25;
  margin: 0 0 .75rem;
  letter-spacing: -.02em;
}
.hero .tagline {
  color: var(--accent);
  font-weight: 600;
  margin: 0 0 .5rem;
  font-size: 1rem;
}
.hero .sub {
  color: var(--muted);
  margin: 0 auto 1.5rem;
  max-width: 36rem;
  font-size: 1.02rem;
}
.actions {
  display: flex;
  gap: .75rem;
  justify-content: center;
  flex-wrap: wrap;
}
.privacy-cta { margin-top: 1.5rem; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .4rem;
  padding: .75rem 1.3rem;
  border-radius: 8px;
  border: 1px solid transparent;
  font: inherit;
  font-weight: 600;
  font-size: .95rem;
  cursor: pointer;
  text-decoration: none;
  transition: background .15s, border-color .15s, color .15s, opacity .15s;
  min-height: 44px;
}
.btn:hover { text-decoration: none; }
.btn-primary {
  background: var(--accent);
  color: #fff;
}
.btn-primary:hover { background: var(--accent-hover); color: #fff; }
.btn-primary:disabled {
  opacity: .55;
  cursor: not-allowed;
}
.btn-ghost {
  background: var(--surface);
  color: var(--text);
  border-color: var(--border);
}
.btn-ghost:hover { border-color: #c5cad3; }
.btn-ghost:disabled {
  opacity: .55;
  cursor: not-allowed;
}

.features {
  display: grid;
  gap: 1rem;
  grid-template-columns: 1fr;
  margin: 0 0 2rem;
}
@media (min-width: 640px) {
  .features { grid-template-columns: repeat(3, 1fr); }
}
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.1rem 1.15rem;
  box-shadow: var(--shadow);
}
.card h3 {
  margin: 0 0 .4rem;
  font-size: 1.02rem;
}
.card p {
  margin: 0;
  color: var(--muted);
  font-size: .92rem;
}

.how {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem 1.35rem;
  box-shadow: var(--shadow);
  margin-bottom: 1.25rem;
}
.how h2 { margin: 0 0 .75rem; font-size: 1.15rem; }
.how ol { margin: 0; padding-left: 1.2rem; color: var(--muted); }
.how li { margin: .35rem 0; }
.keywords-note {
  color: var(--muted);
  font-size: .88rem;
  text-align: center;
  margin: 1rem 0 0;
}

.page-title {
  font-size: clamp(1.35rem, 3.5vw, 1.75rem);
  margin: 0 0 .75rem;
  letter-spacing: -.02em;
}
.privacy-banner {
  background: var(--accent-soft);
  color: var(--text);
  border-radius: 8px;
  padding: .75rem 1rem;
  font-size: .92rem;
  margin: 0 0 1.25rem;
}
.secondary-note {
  color: var(--muted);
  font-size: .92rem;
  margin: 0 0 1rem;
}

.dropzone {
  background: var(--surface);
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  padding: 1.75rem 1.25rem;
  text-align: center;
  cursor: pointer;
  transition: border-color .15s, background .15s;
  margin-bottom: 1rem;
}
.dropzone:hover, .dropzone.dragover {
  border-color: var(--accent);
  background: var(--accent-soft);
}
.dropzone-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 800;
  font-size: .75rem;
  letter-spacing: .04em;
  margin-bottom: .75rem;
}
.dropzone p { margin: .65rem 0 0; color: var(--muted); font-size: .92rem; }
.dropzone input[type="file"] { display: none; }

.file-meta {
  font-size: .9rem;
  color: var(--muted);
  margin: 0 0 1rem;
  min-height: 1.25em;
}

.preview-pane {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem;
  margin-bottom: 1rem;
  box-shadow: var(--shadow);
}
.list-title {
  font-weight: 600;
  font-size: .92rem;
  margin: 0 0 .65rem;
}
.preview-frame {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 160px;
  background: #fafafa;
  border-radius: 8px;
  border: 1px solid var(--border);
  overflow: hidden;
}
.preview-frame.empty-frame { background: repeating-linear-gradient(
  -45deg, #fafafa, #fafafa 8px, #f3f4f6 8px, #f3f4f6 16px
); }
.preview-img {
  max-width: 100%;
  max-height: 220px;
  object-fit: contain;
  display: block;
}
.preview-placeholder {
  text-align: center;
  color: var(--muted);
  padding: 1rem;
  font-size: .9rem;
}
.preview-placeholder strong {
  display: block;
  color: var(--text);
  margin-bottom: .25rem;
}

.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: .65rem;
  margin: 1rem 0;
}

.progress-wrap { margin: .5rem 0 1rem; }
.progress-label {
  display: flex;
  justify-content: space-between;
  font-size: .85rem;
  color: var(--muted);
  margin-bottom: .35rem;
}
.progress-bar {
  height: 8px;
  background: #e5e7eb;
  border-radius: 999px;
  overflow: hidden;
}
.progress-bar span {
  display: block;
  height: 100%;
  width: 0;
  background: var(--accent);
  border-radius: 999px;
  transition: width .2s ease;
}

.status {
  font-size: .92rem;
  color: var(--muted);
  min-height: 1.4em;
  margin: .5rem 0 0;
}
.status.error { color: var(--danger); }

.pack-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.15rem;
  margin-top: 1rem;
  box-shadow: var(--shadow);
}
.pack-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(96px, 1fr));
  gap: .75rem;
  margin: .75rem 0 1.25rem;
}
.icon-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .4rem;
  padding: .65rem .4rem;
  background: #fafafa;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: .75rem;
  color: var(--muted);
}
.icon-card img {
  image-rendering: auto;
  background:
    linear-gradient(45deg, #eee 25%, transparent 25%),
    linear-gradient(-45deg, #eee 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, #eee 75%),
    linear-gradient(-45deg, transparent 75%, #eee 75%);
  background-size: 12px 12px;
  background-position: 0 0, 0 6px, 6px -6px, -6px 0;
  border-radius: 4px;
}

.code-block {
  background: #0f172a;
  color: #e2e8f0;
  border-radius: 8px;
  padding: .85rem 1rem;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: .78rem;
  line-height: 1.45;
  overflow-x: auto;
  white-space: pre;
  margin: 0 0 1rem;
}

.privacy-body p {
  color: var(--muted);
  margin: 0 0 1rem;
}

footer.site {
  border-top: 1px solid var(--border);
  padding: 1.25rem 0;
  color: var(--muted);
  font-size: .85rem;
  text-align: center;
  background: var(--surface);
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 1.5rem;
  transform: translateX(-50%) translateY(120%);
  background: #111827;
  color: #fff;
  padding: .75rem 1.15rem;
  border-radius: 999px;
  font-size: .9rem;
  font-weight: 600;
  box-shadow: 0 8px 24px rgba(0,0,0,.2);
  z-index: 50;
  opacity: 0;
  transition: transform .25s ease, opacity .25s ease;
  max-width: calc(100vw - 2rem);
  text-align: center;
}
.toast.show {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}

@media (max-width: 480px) {
  .toolbar .btn { flex: 1 1 auto; }
  .pack-grid { grid-template-columns: repeat(3, 1fr); }
}
