:root {
  color-scheme: light;
  --ink: #2d3a30;
  --muted: #677468;
  --green: #23917b;
  --green-dark: #126b5b;
  --green-soft: #dff4e6;
  --mint: #eef8d7;
  --mint-deep: #d7efcb;
  --paper: rgba(255, 251, 241, 0.94);
  --paper-solid: #fffdf5;
  --paper-receipt: #fff8e7;
  --sun: #fff3bf;
  --amber: #b78635;
  --amber-soft: #dfc996;
  --danger: #94513a;
  --shadow-sm: 0 10px 18px rgba(72, 91, 66, 0.1);
  --shadow-md: 0 20px 40px rgba(72, 91, 66, 0.13);
  --shadow-lg: 0 28px 70px rgba(72, 91, 66, 0.18);
  --radius-xs: 10px;
  --radius-sm: 12px;
  --radius-md: 16px;
  --radius-lg: 22px;
  --grid: rgba(125, 112, 84, 0.12);
  --ring: rgba(35, 145, 123, 0.22);
  --lift-x: 0px;
  --lift-y: 0px;
  --mx: 72%;
  --my: 18%;
  --button-x: 50%;
  --button-y: 50%;
  font-family: "Microsoft YaHei UI", "PingFang SC", "Noto Sans SC", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background:
    radial-gradient(circle at 12% 8%, rgba(255, 250, 197, 0.92), transparent 20rem),
    radial-gradient(circle at 88% 6%, rgba(194, 235, 198, 0.78), transparent 22rem),
    linear-gradient(180deg, #f5fdea 0%, #fffaf0 100%);
  overflow-x: hidden;
}

body::before,
body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
}

body::before {
  background-image:
    linear-gradient(var(--grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid) 1px, transparent 1px),
    radial-gradient(circle at 8% 92%, rgba(248, 226, 156, 0.34), transparent 18rem),
    radial-gradient(circle at 94% 86%, rgba(169, 224, 185, 0.3), transparent 20rem);
  background-size: 38px 38px, 38px 38px, auto, auto;
  mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.72), rgba(0, 0, 0, 0.28));
  z-index: -2;
}

body::after {
  inset: auto 0 0;
  height: 170px;
  background:
    repeating-linear-gradient(100deg, rgba(176, 129, 67, 0.18) 0 16px, rgba(255, 255, 255, 0.18) 16px 23px),
    linear-gradient(180deg, transparent, rgba(176, 129, 67, 0.24));
  clip-path: polygon(0 34%, 100% 4%, 100% 100%, 0 100%);
  z-index: -1;
}

button,
input,
textarea,
select {
  font: inherit;
  color: inherit;
}

button {
  border: 0;
  cursor: pointer;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 0;
  font-size: 28px;
}

h2 {
  margin-bottom: 8px;
  font-size: clamp(28px, 3vw, 34px);
}

h3 {
  margin-bottom: 4px;
  font-size: 20px;
}

button:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible {
  outline: none;
  box-shadow: 0 0 0 4px var(--ring);
}

#appRoot {
  position: relative;
  width: min(1680px, calc(100vw - 24px));
  margin: 0 auto;
  padding: 12px 0 32px;
}

.ambient-field {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
}

.spark {
  position: absolute;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.72);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.14), 0 0 28px rgba(255, 255, 255, 0.22);
  animation: drift 14s ease-in-out infinite;
}

.spark-a {
  top: 9%;
  left: 8%;
  width: 8px;
  height: 8px;
  animation-duration: 13s;
}

.spark-b {
  top: 20%;
  right: 12%;
  width: 10px;
  height: 10px;
  background: rgba(207, 245, 218, 0.72);
  animation-duration: 17s;
}

.spark-c {
  top: 42%;
  left: 6%;
  width: 6px;
  height: 6px;
  background: rgba(255, 239, 186, 0.7);
}

.spark-d {
  top: 58%;
  right: 7%;
  width: 12px;
  height: 12px;
  background: rgba(226, 255, 227, 0.58);
  animation-duration: 16s;
}

.spark-e {
  bottom: 26%;
  left: 22%;
  width: 7px;
  height: 7px;
  animation-duration: 15s;
}

