:root {
  color: #211c35;
  background: #f5f4f9;
  font: 16px/1.6 "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  font-synthesis: none;
  --muted: #625c75;
  --border: #e4e1ee;
  --accent: #513bb3;
  --accent-dark: #3e2894;
  --radius: 18px;
}

*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; min-width: 280px; }
button, input, select { font: inherit; }
a { color: inherit; }
h1, h2, p, dl { margin: 0; }
h1, h2 { line-height: 1.18; }

:focus-visible { outline: 3px solid #7356db; outline-offset: 3px; }
.wrap { width: min(100% - 64px, 1160px); margin-inline: auto; }
.muted { color: var(--muted); }
.topbar { border-bottom: 1px solid var(--border); background: #fff; }
.topbar-inner { display: flex; min-height: 72px; align-items: center; justify-content: space-between; gap: 18px; }
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; line-height: 1.15; }
.brand strong { display: block; font-size: 1.06rem; letter-spacing: -.025em; }
.brand small { display: block; margin-top: 4px; font-size: .8125rem; color: var(--muted); }
.brand-mark {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 3px;
  width: 38px;
  height: 38px;
  flex: 0 0 auto;
  border-radius: 12px;
  background: #382777;
}
.brand-mark i { width: 7px; height: 17px; transform: skewX(-22deg); border-radius: 2px; background: #e6e0ff; }
.brand-mark i + i { height: 13px; background: #bbabd9; }

.user-menu { display: flex; align-items: center; gap: 15px; }
.identity { display: grid; align-items: center; justify-items: end; line-height: 1.25; }
.identity strong { font-size: .9rem; max-width: 160px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.identity span { color: var(--muted); font-size: .8125rem; margin-top: 4px; }
.main-content { padding: 34px 0 60px; }
.overview {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
  margin-bottom: 24px;
  padding: clamp(22px, 4vw, 38px);
  color: #fff;
  border-radius: var(--radius);
  background: linear-gradient(108deg, #251d42 10%, #37276c 66%, #472f8f);
  box-shadow: 0 8px 24px #211c3517;
}
.overview h1 { font-size: clamp(1.9rem, 3.3vw, 2.65rem); letter-spacing: -.04em; }
.overview p { margin-top: 10px; color: #dfd8f9; }
.metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  min-width: min(100%, 344px);
  padding: 16px 0;
  border: 1px solid #ffffff39;
  border-radius: 14px;
  background: #ffffff0d;
}
.metrics div { padding: 0 19px; }
.metrics div + div { border-inline-start: 1px solid #ffffff37; }
.metrics dt { color: #ede6ff; font-size: .875rem; white-space: nowrap; }
.metrics dd { margin: 1px 0 0; line-height: 1.22; font-size: 1.8rem; font-weight: 650; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }

.workspace { display: grid; grid-template-columns: minmax(0, 1fr) minmax(275px, .44fr); align-items: start; gap: 22px; }
.workspace-admin { grid-template-columns: minmax(0, 1fr); }
.panel { background: #fff; border: 1px solid var(--border); border-radius: var(--radius); box-shadow: 0 4px 16px #211c3508; }
.create-panel { grid-column: 2; grid-row: 1; padding: 22px; min-width: 0; }
.records-panel { grid-column: 1; grid-row: 1; min-width: 0; }
.panel-heading { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 18px; }
.panel-heading h2 { font-size: 1.17rem; letter-spacing: -.02em; }
.records-heading { padding: 22px; margin-bottom: 0; }
.time-zone { font-variant-numeric: tabular-nums; font-size: .8125rem; }
.table-scroll { overflow-x: auto; }
.table-scroll:focus-visible { outline-offset: -3px; }
table { width: 100%; border-collapse: collapse; text-align: left; font-size: .9rem; }
th, td { padding: 12px 12px; }
th:first-child, td:first-child { padding-inline-start: 22px; }
th:last-child, td:last-child { padding-inline-end: 22px; }
thead { background: #f8f7fb; color: #57516a; }
th { font-weight: 650; white-space: nowrap; }
td { border-top: 1px solid #eeecf4; }
.record-label { display: block; font-weight: 650; min-width: 88px; overflow-wrap: anywhere; }
.record-id { display: block; color: var(--muted); font-size: .8125rem; line-height: 1.25; }
.record-time { white-space: nowrap; font-variant-numeric: tabular-nums; }
.status { display: inline-flex; align-items: center; gap: 7px; padding: 4px 9px; font-weight: 650; white-space: nowrap; border-radius: 20px; }
.status::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.status-pending { color: #7a470e; background: #fff0d9; }
.status-verified { color: #046245; background: #def5e9; }
.pagination { display: flex; align-items: center; justify-content: flex-end; gap: 12px; padding: 16px 22px; border-top: 1px solid var(--border); color: var(--muted); font-size: .875rem; }

.empty-state { display: grid; justify-items: center; gap: 7px; min-height: 240px; align-content: center; text-align: center; padding: 25px; border-top: 1px solid var(--border); }
.empty-state p { color: var(--muted); font-size: .9125rem; }
.empty-icon { width: 45px; height: 45px; display: grid; place-content: center; gap: 4px; margin-bottom: 6px; border-radius: 14px; color: var(--accent); background: #eee9fd; }
.empty-icon i { width: 18px; height: 2px; border-radius: 2px; background: currentColor; opacity: .75; }
.empty-icon i:last-child { width: 12px; }

.field-stack { display: grid; gap: 16px; }
.field { display: grid; gap: 6px; }
.field label { font-size: .9rem; font-weight: 650; }
.field input, .field select { display: block; width: 100%; min-height: 44px; padding: 8px 12px; color: #211c35; background: #fff; border: 1px solid #cfcadd; border-radius: 9px; }
.field input::placeholder { color: #716b82; }
.select-field { position: relative; }
.select-field::after { content: ""; position: absolute; width: 8px; height: 8px; top: calc(50% - 6px); right: 15px; transform: rotate(45deg); border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted); pointer-events: none; }
.field select { appearance: none; padding-right: 35px; }
.field select:invalid { color: var(--muted); }
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 39px;
  padding: 7px 12px;
  border: 1px solid transparent;
  border-radius: 9px;
  cursor: pointer;
  line-height: 1.3;
  font-size: .9rem;
  font-weight: 650;
  text-align: center;
  text-decoration: none;
  white-space: nowrap;
}
.button-primary { min-height: 45px; background: var(--accent); color: #fff; }
.button-primary:hover { background: var(--accent-dark); }
.button-quiet { color: #41347d; border-color: #ded9ed; background: #fff; }
.button-quiet:hover { background: #f4efff; }
.notice { margin: 0 0 18px; padding: 10px 14px; border-radius: 9px; font-size: .92rem; }
.notice-error { color: #982c38; background: #fff0f0; }
.notice-success { color: #105d44; background: #e3f5eb; }

.auth-page { background: radial-gradient(ellipse at 50% 22%, #ece6ff, #f5f4f9 64%); min-height: 100vh; }
.auth-page .main-content { display: grid; place-items: start center; padding-top: clamp(40px, 10vh, 110px); }
.auth-panel { width: min(100%, 442px); overflow: hidden; box-shadow: 0 18px 65px #3a2c691b; }
.auth-stripe { height: 9px; background: linear-gradient(90deg, #402c80, #7553d0 64%, #a488dc); }
.auth-content { padding: clamp(22px, 5vw, 36px); }
.auth-content h1 { margin-bottom: 9px; font-size: 2rem; letter-spacing: -.035em; }
.auth-content > p { margin-bottom: 24px; }
.auth-content .button-primary { margin-top: 3px; }

@media (max-width: 880px) {
  .wrap { width: min(100% - 40px, 1160px); }
  .workspace { grid-template-columns: minmax(0, 1fr); }
  .create-panel, .records-panel { grid-column: auto; grid-row: auto; }
  .create-panel .field-stack { grid-template-columns: repeat(2, minmax(0, 1fr)) auto; align-items: end; }
  .create-panel .field-stack .button { min-height: 44px; }
}

@media (max-width: 630px) {
  .wrap { width: min(100% - 32px, 1160px); }
  .topbar-inner { min-height: 66px; }
  .main-content { padding-top: 20px; }
  .overview { flex-direction: column; align-items: stretch; gap: 17px; }
  .metrics { min-width: 0; }
  .metrics div { padding-inline: 11px; }
  .metrics dd { font-size: 1.55rem; }
  .create-panel .field-stack { grid-template-columns: minmax(0, 1fr); }
  .identity strong { max-width: 95px; }
  .user-menu { gap: 8px; }
  .topbar .button { padding-inline: 8px; }
}
