:root {
  --brand: #4f46e5;
  --brand-2: #06b6d4;
  --brand-dark: #3730a3;
  --ink: #161a2b;
  --ink-2: #4b5470;
  --ink-3: #7a839e;
  --line: #e6e8f0;
  --bg: #f5f6fb;
  --card: #ffffff;
  --ok: #12b76a;
  --warn: #f79009;
  --err: #f04438;
  --running: #2e90fa;
  --radius: 16px;
  --shadow-sm: 0 1px 2px rgba(16, 24, 40, .06), 0 1px 3px rgba(16, 24, 40, .08);
  --shadow-md: 0 12px 32px rgba(16, 24, 40, .10);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", Roboto, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  line-height: 1.6;
}

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

/* ---------------- Header ---------------- */
.hero {
  position: relative;
  overflow: hidden;
  padding: 46px 20px 96px;
  background: linear-gradient(135deg, #4f46e5 0%, #4338ca 45%, #0e7490 100%);
  color: #fff;
}
.hero::after {
  content: "";
  position: absolute;
  right: -140px; top: -120px;
  width: 420px; height: 420px;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, rgba(255,255,255,.28), rgba(255,255,255,0) 70%);
}
.hero-inner {
  position: relative;
  max-width: 1080px;
  margin: 0 auto;
}
.brand-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}
.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 20px;
  font-weight: 700;
  letter-spacing: .4px;
}
.logo-mark {
  width: 34px; height: 34px;
  border-radius: 10px;
  background: rgba(255,255,255,.18);
  border: 1px solid rgba(255,255,255,.35);
  display: grid; place-items: center;
  font-size: 17px;
}
.hero-title {
  margin: 30px 0 8px;
  font-size: 34px;
  line-height: 1.25;
  font-weight: 800;
}
.hero-sub { margin: 0; opacity: .85; max-width: 620px; }

.hero-stats {
  display: flex;
  gap: 12px;
  margin-top: 26px;
  flex-wrap: wrap;
}
.stat {
  background: rgba(255,255,255,.14);
  border: 1px solid rgba(255,255,255,.22);
  border-radius: 14px;
  padding: 12px 18px;
  min-width: 140px;
  backdrop-filter: blur(6px);
}
.stat .k { font-size: 12px; opacity: .8; letter-spacing: .4px; }
.stat .v { font-size: 24px; font-weight: 800; margin-top: 2px; }

.lang-switch {
  display: inline-flex;
  border-radius: 999px;
  background: rgba(255,255,255,.16);
  border: 1px solid rgba(255,255,255,.28);
  padding: 3px;
}
.lang-switch button {
  border: 0;
  background: transparent;
  color: #fff;
  font-size: 13px;
  padding: 6px 14px;
  border-radius: 999px;
  cursor: pointer;
}
.lang-switch button.on { background: #fff; color: var(--brand-dark); font-weight: 700; }

/* ---------------- Layout ---------------- */
.wrap {
  max-width: 1080px;
  margin: -70px auto 60px;
  padding: 0 20px;
  position: relative;
  z-index: 2;
}
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  padding: 26px;
  margin-bottom: 22px;
}
.card-title {
  margin: 0 0 4px;
  font-size: 19px;
  font-weight: 800;
}
.card-desc { margin: 0 0 18px; color: var(--ink-3); font-size: 14px; }