.spark-f {
  bottom: 18%;
  right: 18%;
  width: 9px;
  height: 9px;
  background: rgba(255, 247, 214, 0.68);
  animation-duration: 18s;
}

.topbar {
  position: sticky;
  top: 10px;
  z-index: 20;
  display: grid;
  grid-template-columns: minmax(280px, 1fr) auto auto;
  gap: 18px;
  align-items: center;
  margin-bottom: 8px;
  padding: 14px clamp(16px, 3vw, 28px);
  border: 1px solid rgba(187, 170, 134, 0.78);
  border-radius: var(--radius-lg);
  background: rgba(255, 252, 242, 0.82);
  box-shadow: var(--shadow-md), inset 0 0 0 1px rgba(255, 255, 255, 0.68);
  backdrop-filter: blur(18px);
}

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}

.brand-mark {
  position: relative;
  flex: 0 0 auto;
  width: 54px;
  height: 54px;
  border: 2px solid rgba(184, 137, 56, 0.45);
  border-radius: 18px 18px 20px 20px;
  background:
    radial-gradient(circle at 30% 28%, rgba(255, 255, 255, 0.75), transparent 30%),
    linear-gradient(160deg, #f1ffd8, #d5efc8);
  box-shadow: 0 6px 0 rgba(172, 188, 127, 0.5), var(--shadow-sm);
  transform: rotate(-4deg);
}

.brand-mark-leaf {
  position: absolute;
  left: 16px;
  top: 12px;
  width: 22px;
  height: 28px;
  border-radius: 85% 15% 78% 18%;
  background: linear-gradient(180deg, #66be7f, #2f9367);
  transform: rotate(-28deg);
}

.brand-mark-leaf::after {
  content: "";
  position: absolute;
  left: 10px;
  top: 3px;
  width: 2px;
  height: 20px;
  background: rgba(255, 255, 255, 0.55);
  transform: rotate(18deg);
}

.brand-copy {
  min-width: 0;
}

.brand-copy h1 {
  white-space: nowrap;
}

.brand-sub {
  margin: 5px 0 0;
  color: #7d745f;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
}

.eyebrow {
  display: block;
  margin: 0 0 4px;
  color: #bb6f31;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.08em;
}

.top-nav {
  display: flex;
  gap: 8px;
  padding: 6px;
  border: 1px solid rgba(184, 137, 56, 0.42);
  border-radius: 999px;
  background: rgba(255, 249, 235, 0.75);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.55);
}

.nav-pill,
.icon-button,
.soft-btn,
.primary-btn,
.text-btn,
.match-card,
.candidate-block,
.history-record {
  transition:
    transform 0.24s ease,
    box-shadow 0.24s ease,
    border-color 0.24s ease,
    background-color 0.24s ease,
    opacity 0.24s ease,
    filter 0.24s ease;
}

.nav-pill {
  position: relative;
  min-height: 40px;
  padding: 0 16px;
  border-radius: 999px;
  color: var(--muted);
  background: transparent;
  font-weight: 900;
}

.nav-pill::after {
  content: "";
  position: absolute;
  inset: auto 12px 6px;
  height: 2px;
  border-radius: 999px;
  background: rgba(18, 107, 91, 0.8);
  transform: scaleX(0);
  transform-origin: center;
  transition: transform 0.24s ease;
}

.nav-pill:hover,
.nav-pill.active {
  color: var(--green-dark);
  background: linear-gradient(180deg, var(--green-soft), var(--mint));
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.65);
}

.nav-pill:hover::after,
.nav-pill.active::after {
  transform: scaleX(1);
}

.toolbar,
.button-row,
.hero-actions {
  display: flex;
  gap: 10px;
  align-items: center;
}

.icon-button,
.soft-btn,
.primary-btn,
.text-btn {
  position: relative;
  overflow: hidden;
}

.icon-button::before,
.soft-btn::before,
.primary-btn::before,
.text-btn::before {
  content: "";
  position: absolute;
  inset: -30%;
  background: radial-gradient(circle at var(--button-x) var(--button-y), rgba(255, 255, 255, 0.34), transparent 28%);
  opacity: 0;
  transition: opacity 0.24s ease;
  pointer-events: none;
}

