:root {
  color-scheme: light;
  --primary: #00acb0;
  --primary-dark: #007f83;
  --primary-deep: #006f73;
  --primary-soft: #e8f8f7;
  --background: #f4f7f6;
  --surface: #ffffff;
  --surface-muted: #f7f9f8;
  --text: #212529;
  --muted: #6a7173;
  --line: #dfe6e4;
  --warning: #ad6429;
  --warning-soft: #fff3e8;
  --danger: #b83f47;
  --danger-soft: #fdebed;
  --shadow: 0 18px 55px rgba(25, 54, 54, .07);
  font-family: -apple-system, BlinkMacSystemFont, Montserrat, "Noto Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif;
}

* { box-sizing: border-box; }
html { min-width: 320px; background: var(--background); }
body { margin: 0; background: var(--background); color: var(--text); }
button, input, select { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }

.topbar {
  min-height: 82px;
  padding: 12px max(24px, calc((100vw - 1320px) / 2));
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  background: rgba(255, 255, 255, .97);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 20;
  backdrop-filter: blur(14px);
}

.brand, .login-brand { display: flex; align-items: center; color: inherit; text-decoration: none; }
.brand-logo { width: 112px; height: auto; display: block; }
.brand-divider { width: 1px; height: 34px; margin: 0 15px; background: var(--line); }
.brand-product strong { display: block; font-size: 16px; letter-spacing: .02em; }
.brand-product small { display: block; margin-top: 3px; color: var(--muted); font-size: 9px; letter-spacing: .11em; }
.topbar-actions { display: flex; align-items: center; gap: 10px; }
.event-label { padding: 9px 13px; border-radius: 999px; color: var(--primary-dark); background: var(--primary-soft); font-size: 12px; font-weight: 650; }