/* ---------------- Notice ---------------- */
.notice {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  background: #fff8e6;
  border: 1px solid #ffe4a3;
  color: #7a4d05;
  border-radius: 12px;
  padding: 12px 16px;
  font-size: 14px;
  margin-bottom: 18px;
}
.notice.warn { background: #fff1f0; border-color: #ffc9c4; color: #912018; }

/* ---------------- Dropzone ---------------- */
.drop {
  border: 2px dashed #c7cbf5;
  background: linear-gradient(180deg, #fafaff, #f6f7ff);
  border-radius: 18px;
  padding: 34px 20px;
  text-align: center;
  cursor: pointer;
  transition: .18s ease;
}
.drop:hover { border-color: var(--brand); background: #f2f4ff; }
.drop.over { border-color: var(--brand); background: #e9ecff; transform: scale(1.005); }
.drop .dz-icon { font-size: 34px; }
.drop .dz-main { font-size: 18px; font-weight: 700; margin-top: 6px; }
.drop .dz-sub { color: var(--ink-3); font-size: 13px; margin-top: 6px; }
.drop.has-file { border-style: solid; border-color: var(--ok); background: #f0fdf6; }

.req-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 10px;
  margin: 16px 0 0;
  padding: 0;
  list-style: none;
}
.req-list li {
  background: #f7f8fd;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 13px;
  color: var(--ink-2);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 0;
  border-radius: 12px;
  padding: 12px 20px;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  transition: .15s ease;
}
.btn-primary {
  width: 100%;
  margin-top: 18px;
  color: #fff;
  background: linear-gradient(135deg, var(--brand), #6366f1 55%, var(--brand-2));
  box-shadow: 0 8px 20px rgba(79, 70, 229, .28);
}
.btn-primary:hover { filter: brightness(1.05); }
.btn:disabled { opacity: .55; cursor: not-allowed; box-shadow: none; }

.progress {
  height: 8px;
  border-radius: 999px;
  background: #eef0f7;
  overflow: hidden;
  margin-top: 14px;
  display: none;
}
.progress i {
  display: block;
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--brand), var(--brand-2));
  transition: width .2s;
}

/* ---------------- Job list ---------------- */
.jobs { margin-top: 6px; }
.job {
  display: flex;
  align-items: center;
  gap: 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 14px 16px;
  margin-bottom: 12px;
  transition: .15s ease;
}
.job:hover { border-color: #cdd2ea; box-shadow: var(--shadow-sm); }
.job-main { flex: 1; min-width: 0; }
.job-title {
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.job-meta { color: var(--ink-3); font-size: 12.5px; margin-top: 3px; }
.job-actions { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 999px;
}
.badge::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.b-SUBMITTED { background: #eef4ff; color: #175cd3; }
.b-ANALYSING { background: #eef4ff; color: #175cd3; }
.b-DOWNLOADED { background: #e7f8ef; color: #067647; }
.b-FAILED { background: #fef3f2; color: #b42318; }
.b-DELETED { background: #f2f4f7; color: #667085; }

.score {
  display: inline-flex;
  align-items: center;
  font-size: 12px;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: 999px;
  margin-left: 6px;
}
.s-sim { background: #fff4ed; color: #b54708; }
.s-ai { background: #f4f3ff; color: #5925dc; }

@keyframes pulse { 0%,100% { opacity: .35; } 50% { opacity: 1; } }
.b-ANALYSING::before, .b-SUBMITTED::before { animation: pulse 1.2s infinite; }

.btn-sm {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink-2);
  border-radius: 10px;
  padding: 7px 13px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}
.btn-sm:hover { border-color: var(--brand); color: var(--brand); }
.btn-sm.danger:hover { border-color: var(--err); color: var(--err); }
.btn-sm:disabled { opacity: .6; cursor: not-allowed; }

.empty {
  text-align: center;
  color: var(--ink-3);
  padding: 34px 10px;
  font-size: 14px;
}
.empty .e-icon { font-size: 32px; display: block; margin-bottom: 8px; opacity: .5; }

/* ---------------- FAQ ---------------- */
.faq-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 12px;
}
.faq-item {
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
  background: #fff;
}
.faq-q {
  padding: 13px 16px;
  cursor: pointer;
  font-weight: 600;
  font-size: 14.5px;
  display: flex;
  justify-content: space-between;
  gap: 10px;
  user-select: none;
}
.faq-q span:nth-child(2) { transition: .2s; color: var(--ink-3); }
.faq-item.open .faq-q span:nth-child(2) { transform: rotate(45deg); }
.faq-a {
  display: none;
  padding: 0 16px 14px;
  color: var(--ink-2);
  font-size: 14px;
  border-top: 1px dashed var(--line);
  padding-top: 12px;
}
.faq-item.open .faq-a { display: block; }

/* ---------------- Toast ---------------- */
.toasts {
  position: fixed;
  top: 18px;
  right: 18px;
  z-index: 999;
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: min(360px, calc(100vw - 36px));
}
.toast {
  background: #fff;
  border-left: 4px solid var(--brand);
  border-radius: 12px;
  box-shadow: var(--shadow-md);
  padding: 12px 16px;
  font-size: 14px;
  animation: slidein .22s ease;
}
.toast.ok { border-left-color: var(--ok); }
.toast.err { border-left-color: var(--err); }
.toast.warn { border-left-color: var(--warn); }
.toast b { display: block; margin-bottom: 2px; }
@keyframes slidein { from { transform: translateX(20px); opacity: 0; } }

/* ---------------- Footer ---------------- */
.foot {
  text-align: center;
  color: var(--ink-3);
  font-size: 13px;
  padding: 10px 0 40px;
}

.uid-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  background: rgba(255,255,255,.14);
  border: 1px solid rgba(255,255,255,.25);
  padding: 5px 12px;
  border-radius: 999px;
  cursor: pointer;
}
.uid-chip:hover { background: rgba(255,255,255,.24); }

@media (max-width: 640px) {
  .hero { padding: 32px 16px 82px; }
  .hero-title { font-size: 26px; }
  .card { padding: 18px; }
  .job { flex-direction: column; align-items: stretch; }
  .job-actions { justify-content: flex-start; }
}