.icon-button:hover::before,
.soft-btn:hover::before,
.primary-btn:hover::before,
.text-btn:hover::before {
  opacity: 1;
}

.icon-button {
  display: grid;
  place-items: center;
  width: 46px;
  min-height: 46px;
  border: 2px solid var(--amber);
  border-radius: var(--radius-sm);
  color: #5f4422;
  background: linear-gradient(180deg, #fffaf0, #fff2c8);
  box-shadow: 0 4px 0 #c28d34;
}

.icon-button:hover,
.soft-btn:hover,
.text-btn:hover,
.primary-btn:hover,
.nav-pill:hover {
  transform: translateY(-1px);
}

.icon-button:active,
.soft-btn:active,
.primary-btn:active,
.text-btn:active {
  transform: translateY(1px) scale(0.985);
}

.btn-icon {
  position: relative;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
}

.btn-icon svg {
  width: 18px;
  height: 18px;
  stroke: currentColor;
  stroke-width: 2;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.with-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.icon-button .btn-icon {
  width: 20px;
  height: 20px;
}

.web-shell {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr);
  gap: 22px;
  align-items: start;
  padding: 16px clamp(16px, 3vw, 30px) 54px;
}

.side-panel {
  position: sticky;
  top: 108px;
  display: grid;
  gap: 16px;
}

.identity-card,
.summary-card,
.work-card,
.hero-panel {
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(184, 137, 56, 0.6);
  border-radius: var(--radius-md);
  background: var(--paper);
  box-shadow: var(--shadow-md);
}

.identity-card::before,
.summary-card::before,
.work-card::before,
.hero-panel::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at var(--mx) var(--my), rgba(255, 255, 255, 0.46), transparent 24%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.16), transparent 32%);
  pointer-events: none;
  opacity: 0.85;
}

.identity-card,
.summary-card,
.work-card {
  padding: 20px;
}

.motion-card {
  transform: translateY(24px);
  opacity: 0;
  filter: saturate(0.94);
  transition:
    transform 0.6s cubic-bezier(0.22, 1, 0.36, 1),
    opacity 0.45s ease,
    filter 0.45s ease,
    box-shadow 0.28s ease;
}

.motion-card.is-visible {
  transform: translateY(0);
  opacity: 1;
  filter: saturate(1);
}

.identity-card:hover,
.summary-card:hover,
.work-card:hover,
.hero-panel:hover {
  transform: translate3d(var(--lift-x), var(--lift-y), 0);
  box-shadow: var(--shadow-lg);
}

.identity-card {
  border-color: rgba(124, 182, 108, 0.85);
  background:
    radial-gradient(circle at 12% 18%, rgba(255, 246, 170, 0.95), transparent 170px),
    linear-gradient(145deg, #e8f8d4, #fff6cd);
}

.identity-card::after {
  content: "";
  position: absolute;
  right: 10px;
  bottom: 10px;
  width: 84px;
  height: 84px;
  border-radius: 50%;
  border: 1px dashed rgba(78, 130, 82, 0.24);
  opacity: 0.5;
}

.panel-orb {
  position: absolute;
  right: -24px;
  bottom: -24px;
  width: 120px;
  height: 120px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, rgba(255, 255, 255, 0.36), rgba(255, 255, 255, 0.02) 62%);
  pointer-events: none;
}

.summary-card {
  background:
    linear-gradient(180deg, rgba(255, 253, 241, 0.96), rgba(248, 255, 232, 0.94)),
    repeating-linear-gradient(0deg, transparent 0 32px, rgba(43, 76, 50, 0.05) 32px 34px);
}

.summary-ribbon {
  position: absolute;
  top: 14px;
  right: -30px;
  min-width: 110px;
  padding: 6px 16px;
  text-align: center;
  color: #fffef5;
  background: linear-gradient(180deg, rgba(38, 145, 123, 0.95), rgba(18, 107, 91, 0.95));
  box-shadow: var(--shadow-sm);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.12em;
  transform: rotate(22deg);
}

.auth-leaf {
  position: absolute;
  right: 20px;
  top: 16px;
  width: 42px;
  height: 30px;
  border-radius: 70% 12% 70% 12%;
  background: #5bbf77;
  transform: rotate(-24deg);
  opacity: 0.82;
}