.page-shell { max-width: 1320px; margin: 0 auto; padding: 48px 24px 70px; }
.page-heading { display: flex; justify-content: space-between; align-items: flex-end; gap: 28px; }
.eyebrow { margin: 0 0 8px; color: var(--primary-dark); font-size: 11px; font-weight: 750; letter-spacing: .10em; }
.eyebrow.light { color: rgba(255, 255, 255, .78); }
h1, h2, h3, p { margin-top: 0; }
h1 { margin-bottom: 10px; color: #111; font-size: clamp(30px, 3.4vw, 48px); line-height: 1.12; letter-spacing: -.035em; }
h2 { margin-bottom: 0; color: #171a1b; font-size: 20px; }
.subtitle { max-width: 720px; margin-bottom: 0; color: var(--muted); font-size: 14px; line-height: 1.75; }

.primary-button, .secondary-button {
  min-height: 44px;
  border-radius: 999px;
  padding: 10px 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  text-decoration: none;
  font-weight: 650;
  cursor: pointer;
  transition: transform .18s ease, background .18s ease, border-color .18s ease;
}
.primary-button { border: 1px solid var(--primary); background: var(--primary); color: #fff; }
.primary-button:hover { background: var(--primary-dark); border-color: var(--primary-dark); transform: translateY(-1px); }
.secondary-button { border: 1px solid var(--line); background: var(--surface); color: var(--text); font-size: 12px; }
.secondary-button:hover { border-color: var(--primary); color: var(--primary-dark); }

.summary-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; margin: 34px 0 20px; }
.summary-card { position: relative; overflow: hidden; min-height: 118px; padding: 23px 24px; border: 1px solid var(--line); background: var(--surface); }
.summary-card::before { content: ""; position: absolute; inset: 0 auto 0 0; width: 4px; background: var(--primary); }
.summary-card span { display: block; color: var(--muted); font-size: 12px; }
.summary-card strong { display: block; margin-top: 8px; color: #111; font-size: 34px; line-height: 1; }

.filterbar {
  display: grid;
  grid-template-columns: minmax(280px, 1.55fr) repeat(2, minmax(170px, .5fr));
  gap: 14px;
  padding: 20px;
  background: var(--surface);
  border: 1px solid var(--line);
  margin-bottom: 20px;
}
.filterbar label span { display: block; margin: 0 0 7px 2px; color: var(--muted); font-size: 11px; }
.filterbar input, .filterbar select { width: 100%; height: 44px; border: 1px solid var(--line); border-radius: 0; background: var(--surface-muted); color: var(--text); padding: 0 13px; outline: none; }
.filterbar input:focus, .filterbar select:focus { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }

.data-panel { background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow); overflow: hidden; }
.table-heading { min-height: 66px; padding: 0 22px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line); }
.table-heading span { color: var(--muted); font-size: 12px; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; min-width: 980px; }
th { padding: 13px 15px; color: var(--muted); background: var(--surface-muted); font-size: 11px; font-weight: 650; text-align: left; letter-spacing: .02em; }
td { padding: 15px; border-top: 1px solid var(--line); font-size: 12px; vertical-align: middle; }
tbody tr { cursor: pointer; transition: background .16s ease; }
tbody tr:hover { background: #f0fbfa; }
.card-thumb { width: 82px; height: 51px; border-radius: 3px; object-fit: cover; background: var(--surface-muted); border: 1px solid var(--line); }
.person-cell strong { display: block; color: #171a1b; font-size: 14px; }
.person-cell span, .contact-cell span, .source-cell span { display: block; margin-top: 5px; color: var(--muted); overflow-wrap: anywhere; }
.status { display: inline-flex; padding: 6px 10px; border-radius: 999px; font-size: 10px; font-weight: 650; }
.status.recognized { color: var(--primary-dark); background: var(--primary-soft); }
.status.needs_review { color: var(--warning); background: var(--warning-soft); }
.status.pending { color: #59666a; background: #eef2f2; }
.empty-state { padding: 64px 20px; text-align: center; }
.empty-icon { width: 58px; height: 58px; margin: 0 auto 16px; border-radius: 50%; display: grid; place-items: center; color: #fff; background: var(--primary); font-size: 24px; }
.empty-state h3 { margin-bottom: 8px; }
.empty-state p { margin-bottom: 0; color: var(--muted); font-size: 13px; }

dialog { width: min(780px, calc(100vw - 30px)); max-height: calc(100vh - 40px); padding: 0; border: 0; border-radius: 24px; background: var(--surface); color: var(--text); box-shadow: 0 24px 90px rgba(0,0,0,.24); }
dialog::backdrop { background: rgba(7, 24, 24, .58); backdrop-filter: blur(5px); }
.dialog-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; padding: 23px; border-bottom: 1px solid var(--line); }
.dialog-head h2 { font-size: 24px; }
.icon-button { width: 40px; height: 40px; border: 1px solid var(--line); border-radius: 50%; background: var(--surface); color: var(--text); font-size: 23px; cursor: pointer; }
.detail-grid { display: grid; grid-template-columns: minmax(230px, .8fr) minmax(280px, 1.2fr); gap: 22px; padding: 23px; }
.detail-image { width: 100%; border-radius: 4px; border: 1px solid var(--line); }
.detail-images { display: grid; gap: 14px; align-content: start; }
.detail-images figure { margin: 0; }
.detail-images figcaption { margin-top: 6px; color: var(--muted); font-size: 10px; text-align: center; }
.detail-fields { display: grid; gap: 0; }
.detail-field { display: grid; grid-template-columns: 90px 1fr; gap: 12px; padding: 11px 0; border-bottom: 1px solid var(--line); }
.detail-field span { color: var(--muted); font-size: 11px; }
.detail-field strong { font-size: 12px; font-weight: 500; overflow-wrap: anywhere; }
.detail-note { grid-column: 1 / -1; padding: 17px; border-left: 4px solid var(--primary); background: var(--primary-soft); }
.detail-note span { display: block; color: var(--primary-dark); font-size: 11px; margin-bottom: 7px; }
.detail-note p { margin: 0; white-space: pre-wrap; font-size: 13px; line-height: 1.65; }
.toast { position: fixed; right: 24px; bottom: 24px; z-index: 50; transform: translateY(14px); opacity: 0; pointer-events: none; padding: 12px 16px; border-radius: 999px; color: #fff; background: var(--text); font-size: 12px; transition: .2s ease; }
.toast.visible { transform: translateY(0); opacity: 1; }

.login-page { min-height: 100vh; background: #f3f6f5; }
.login-shell { min-height: 100vh; display: grid; grid-template-columns: minmax(380px, .92fr) minmax(420px, 1.08fr); }
.login-showcase { position: relative; overflow: hidden; min-height: 100vh; padding: clamp(38px, 6vw, 82px); display: flex; flex-direction: column; justify-content: space-between; color: #fff; background: var(--primary-deep); }
.login-showcase::before, .login-showcase::after { content: ""; position: absolute; border: 1px solid rgba(255,255,255,.22); border-radius: 50%; }
.login-showcase::before { width: 46vw; height: 46vw; right: -22vw; top: -12vw; }
.login-showcase::after { width: 32vw; height: 32vw; left: -16vw; bottom: -14vw; background: var(--primary); border: 0; }
.login-showcase > * { position: relative; z-index: 1; }
.login-showcase > img { width: clamp(130px, 15vw, 190px); height: auto; }
.login-showcase-copy { max-width: 600px; }
.login-showcase-copy h2 { color: #fff; font-size: clamp(31px, 3.6vw, 52px); line-height: 1.22; letter-spacing: -.045em; }
.login-showcase-copy > p:last-child { max-width: 480px; margin: 23px 0 0; color: rgba(255,255,255,.75); line-height: 1.8; }
.login-showcase-index { font-size: 10px; letter-spacing: .16em; }
.login-card { width: min(100% - 48px, 480px); margin: auto; padding: 38px; border: 1px solid var(--line); background: var(--surface); box-shadow: var(--shadow); }
.login-brand { margin-bottom: 46px; }
.login-brand img { width: 122px; height: auto; }
.login-brand strong, .login-brand small { display: block; }
.login-brand strong { font-size: 16px; }
.login-brand small { margin-top: 3px; color: var(--muted); font-size: 10px; }
.login-card h1 { margin-bottom: 10px; font-size: 34px; }
.login-subtitle { margin-bottom: 28px; color: var(--muted); font-size: 13px; line-height: 1.7; }
.login-error { padding: 11px 13px; border-left: 3px solid var(--danger); color: #a23b42; background: var(--danger-soft); font-size: 12px; }
.login-form { display: grid; gap: 16px; }
.login-form label span { display: block; margin: 0 0 7px 2px; color: var(--muted); font-size: 11px; }
.login-form input { width: 100%; height: 48px; border: 1px solid var(--line); border-radius: 0; background: var(--surface-muted); padding: 0 13px; outline: none; }
.login-form input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }
.login-form .primary-button { margin-top: 6px; min-height: 48px; }
.login-note { margin: 21px 0 0; color: var(--muted); text-align: center; font-size: 10px; }

@media (max-width: 900px) {
  .login-shell { grid-template-columns: 1fr; }
  .login-showcase { min-height: 280px; padding: 32px; }
  .login-showcase-copy h2 { margin-bottom: 0; font-size: 34px; }
  .login-showcase-copy > p:last-child, .login-showcase-index { display: none; }
  .login-card { margin: 34px auto; }
}

@media (max-width: 760px) {
  .topbar { min-height: 68px; padding: 9px 13px; gap: 10px; }
  .brand-logo { width: 92px; }
  .brand-divider { height: 28px; margin: 0 10px; }
  .brand-product strong { font-size: 14px; }
  .brand-product small { display: none; }
  .event-label, .topbar-actions .secondary-button:first-of-type { display: none; }
  .topbar-actions { gap: 6px; }
  .secondary-button { min-height: 40px; padding: 8px 13px; }
  .page-shell { padding: 30px 13px 48px; }
  .page-heading { align-items: flex-start; }
  .page-heading .primary-button { flex: 0 0 auto; min-width: 74px; padding-inline: 14px; }
  h1 { font-size: 31px; }
  .subtitle { font-size: 13px; }
  .summary-grid { grid-template-columns: 1fr 1fr; margin-top: 26px; gap: 10px; }
  .summary-card { min-height: 100px; padding: 18px; }
  .summary-card strong { font-size: 29px; }
  .summary-card:last-child { grid-column: 1 / -1; }
  .filterbar { grid-template-columns: 1fr; padding: 15px; }
  .data-panel { border: 0; background: transparent; box-shadow: none; overflow: visible; }
  .table-heading { min-height: 54px; padding: 0 3px; border: 0; }
  .table-wrap { overflow: visible; }
  table, tbody { display: block; min-width: 0; }
  thead { display: none; }
  tbody { display: grid; gap: 11px; }
  tbody tr { display: grid; grid-template-columns: 92px 1fr; column-gap: 13px; padding: 14px; border: 1px solid var(--line); background: var(--surface); box-shadow: 0 8px 25px rgba(25,54,54,.05); }
  tbody tr:hover { background: var(--surface); }
  td { display: block; min-width: 0; padding: 8px 0; border: 0; border-bottom: 1px solid var(--line); font-size: 12px; }
  td::before { content: attr(data-label); display: block; margin-bottom: 5px; color: var(--muted); font-size: 9px; letter-spacing: .06em; }
  td:first-child { grid-row: 1 / span 2; padding: 0; border: 0; }
  td:first-child::before { display: none; }
  td:nth-child(2) { padding-top: 0; }
  td:nth-child(n+3) { grid-column: 1 / -1; }
  td:last-child { border-bottom: 0; padding-bottom: 0; }
  .card-thumb { width: 92px; height: 58px; }
  .detail-grid { grid-template-columns: 1fr; }
  .detail-note { grid-column: auto; }
  .toast { left: 50%; right: auto; transform: translate(-50%, 14px); max-width: calc(100vw - 28px); text-align: center; }
  .toast.visible { transform: translate(-50%, 0); }
}

@media (max-width: 520px) {
  .brand-product { display: none; }
  .brand-divider { display: none; }
  .login-showcase { min-height: 235px; padding: 26px; }
  .login-showcase-copy h2 { font-size: 28px; }
  .login-card { width: calc(100% - 26px); margin: 13px auto 28px; padding: 26px 21px; }
  .login-brand { margin-bottom: 34px; }
}
