:root {
  --bg: #f5f7fb;
  --card: #ffffff;
  --ink: #101828;
  --ink-2: #475467;
  --ink-3: #98a2b3;
  --line: #e4e7ec;
  --brand: #4f46e5;
  --brand-2: #7c3aed;
  --brand-soft: #eef2ff;
  --ok: #12b76a;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(16, 24, 40, .06), 0 12px 32px -12px rgba(16, 24, 40, .16);
}

* { box-sizing: border-box; }

html, body { margin: 0; padding: 0; }

body {
  background: var(--bg);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Segoe UI", sans-serif;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--brand); text-decoration: none; }

/* ---------- header ---------- */
.site-header {
  max-width: 1080px;
  margin: 0 auto;
  padding: 18px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.logo { display: flex; align-items: center; gap: 10px; color: var(--ink); }

.logo-mark {
  width: 38px; height: 38px;
  display: grid; place-items: center;
  border-radius: 11px;
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  color: #fff; font-weight: 700; font-size: 18px;
}

.logo-text { font-weight: 700; font-size: 17px; display: flex; flex-direction: column; line-height: 1.2; }
.logo-text small { font-weight: 400; font-size: 11px; color: var(--ink-3); letter-spacing: .5px; }

.site-nav { display: flex; align-items: center; gap: 22px; font-size: 14px; }
.site-nav a { color: var(--ink-2); }
.site-nav a:hover { color: var(--brand); }

/* ---------- buttons ---------- */
.btn {
  border: 1px solid transparent;
  border-radius: 10px;
  padding: 9px 16px;
  font-size: 14px;
  font-family: inherit;
  cursor: pointer;
  transition: .18s;
  background: #fff;
  color: var(--ink);
}
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn-primary {
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  color: #fff;
  box-shadow: 0 6px 16px -6px rgba(79, 70, 229, .7);
}
.btn-primary:hover:not(:disabled) { transform: translateY(-1px); filter: brightness(1.05); }
.btn-ghost { border-color: var(--line); color: var(--ink-2); }
.btn-ghost:hover:not(:disabled) { border-color: var(--brand); color: var(--brand); }
.btn-lg { padding: 12px 26px; font-size: 15px; font-weight: 600; }

/* ---------- hero ---------- */
.hero { max-width: 900px; margin: 12px auto 0; padding: 34px 20px 26px; text-align: center; }
.hero h1 {
  font-size: 38px;
  line-height: 1.3;
  margin: 0 0 14px;
  letter-spacing: -.5px;
  background: linear-gradient(120deg, #1d1b4b, #4f46e5 60%, #7c3aed);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.hero-sub { color: var(--ink-2); font-size: 15px; margin: 0 auto 18px; max-width: 640px; }
.hero-badges { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; }
.hero-badges span {
  font-size: 13px; color: var(--ink-2);
  background: #fff; border: 1px solid var(--line);
  padding: 5px 12px; border-radius: 999px;
}
.only-mobile { display: none; }

/* ---------- panel ---------- */
.panel {
  max-width: 900px;
  margin: 6px auto 40px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: var(--shadow);
  padding: 20px;
}

.tabs { display: flex; gap: 6px; background: #f2f4f7; padding: 5px; border-radius: 12px; margin-bottom: 18px; }
.tab {
  flex: 1; border: none; background: transparent; padding: 10px; border-radius: 9px;
  font-size: 14px; font-family: inherit; color: var(--ink-2); cursor: pointer; transition: .15s;
}
.tab.active { background: #fff; color: var(--brand); font-weight: 600; box-shadow: 0 1px 3px rgba(16,24,40,.1); }

.drop-zone {
  border: 2px dashed #d0d5dd;
  border-radius: var(--radius);
  padding: 34px 18px;
  text-align: center;
  background: #fcfcfd;
  transition: .18s;
}
.drop-zone.drag { border-color: var(--brand); background: var(--brand-soft); }
.drop-icon {
  width: 46px; height: 46px; margin: 0 auto 10px;
  display: grid; place-items: center; border-radius: 50%;
  background: var(--brand-soft); color: var(--brand); font-size: 20px;
}
.drop-title { margin: 0 0 4px; font-weight: 600; }
.drop-hint { margin: 0 0 14px; font-size: 13px; color: var(--ink-3); }

/* ---------- options ---------- */
.options {
  display: flex; flex-wrap: wrap; gap: 14px;
  margin-top: 16px; padding: 16px; background: #f9fafb;
  border-radius: 12px; border: 1px solid #f0f2f5;
}
.options.hidden { display: none; }
.opt { flex: 1 1 200px; display: flex; flex-direction: column; gap: 7px; font-size: 13px; color: var(--ink-2); }
.opt b { color: var(--brand); font-variant-numeric: tabular-nums; }
.opt select, .opt input[type="text"] {
  width: 100%; padding: 9px 11px; border: 1px solid var(--line);
  border-radius: 9px; font-family: inherit; font-size: 13px; background: #fff; color: var(--ink);
}
.opt input[type="range"] { accent-color: var(--brand); }
.opt-note { margin: 0; font-size: 13px; color: var(--ink-3); flex: 1 1 100%; }

.actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-top: 18px; }
.actions .btn-lg { min-width: 150px; }
.hidden { display: none !important; }

.status { font-size: 13px; color: var(--ink-3); margin-top: 12px; min-height: 18px; }
.status.error { color: #d92d20; }

/* ---------- results ---------- */
.results { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 14px; margin-top: 16px; }
.result {
  border: 1px solid var(--line); border-radius: 12px; overflow: hidden; background: #fff;
  display: flex; flex-direction: column;
}
.result-thumb {
  height: 130px; background: repeating-conic-gradient(#f2f4f7 0% 25%, #fff 0% 50%) 50% / 16px 16px;
  display: grid; place-items: center; overflow: hidden;
}
.result-thumb img { max-width: 100%; max-height: 130px; display: block; }
.result-body { padding: 10px 12px 12px; font-size: 12px; color: var(--ink-2); }
.result-name { font-weight: 600; color: var(--ink); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.result-meta { display: flex; justify-content: space-between; gap: 8px; margin: 6px 0 9px; }
.result-meta .save { color: var(--ok); font-weight: 600; }
.result a.dl {
  display: block; text-align: center; padding: 7px; border-radius: 8px;
  background: var(--brand-soft); color: var(--brand); font-weight: 600; font-size: 12px;
}
.result a.dl:hover { background: #e0e7ff; }

/* ---------- pro card ---------- */
.pro-card {
  max-width: 900px; margin: 0 auto 48px;
  display: flex; flex-wrap: wrap; gap: 24px; align-items: center; justify-content: space-between;
  padding: 28px 30px; border-radius: 18px;
  background: linear-gradient(135deg, #1e1b4b, #312e81 55%, #4f46e5);
  color: #fff; box-shadow: 0 18px 40px -18px rgba(49, 46, 129, .8);
}
.pro-card h2 { margin: 0 0 12px; font-size: 22px; }
.pro-list { list-style: none; margin: 0; padding: 0; font-size: 14px; color: #d7d4f7; display: grid; gap: 6px; }
.pro-right { text-align: center; }
.price { font-size: 40px; font-weight: 700; line-height: 1; margin-bottom: 14px; }
.price small { font-size: 18px; vertical-align: super; }
.price span { font-size: 13px; font-weight: 400; color: #c7c3f5; }
.pro-right .btn-primary { background: #fff; color: var(--brand); box-shadow: 0 8px 20px -8px rgba(0,0,0,.5); }
.pro-tip { font-size: 12px; color: #b6b1ee; margin: 10px 0 0; }

/* ---------- info & faq ---------- */
.tools-info, .faq { max-width: 900px; margin: 0 auto 40px; padding: 0 20px; }
.tools-info h2, .faq h2 { font-size: 22px; margin: 0 0 16px; }
.info-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; }
.info-grid article { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 18px; }
.info-grid h3 { margin: 0 0 8px; font-size: 15px; }
.info-grid p { margin: 0; font-size: 13px; color: var(--ink-2); }

.faq details {
  background: #fff; border: 1px solid var(--line); border-radius: 12px;
  padding: 14px 18px; margin-bottom: 10px;
}
.faq summary { cursor: pointer; font-weight: 600; font-size: 14px; }
.faq details p { margin: 10px 0 0; font-size: 13px; color: var(--ink-2); }

/* ---------- footer ---------- */
.site-footer { text-align: center; padding: 26px 20px 40px; color: var(--ink-3); font-size: 13px; }
.site-footer p { margin: 4px 0; }

/* ---------- modal ---------- */
.modal {
  position: fixed; inset: 0; z-index: 50;
  background: rgba(16, 24, 40, .55);
  display: grid; place-items: center; padding: 20px;
  backdrop-filter: blur(3px);
}
.modal-box {
  position: relative; width: min(420px, 100%);
  background: #fff; border-radius: 18px; padding: 26px;
  text-align: center; box-shadow: 0 24px 60px -20px rgba(0,0,0,.5);
}
.modal-close {
  position: absolute; top: 10px; right: 14px; border: none; background: none;
  font-size: 24px; line-height: 1; color: var(--ink-3); cursor: pointer;
}
.modal-box h3 { margin: 0 0 8px; font-size: 19px; }
.modal-desc { font-size: 13px; color: var(--ink-2); margin: 0 0 8px; }
.modal-note { font-size: 12px; color: var(--ink-3); margin: 0 0 14px; }
.pay-wrap { position: relative; width: 200px; height: 200px; margin: 0 auto 14px; border-radius: 12px; overflow: hidden; border: 1px solid var(--line); }
.pay-wrap img { width: 100%; height: 100%; object-fit: contain; display: block; }
.pay-placeholder {
  position: absolute; inset: 0; display: grid; place-items: center;
  background: #f9fafb; color: var(--ink-3); font-size: 13px; text-align: center; padding: 10px;
}
.pay-placeholder small { font-size: 11px; }
.modal-step { font-size: 12px; color: var(--ink-3); margin: 0 0 14px; }
.code-row { display: flex; gap: 8px; }
.code-row input {
  flex: 1; padding: 11px 12px; border: 1px solid var(--line); border-radius: 10px;
  font-family: inherit; font-size: 13px; min-width: 0;
}
.modal-msg { font-size: 13px; margin: 12px 0 0; min-height: 18px; }
.modal-msg.ok { color: var(--ok); }
.modal-msg.err { color: #d92d20; }

/* ---------- responsive ---------- */
@media (max-width: 640px) {
  .site-nav { gap: 12px; font-size: 13px; }
  .site-nav a { display: none; }
  .hero h1 { font-size: 26px; }
  .only-mobile { display: block; }
  .panel { margin: 0 12px 30px; padding: 14px; border-radius: 14px; }
  .pro-card { margin: 0 12px 34px; padding: 22px; }
  .tabs { font-size: 13px; }
  .tab { padding: 9px 4px; }
  .results { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
}