.register-card,
.passport-card {
  display: grid;
  gap: 12px;
}

.passport-card {
  grid-template-columns: 58px 1fr;
  align-items: center;
}

.passport-card .text-btn {
  grid-column: 1 / -1;
}

.avatar-picker,
.passport-avatar {
  display: grid;
  place-items: center;
  width: 58px;
  height: 58px;
  border: 3px solid var(--sun);
  border-radius: 50%;
  color: #315d36;
  background: #96d28b;
  box-shadow: 0 4px 0 #7dab62;
  font-weight: 900;
}

.passport-info {
  display: grid;
  gap: 4px;
  color: #527144;
  font-size: 13px;
  font-weight: 800;
}

.passport-info strong {
  color: var(--ink);
  font-size: 18px;
}

.summary-list {
  display: grid;
  gap: 10px;
  margin: 0;
}

.summary-list div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border: 1px dashed var(--amber-soft);
  border-radius: var(--radius-sm);
  background: rgba(255, 253, 245, 0.84);
  transition: transform 0.24s ease, border-color 0.24s ease, background-color 0.24s ease;
}

.summary-list div:hover {
  transform: translateX(3px);
  border-color: rgba(183, 134, 53, 0.68);
}

.summary-list dt {
  color: var(--muted);
  font-weight: 800;
}

.summary-list dd {
  margin: 0;
  font-weight: 900;
  text-align: right;
}

.main-stack {
  display: grid;
  gap: 18px;
  min-width: 0;
}

.hero-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 24px;
  align-items: center;
  padding: 24px;
  background:
    linear-gradient(90deg, rgba(246, 255, 232, 0.98), rgba(255, 250, 240, 0.98)),
    repeating-linear-gradient(0deg, transparent 0 36px, rgba(43, 76, 50, 0.05) 36px 38px);
}

.hero-copy {
  max-width: 760px;
}

.hero-panel h2 {
  letter-spacing: 0;
}

.hero-panel p:last-child {
  color: var(--muted);
  line-height: 1.6;
}

.hero-notes {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 14px;
}

.hero-note {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 0 12px;
  border: 1px solid rgba(184, 137, 56, 0.38);
  border-radius: 999px;
  color: #5a513e;
  background: rgba(255, 253, 241, 0.78);
  font-size: 12px;
  font-weight: 900;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.55);
}

.hero-actions {
  justify-self: end;
  flex-wrap: wrap;
  justify-content: flex-end;
  max-width: 360px;
}

.hero-stamp {
  width: 100%;
  padding: 10px 12px;
  border: 1px dashed rgba(183, 134, 53, 0.5);
  border-radius: var(--radius-sm);
  color: #6b5f4b;
  background: rgba(255, 253, 241, 0.72);
  text-align: right;
  transform: rotate(-1deg);
}

.hero-stamp span,
.hero-stamp strong {
  display: block;
}

.hero-stamp span {
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.12em;
}

.hero-stamp strong {
  margin-top: 4px;
  font-size: 15px;
}

.data-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.lower-grid {
  display: grid;
  grid-template-columns: minmax(340px, 0.84fr) minmax(0, 1.16fr);
  gap: 18px;
}

.receipt-card {
  background:
    linear-gradient(90deg, rgba(248, 255, 234, 0.96), rgba(255, 250, 240, 0.98)),
    repeating-linear-gradient(0deg, transparent 0 34px, rgba(43, 76, 50, 0.055) 34px 36px);
}

.receipt-card::after,
.audit-card::after {
  content: "";
  position: absolute;
  left: 10px;
  right: 10px;
  top: -10px;
  height: 20px;
  background:
    radial-gradient(circle at 12px 10px, transparent 0 6px, var(--paper-receipt) 6.4px),
    radial-gradient(circle at 36px 10px, transparent 0 6px, var(--paper-receipt) 6.4px),
    radial-gradient(circle at 60px 10px, transparent 0 6px, var(--paper-receipt) 6.4px),
    radial-gradient(circle at 84px 10px, transparent 0 6px, var(--paper-receipt) 6.4px);
  background-size: 96px 20px;
  opacity: 0.56;
  pointer-events: none;
}

