:root {
  --bg0: #f3f6fa;
  --bg1: #e8eef6;
  --panel: #ffffff;
  --line: #d7e0ea;
  --text: #1a2330;
  --muted: #667789;
  --ok: #1f9d62;
  --ig: #e0317a;
  --ig-soft: rgba(224, 49, 122, 0.1);
  --fb: #1877f2;
  --fb-soft: rgba(24, 119, 242, 0.1);
  --accent: var(--ig);
  --accent-soft: var(--ig-soft);
  --radius: 18px;
  --font: "Instrument Sans", "DM Sans", "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  --shadow: 0 12px 36px rgba(26, 45, 72, 0.08);
}

* { box-sizing: border-box; }

html, body { min-height: 100%; }

body {
  margin: 0;
  font-family: var(--font);
  color: var(--text);
  background:
    radial-gradient(900px 480px at 12% -8%, #dce8f8 0%, transparent 55%),
    radial-gradient(700px 420px at 100% 0%, #f0e6ef 0%, transparent 45%),
    linear-gradient(180deg, #f7f9fc 0%, var(--bg0) 48%, #eef3f9 100%);
  overflow-x: hidden;
}

body[data-plat="ig"] {
  --accent: var(--ig);
  --accent-soft: var(--ig-soft);
}
body[data-plat="fb"] {
  --accent: var(--fb);
  --accent-soft: var(--fb-soft);
}

.bg-orb {
  position: fixed;
  border-radius: 50%;
  filter: blur(80px);
  pointer-events: none;
  z-index: 0;
  opacity: 0.55;
  transition: background 0.45s ease;
}
.bg-orb-a {
  width: 360px; height: 360px;
  top: -90px; left: -50px;
  background: var(--accent-soft);
}
.bg-orb-b {
  width: 300px; height: 300px;
  bottom: 8%; right: -70px;
  background: rgba(120, 160, 210, 0.2);
}

.app {
  position: relative;
  z-index: 1;
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
  padding: 36px 0 56px;
  animation: rise 0.55s ease both;
}

@keyframes rise {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: none; }
}

.hero { margin-bottom: 22px; }
.brand-row {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
}
.logo {
  width: 28px; height: 28px; border-radius: 9px;
  background: linear-gradient(145deg, var(--accent), #6ea5ff);
  box-shadow: 0 8px 20px var(--accent-soft);
  animation: pulse 2.8s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.05); }
}
.brand {
  font-weight: 700;
  letter-spacing: 0.04em;
  font-size: 0.92rem;
  color: var(--muted);
  text-transform: uppercase;
}
.hero h1 {
  margin: 0 0 8px;
  font-size: clamp(1.6rem, 3.2vw, 2.15rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.15;
  color: #132033;
}
.lede {
  margin: 0;
  max-width: 38rem;
  color: var(--muted);
  font-size: 0.98rem;
  line-height: 1.55;
}

.plat-switch {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 14px;
}
.plat {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 16px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.78);
  color: var(--muted);
  cursor: pointer;
  font: inherit;
  font-weight: 600;
  transition: border-color 0.2s, background 0.2s, color 0.2s, transform 0.2s, box-shadow 0.2s;
}
.plat small {
  margin-left: auto;
  font-size: 0.75rem;
  font-weight: 500;
  opacity: 0.8;
}
.plat:hover { transform: translateY(-1px); color: var(--text); }
.plat.active {
  color: var(--text);
  border-color: color-mix(in srgb, var(--accent) 45%, var(--line));
  background: linear-gradient(180deg, #fff, color-mix(in srgb, var(--accent-soft) 70%, #fff));
  box-shadow: var(--shadow);
}
.plat-dot {
  width: 10px; height: 10px; border-radius: 50%;
}
.plat-dot.ig { background: var(--ig); }
.plat-dot.fb { background: var(--fb); }

.shell {
  border: 1px solid var(--line);
  border-radius: calc(var(--radius) + 4px);
  background: var(--panel);
  padding: 16px;
  box-shadow: var(--shadow);
}

.drop {
  position: relative;
  border: 1.5px dashed #c5d2e0;
  border-radius: var(--radius);
  padding: 28px 20px 24px;
  text-align: center;
  background:
    linear-gradient(180deg, #f8fbff, #f3f7fc);
  transition: border-color 0.2s, background 0.2s, box-shadow 0.2s;
}
.drop.drag {
  border-color: var(--accent);
  background: var(--accent-soft);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 30%, transparent);
}
.file-native {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0);
  white-space: nowrap; border: 0;
}
.drop-icon {
  width: 64px; height: 64px; margin: 0 auto 12px;
  display: grid; place-items: center;
  border-radius: 18px;
  color: var(--accent);
  background: #fff;
  border: 1px solid var(--line);
  box-shadow: 0 6px 16px rgba(26, 45, 72, 0.06);
  transition: transform 0.25s ease;
}
.drop.drag .drop-icon { transform: translateY(-4px); }
.drop-title {
  margin: 0 0 6px;
  font-size: 1.05rem;
  font-weight: 650;
  color: #162337;
}
.drop-hint {
  margin: 0 0 16px;
  color: var(--muted);
  font-size: 0.88rem;
}
.btn-pick {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 148px;
  padding: 12px 22px;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--accent), color-mix(in srgb, var(--accent) 70%, #5a8dff));
  color: #fff;
  font-weight: 700;
  font-size: 0.92rem;
  cursor: pointer;
  box-shadow: 0 10px 24px var(--accent-soft);
  transition: transform 0.15s ease, filter 0.15s ease;
  user-select: none;
}
.btn-pick:hover { transform: translateY(-1px); filter: brightness(1.04); }
.btn-pick:active { transform: translateY(0); }
.pick-row { display: flex; justify-content: center; gap: 10px; flex-wrap: wrap; }

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  margin: 14px 0 12px;
  padding: 0 2px;
}
.stat-block { display: flex; flex-direction: column; gap: 2px; }
.stat-label {
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}
#stat { font-size: 0.98rem; font-weight: 650; color: #162337; }
.action-btns { display: flex; flex-wrap: wrap; gap: 8px; }