.section-title {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  margin-bottom: 16px;
}

.section-title p {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.badge {
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
  min-width: 38px;
  height: 30px;
  padding: 0 8px;
  border-radius: var(--radius-xs);
  color: var(--green-dark);
  background: linear-gradient(180deg, var(--green-soft), var(--mint));
  font-size: 13px;
  font-weight: 900;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.52);
}

.soft-btn,
.primary-btn,
.text-btn {
  min-height: 44px;
  border-radius: var(--radius-sm);
  font-weight: 900;
}

.soft-btn {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--amber);
  color: #5b401c;
  background: linear-gradient(180deg, #fff8dc, #ffefbb);
  box-shadow: 0 4px 0 #c28d34;
}

.primary-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  margin-top: 14px;
  border: 2px solid var(--amber);
  color: #fff;
  background: linear-gradient(180deg, #22a58b, #0f7463);
  box-shadow: 0 4px 0 #c28d34;
}

.primary-btn.compact {
  width: auto;
  min-width: 164px;
  margin-top: 0;
  padding: 0 18px;
}

.text-btn {
  min-width: 104px;
  padding: 0 14px;
  border: 2px solid #8fbf72;
  color: #315d36;
  background: linear-gradient(180deg, #f6ffe6, #ebffd0);
}

.file-btn {
  position: relative;
  overflow: hidden;
}

.file-btn input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.field-grid,
.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

label {
  display: grid;
  gap: 7px;
  margin-bottom: 12px;
  font-size: 13px;
  font-weight: 900;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid rgba(191, 163, 104, 0.9);
  border-radius: var(--radius-sm);
  background: rgba(255, 253, 245, 0.96);
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

input:hover,
select:hover,
textarea:hover {
  border-color: rgba(183, 134, 53, 0.9);
}

input,
select {
  min-height: 42px;
  padding: 8px 10px;
}

textarea {
  min-height: 260px;
  padding: 12px;
  resize: vertical;
  font-family: "Cascadia Mono", "Consolas", monospace;
  font-size: 13px;
  line-height: 1.6;
  background:
    linear-gradient(rgba(255, 255, 255, 0.74), rgba(255, 255, 255, 0.74)),
    repeating-linear-gradient(0deg, transparent 0 32px, rgba(24, 138, 117, 0.14) 32px 34px);
}

.card-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-top: 14px;
  color: #5d684f;
  font-family: "Cascadia Mono", monospace;
  font-size: 12px;
}

.barcode {
  flex: 0 0 auto;
  width: 130px;
  height: 34px;
  background: repeating-linear-gradient(90deg, #1f2520 0 3px, transparent 3px 6px, #1f2520 6px 8px, transparent 8px 14px);
}

.barcode.wide {
  width: 170px;
}

.switch-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 14px;
  border: 1px dashed var(--amber-soft);
  border-radius: var(--radius-sm);
  background: rgba(255, 253, 245, 0.82);
  transition: transform 0.2s ease, border-color 0.2s ease;
}

.switch-row:hover {
  transform: translateX(2px);
  border-color: rgba(183, 134, 53, 0.64);
}

.switch-row + .switch-row {
  margin-top: 12px;
}

.switch-row span {
  display: grid;
  gap: 4px;
}

.switch-row small {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

.switch-row input {
  width: 22px;
  min-height: 22px;
}

.stat-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin: 14px 0;
}

.stat-tile {
  position: relative;
  overflow: hidden;
  padding: 14px;
  border: 1px solid rgba(184, 137, 56, 0.35);
  border-radius: var(--radius-sm);
  background: linear-gradient(180deg, #fff9dc, #fff2c8);
  transition: transform 0.24s ease, box-shadow 0.24s ease;
}

.stat-tile::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at top right, rgba(255, 255, 255, 0.35), transparent 42%);
  pointer-events: none;
}

.stat-tile:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
}

.stat-tile.pulse {
  animation: pulse-tile 0.7s ease;
}

.stat-row strong {
  display: block;
  font-size: 30px;
  line-height: 1;
}

.stat-row span {
  color: var(--muted);
  font-size: 12px;
}

.empty,
.history-box,
.match-card {
  margin-top: 12px;
  padding: 14px;
  border: 1px solid var(--amber-soft);
  border-radius: var(--radius-sm);
  background:
    linear-gradient(rgba(255, 253, 245, 0.96), rgba(255, 253, 245, 0.96)),
    repeating-linear-gradient(0deg, transparent 0 32px, rgba(184, 137, 56, 0.1) 32px 34px);
}

.empty {
  color: var(--muted);
  text-align: center;
  line-height: 1.6;
}

.result-list {
  display: grid;
  gap: 12px;
}

.match-body {
  display: grid;
  gap: 12px;
  padding: 0 12px 12px;
}

.match-card {
  position: relative;
  padding: 0;
  overflow: hidden;
  border-style: dashed;
}

.match-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(115deg, transparent 0 28%, rgba(255, 255, 255, 0.32) 50%, transparent 72%);
  transform: translateX(-120%);
  opacity: 0;
  pointer-events: none;
}

.match-card:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}

.match-card:hover::before {
  opacity: 1;
  animation: sweep 1s ease;
}

.match-card.unmatched {
  background:
    linear-gradient(rgba(255, 244, 233, 0.95), rgba(255, 244, 233, 0.95)),
    repeating-linear-gradient(0deg, transparent 0 32px, rgba(184, 137, 56, 0.08) 32px 34px);
}

.match-card summary {
  display: grid;
  grid-template-columns: auto 1fr auto auto;
  gap: 10px;
  align-items: center;
  min-height: 58px;
  padding: 12px;
  cursor: pointer;
  list-style: none;
}

.match-card summary::-webkit-details-marker {
  display: none;
}

.match-card summary input[type="radio"] {
  width: 18px;
  min-height: 18px;
}

.match-card[open] .match-body {
  animation: rise-in 0.28s ease;
}

.status {
  display: inline-block;
  padding: 5px 10px;
  border-radius: 999px;
  color: var(--green-dark);
  background: linear-gradient(180deg, var(--green-soft), var(--mint));
  font-size: 12px;
  font-weight: 900;
}

.unmatched .status {
  color: var(--danger);
  background: #ffe2ce;
}

.amount {
  color: #4b3214;
  font-weight: 900;
}

.empty-inline {
  padding: 12px;
  border: 1px dashed var(--amber-soft);
  border-radius: var(--radius-sm);
  color: var(--muted);
  background: rgba(255, 253, 245, 0.88);
}

.candidate-list {
  display: grid;
  gap: 10px;
}

.candidate-label {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.02em;
}

.candidate-block {
  position: relative;
  overflow: hidden;
  border: 1px solid #e7d9b3;
  border-radius: var(--radius-sm);
  background: rgba(255, 253, 245, 0.94);
}

.candidate-block::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at var(--mx) var(--my), rgba(255, 255, 255, 0.34), transparent 26%);
  opacity: 0;
  transition: opacity 0.24s ease;
  pointer-events: none;
}

.candidate-block:hover {
  border-color: rgba(184, 137, 56, 0.55);
  box-shadow: var(--shadow-sm);
}

.candidate-block:hover::after {
  opacity: 1;
}

.candidate-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border-bottom: 1px dashed #e7d9b3;
  background: linear-gradient(180deg, rgba(241, 255, 216, 0.9), rgba(255, 253, 241, 0.82));
  font-size: 12px;
  font-weight: 900;
}

.detail-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.detail-table th,
.detail-table td {
  padding: 8px 10px;
  border-top: 1px solid #eee0bc;
  text-align: left;
}

.detail-table th:last-child,
.detail-table td:last-child {
  text-align: right;
}

.history-record {
  display: grid;
  gap: 6px;
  padding: 12px 0;
  border-bottom: 1px dashed var(--amber-soft);
}

.history-record:last-child {
  border-bottom: 0;
}

.history-record:hover {
  transform: translateX(2px);
}

.history-record span {
  color: var(--muted);
  font-size: 13px;
}

.preview-mask {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 18px 12px;
  background: rgba(23, 31, 25, 0.42);
  backdrop-filter: blur(8px);
}

.preview-mask[hidden] {
  display: none;
}