.btn {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--text);
  border-radius: 10px;
  padding: 9px 14px;
  font: inherit;
  font-size: 0.86rem;
  font-weight: 600;
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s, background 0.15s;
}
.btn:hover:not(:disabled) {
  border-color: color-mix(in srgb, var(--accent) 45%, var(--line));
  color: var(--accent);
}
.btn:disabled { opacity: 0.45; cursor: not-allowed; }
.btn.export {
  border: none;
  background: linear-gradient(135deg, var(--accent), color-mix(in srgb, var(--accent) 55%, #6ea5ff));
  color: #fff;
  box-shadow: 0 8px 20px var(--accent-soft);
}
.btn.export:hover:not(:disabled) { color: #fff; filter: brightness(1.04); }

.table-wrap {
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fbfcfe;
  max-height: min(58vh, 640px);
}
table { width: 100%; border-collapse: collapse; min-width: 880px; }
th, td {
  padding: 11px 12px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
  font-size: 0.86rem;
}
th {
  position: sticky; top: 0; z-index: 1;
  background: #eef3f8;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 650;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  white-space: nowrap;
}
tr:last-child td { border-bottom: none; }
tr:hover td { background: #f5f8fc; }
.empty {
  text-align: center !important;
  color: var(--muted);
  padding: 48px 16px !important;
  background: #fff !important;
}
.num { font-variant-numeric: tabular-nums; }
.mono { font-family: ui-monospace, Consolas, monospace; font-size: 0.78rem; }
.bool {
  display: inline-block;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
}
.bool.yes { background: rgba(31, 157, 98, 0.12); color: var(--ok); }
.bool.no { background: #eef2f6; color: var(--muted); }

.cookie-cell { display: flex; flex-direction: column; gap: 8px; align-items: flex-start; }
.cookie-badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--ok);
  background: rgba(31, 157, 98, 0.1);
  border: 1px solid rgba(31, 157, 98, 0.2);
}
.btn-mini {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--text);
  border-radius: 8px;
  padding: 6px 10px;
  font: inherit;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
}
.btn-mini:hover { border-color: var(--accent); color: var(--accent); }

a.link { color: var(--fb); text-decoration: none; }
a.link:hover { text-decoration: underline; }

.foot {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
  align-items: center;
  margin-top: 16px;
  color: var(--muted);
  font-size: 0.8rem;
}
.foot code {
  padding: 4px 8px;
  border-radius: 8px;
  background: #fff;
  border: 1px solid var(--line);
  font-size: 0.74rem;
  color: #445566;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%) translateY(8px);
  background: #fff;
  border: 1px solid var(--line);
  color: var(--text);
  padding: 11px 16px;
  border-radius: 12px;
  z-index: 40;
  box-shadow: var(--shadow);
  animation: toast-in 0.25s ease both;
}
@keyframes toast-in {
  from { opacity: 0; transform: translateX(-50%) translateY(14px); }
  to { opacity: 1; transform: translateX(-50%) translateY(0); }
}

/* 自定义提示框 */
.dlg-bg {
  position: fixed; inset: 0; z-index: 60;
  background: rgba(30, 45, 65, 0.28);
  backdrop-filter: blur(6px);
  display: grid; place-items: center;
  padding: 16px;
  animation: fade-in 0.2s ease both;
}
.dlg-bg.hidden { display: none; }
@keyframes fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}
.dlg {
  width: min(420px, 100%);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 22px;
  padding: 28px 24px 20px;
  box-shadow: 0 28px 64px rgba(26, 45, 72, 0.18);
  text-align: center;
  animation: dlg-pop 0.28s cubic-bezier(.2,.8,.2,1) both;
}
@keyframes dlg-pop {
  from { opacity: 0; transform: translateY(12px) scale(0.96); }
  to { opacity: 1; transform: none; }
}
.dlg-icon {
  width: 56px; height: 56px; margin: 0 auto 14px;
  display: grid; place-items: center;
  border-radius: 18px;
  font-size: 1.6rem;
  background: linear-gradient(180deg, #f7faff, #eef4fb);
  border: 1px solid var(--line);
}
.dlg-title {
  margin: 0 0 8px;
  font-size: 1.2rem;
  font-weight: 700;
  color: #152338;
  letter-spacing: -0.02em;
}
.dlg-desc {
  margin: 0 0 14px;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.55;
}
.dlg-list {
  list-style: none;
  margin: 0 0 16px;
  padding: 10px 12px;
  text-align: left;
  border-radius: 12px;
  background: #f5f8fc;
  border: 1px solid var(--line);
  max-height: 140px;
  overflow: auto;
}
.dlg-list.hidden { display: none; }
.dlg-list li {
  font-size: 0.82rem;
  color: #3a4d63;
  padding: 4px 0;
  border-bottom: 1px dashed #e2eaf2;
}
.dlg-list li:last-child { border-bottom: none; }
.dlg-actions {
  display: flex;
  gap: 10px;
  justify-content: center;
  margin-top: 6px;
}
.dlg-actions .btn {
  min-width: 112px;
  border-radius: 999px;
  padding: 11px 18px;
}
.dlg-actions .btn.export {
  border-radius: 999px;
}

.modal-bg {
  position: fixed; inset: 0; z-index: 50;
  background: rgba(24, 36, 52, 0.35);
  display: grid; place-items: center;
  padding: 16px;
}
.modal-bg.hidden { display: none; }
.modal {
  width: min(860px, 100%);
  max-height: 82vh;
  overflow: auto;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 16px;
  box-shadow: 0 24px 60px rgba(26, 45, 72, 0.18);
}
.modal-hd {
  display: flex; flex-wrap: wrap; gap: 8px 12px;
  align-items: center; justify-content: space-between;
  margin-bottom: 10px;
}
.modal .chip {
  color: var(--muted);
  font-size: 0.8rem;
  padding: 4px 8px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: #f5f8fc;
}
.modal pre {
  margin: 0;
  padding: 12px;
  border-radius: 12px;
  background: #f5f8fc;
  border: 1px solid var(--line);
  max-height: 55vh;
  overflow: auto;
  white-space: pre-wrap;
  word-break: break-all;
  font-size: 0.78rem;
  line-height: 1.45;
  color: #243447;
}
.modal-actions {
  display: flex; gap: 8px; justify-content: flex-end;
  margin-top: 12px; flex-wrap: wrap;
}

@media (max-width: 720px) {
  .app { width: min(100% - 20px, 1120px); padding-top: 24px; }
  .plat-switch { grid-template-columns: 1fr; }
  .actions { flex-direction: column; align-items: stretch; }
  .action-btns { width: 100%; }
  .action-btns .btn { flex: 1; }
}