.preview-sheet {
  width: min(860px, 100%);
  max-height: 88vh;
  overflow: auto;
  border-radius: var(--radius-md);
}

.preview-card {
  margin-bottom: 0;
}

.preview-note {
  padding: 12px;
  border: 1px dashed var(--amber-soft);
  border-radius: var(--radius-sm);
  color: var(--muted);
  background: rgba(255, 253, 245, 0.82);
}

.close-preview {
  margin-top: 16px;
}

.toast-rack {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 50;
  display: grid;
  gap: 10px;
  width: min(360px, calc(100vw - 32px));
  pointer-events: none;
}

.toast {
  display: grid;
  gap: 4px;
  padding: 12px 14px;
  border: 1px solid rgba(184, 137, 56, 0.4);
  border-radius: 14px;
  background: rgba(255, 251, 241, 0.94);
  box-shadow: var(--shadow-md);
  opacity: 0;
  transform: translateY(10px) scale(0.98);
  animation: toast-in 0.28s ease forwards;
}

.toast.removing {
  animation: toast-out 0.24s ease forwards;
}

.toast strong {
  font-size: 13px;
}

.toast span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.toast[data-tone="success"] {
  border-color: rgba(35, 145, 123, 0.42);
}

.toast[data-tone="warn"] {
  border-color: rgba(183, 134, 53, 0.46);
}

@keyframes drift {
  0%,
  100% {
    transform: translate3d(0, 0, 0) scale(1);
  }
  50% {
    transform: translate3d(8px, -14px, 0) scale(1.08);
  }
}

@keyframes pulse-tile {
  0% {
    transform: scale(1);
    box-shadow: none;
  }
  50% {
    transform: scale(1.03);
    box-shadow: 0 0 0 8px rgba(35, 145, 123, 0.08);
  }
  100% {
    transform: scale(1);
    box-shadow: none;
  }
}

@keyframes rise-in {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes sweep {
  from {
    transform: translateX(-120%);
  }
  to {
    transform: translateX(120%);
  }
}

@keyframes toast-in {
  from {
    opacity: 0;
    transform: translateY(12px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes toast-out {
  from {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
  to {
    opacity: 0;
    transform: translateY(8px) scale(0.98);
  }
}

@media (max-width: 1260px) {
  .topbar {
    grid-template-columns: minmax(240px, 1fr) auto;
  }

  .toolbar {
    justify-self: end;
  }

  .top-nav {
    grid-column: 1 / -1;
    justify-content: flex-start;
    overflow-x: auto;
  }

  .side-panel {
    top: 96px;
  }
}

@media (max-width: 1180px) {
  .web-shell {
    grid-template-columns: 1fr;
  }

  .side-panel {
    position: static;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 900px) {
  #appRoot {
    width: min(100vw, calc(100vw - 8px));
    padding-top: 8px;
  }

  .topbar {
    position: static;
    grid-template-columns: 1fr;
    margin: 0 12px 8px;
  }

  .brand-copy h1 {
    white-space: normal;
  }

  .web-shell {
    padding: 14px 12px 32px;
  }

  .hero-panel,
  .data-grid,
  .lower-grid,
  .side-panel {
    grid-template-columns: 1fr;
  }

  .hero-actions,
  .button-row {
    flex-wrap: wrap;
  }

  .hero-actions {
    justify-self: stretch;
    max-width: none;
    justify-content: flex-start;
  }
}

@media (max-width: 640px) {
  .field-grid,
  .form-grid,
  .stat-row {
    grid-template-columns: 1fr;
  }

  .match-card summary {
    grid-template-columns: auto 1fr;
  }

  .match-card summary .status,
  .match-card summary .amount {
    grid-column: 2;
    justify-self: start;
  }

  .hero-note {
    width: 100%;
    justify-content: center;
  }

  .toast-rack {
    right: 12px;
    bottom: 12px;
    width: calc(100vw - 24px);
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }

  .motion-card,
  .motion-card.is-visible,
  .identity-card:hover,
  .summary-card:hover,
  .work-card:hover,
  .hero-panel:hover {
    transform: none !important;
    opacity: 1 !important;
    filter: none !important;
  }
}
