:root {
  --bg: #eef2eb;
  --bg-strong: #e2eadf;
  --surface: rgba(255, 255, 255, 0.92);
  --surface-solid: #ffffff;
  --surface-muted: #f4f7f2;
  --text: #27312c;
  --text-soft: #66716c;
  --line: #d9e1d7;
  --line-strong: #c8d3c5;
  --accent: #6e917a;
  --accent-strong: #4f6b5a;
  --danger: #bc6b65;
  --danger-strong: #9f4b46;
  --shadow: 0 24px 60px rgba(34, 51, 44, 0.08);
  --radius-lg: 28px;
  --radius-md: 18px;
  --radius-sm: 14px;
}

* {
  box-sizing: border-box;
}

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

body {
  color: var(--text);
  background: var(--bg);
  font: 15px/1.6 "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
}

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

a:hover {
  text-decoration: underline;
}

button,
input,
textarea {
  font: inherit;
}

.page-body {
  position: relative;
  overflow-x: hidden;
}

.page-backdrop {
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(circle at top left, rgba(151, 177, 159, 0.26), transparent 28%),
    radial-gradient(circle at right 18% top 16%, rgba(230, 239, 227, 0.9), transparent 24%),
    linear-gradient(180deg, #f4f7f2 0%, #edf2ea 48%, #e8eee6 100%);
}

.page-backdrop::before,
.page-backdrop::after {
  content: "";
  position: absolute;
  border-radius: 999px;
  filter: blur(18px);
}

.page-backdrop::before {
  width: 320px;
  height: 320px;
  top: -70px;
  right: -60px;
  background: rgba(182, 205, 187, 0.34);
}

.page-backdrop::after {
  width: 220px;
  height: 220px;
  left: -40px;
  bottom: 10%;
  background: rgba(240, 245, 238, 0.9);
}

.page-shell {
  max-width: 1200px;
  margin: 0 auto;
  padding: 38px 20px 52px;
}

.page-shell--narrow {
  max-width: 760px;
}

.center-stage {
  display: flex;
  justify-content: center;
}

.surface-card {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow);
  backdrop-filter: blur(14px);
}

.topbar {
  margin-bottom: 20px;
}

.topbar__content {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 24px;
}

.topbar__intro h1,
.section-heading h2,
.auth-card h1,
.form-card h1,
.error-card h1 {
  margin: 0;
  font-size: clamp(28px, 4vw, 38px);
  line-height: 1.15;
  letter-spacing: -0.03em;
}

.section-heading h2 {
  font-size: clamp(22px, 3vw, 28px);
}

.topbar__intro {
  max-width: 720px;
}

.topbar__side {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.layout-grid {
  display: grid;
  gap: 20px;
}

.hero-card,
.results-card,
.auth-card,
.form-card,
.error-card {
  padding: 28px;
}

.hero-card {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(245, 248, 243, 0.9));
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--accent-strong);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.eyebrow--muted {
  color: var(--text-soft);
}

.subtle-copy,
.muted-copy,
.helper-copy,
.notice__message,
.empty-state p {
  margin: 0;
  color: var(--text-soft);
}

.helper-copy {
  margin-top: 18px;
}

.section-heading {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 18px;
  margin-bottom: 20px;
}

.section-heading--stacked {
  align-items: flex-start;
}

.search-form {
  display: grid;
  gap: 14px;
}

.search-form__row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
}

.search-form__actions,
.form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.search-meta {
  display: grid;
  gap: 8px;
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px solid rgba(201, 212, 198, 0.7);
}

.stats-copy {
  margin: 0;
  font-size: 15px;
  font-weight: 700;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 0 15px;
  border: 1px solid transparent;
  border-radius: 999px;
  cursor: pointer;
  font-size: 14px;
  line-height: 1;
  white-space: nowrap;
  transition:
    transform 0.18s ease,
    box-shadow 0.18s ease,
    border-color 0.18s ease,
    background-color 0.18s ease,
    color 0.18s ease;
}

.button:hover {
  transform: translateY(-1px);
  text-decoration: none;
}

.button:disabled {
  cursor: not-allowed;
  opacity: 0.6;
  transform: none;
  box-shadow: none;
}

.button--primary {
  color: #ffffff;
  background: var(--accent);
  box-shadow: 0 14px 28px rgba(110, 145, 122, 0.22);
}

.button--primary:hover {
  background: var(--accent-strong);
}

.button--secondary {
  color: var(--text);
  background: var(--surface-muted);
  border-color: var(--line-strong);
}

.button--ghost {
  color: var(--text-soft);
  background: transparent;
  border-color: var(--line);
}

.button--ghost.is-active {
  color: var(--accent-strong);
  background: rgba(110, 145, 122, 0.12);
  border-color: rgba(110, 145, 122, 0.26);
}

.button--danger {
  color: var(--danger-strong);
  background: rgba(188, 107, 101, 0.1);
  border-color: rgba(188, 107, 101, 0.16);
}

.button--danger.is-confirming {
  color: #ffffff;
  background: var(--danger-strong);
  border-color: var(--danger-strong);
}

.field-control {
  width: 100%;
  min-height: 42px;
  padding: 10px 14px;
  border: 1px solid var(--line-strong);
  border-radius: 18px;
  color: var(--text);
  background: rgba(252, 253, 251, 0.88);
  transition:
    border-color 0.18s ease,
    box-shadow 0.18s ease,
    background-color 0.18s ease;
}

.field-control:focus {
  outline: none;
  border-color: var(--accent);
  background: #ffffff;
  box-shadow: 0 0 0 4px rgba(110, 145, 122, 0.14);
}

.field-control--search {
  min-height: 50px;
  padding-inline: 16px;
  font-size: 15px;
}

.field-control--textarea {
  min-height: 104px;
  resize: vertical;
}

.simple-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 18px;
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--text-soft);
}

.back-link::before {
  content: "←";
}

.status-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  padding: 0 12px;
  border: 1px solid rgba(110, 145, 122, 0.22);
  border-radius: 999px;
  color: var(--accent-strong);
  background: rgba(110, 145, 122, 0.12);
  font-size: 12px;
  font-weight: 700;
}

.status-pill--danger {
  color: var(--danger-strong);
  border-color: rgba(188, 107, 101, 0.22);
  background: rgba(188, 107, 101, 0.12);
}

.notice {
  display: grid;
  gap: 4px;
  margin-top: 20px;
  padding: 14px 16px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-md);
  background: rgba(244, 247, 242, 0.82);
}

.notice__title {
  margin: 0;
  font-weight: 700;
}

.notice--error {
  color: var(--danger-strong);
  border-color: rgba(188, 107, 101, 0.22);
  background: rgba(188, 107, 101, 0.1);
}

.notice--info {
  color: var(--accent-strong);
  border-color: rgba(110, 145, 122, 0.22);
  background: rgba(110, 145, 122, 0.08);
}

.form-row {
  display: grid;
  gap: 8px;
}

.form-row label {
  font-weight: 700;
}

.stack-form {
  display: grid;
  gap: 18px;
  margin-top: 24px;
}

.auth-card__header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
}

.auth-card,
.form-card,
.error-card {
  max-width: 640px;
}

.error-card {
  display: grid;
  gap: 16px;
}

.result-grid-header {
  display: grid;
  grid-template-columns: minmax(82px, 0.72fr) minmax(152px, 1.34fr) minmax(108px, 0.94fr) minmax(208px, 1.5fr) minmax(158px, 1.08fr) minmax(172px, 0.88fr);
  gap: 16px;
  padding: 0 16px 12px;
  color: var(--text-soft);
  font-size: 13px;
  font-weight: 700;
}

.results-list {
  display: grid;
  gap: 14px;
}

.result-card {
  display: grid;
  grid-template-columns: minmax(82px, 0.72fr) minmax(152px, 1.34fr) minmax(108px, 0.94fr) minmax(208px, 1.5fr) minmax(158px, 1.08fr) minmax(172px, 0.88fr);
  gap: 14px;
  align-items: center;
  height: auto;
  padding: 13px 14px;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: var(--surface-solid);
  box-shadow: 0 18px 34px rgba(38, 54, 46, 0.06);
  transition:
    transform 0.18s ease,
    box-shadow 0.18s ease,
    border-color 0.18s ease,
    background-color 0.18s ease;
}

.result-card:hover {
  transform: translateY(-1px);
  box-shadow: 0 24px 42px rgba(38, 54, 46, 0.1);
}

.result-card.is-editing {
  align-items: flex-start;
  border-color: rgba(110, 145, 122, 0.42);
  background: linear-gradient(180deg, rgba(249, 252, 248, 1), rgba(243, 247, 241, 1));
}

.result-card.is-busy {
  opacity: 0.76;
  pointer-events: none;
}

.result-card__field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

.result-card__field--actions {
  align-items: flex-start;
}

.result-card__label {
  display: none;
  color: var(--text-soft);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.result-card__view {
  display: flex;
  align-items: center;
  gap: 6px;
  min-height: 36px;
}

.result-card__view-group {
  display: flex;
  align-items: center;
  gap: 6px;
  width: 100%;
}

.result-card__view-group .result-card__value {
  flex: 1 1 auto;
}

.result-card__view-group .copy-button {
  margin-left: auto;
}

.result-card__editor {
  display: none;
}

.result-card.is-editing .result-card__view {
  display: none;
}

.result-card.is-editing .result-card__editor {
  display: grid;
  gap: 6px;
}

.result-card__editor .copy-button {
  justify-self: end;
}

.result-card__value,
.result-card__timestamp {
  margin: 0;
  min-width: 0;
  white-space: pre-wrap;
  word-break: break-word;
}

.result-card__value--primary {
  font-weight: 700;
}

.result-card__value--remarks {
  color: var(--text-soft);
  overflow: visible;
}

.result-card__timestamp {
  color: var(--text-soft);
  white-space: nowrap;
}

.result-card__actions {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
  width: 100%;
}

.result-card__actions .button {
  min-width: 48px;
  min-height: 32px;
  padding: 0 8px;
  flex: 0 0 auto;
  font-size: 12px;
}

.copy-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 999px;
  cursor: pointer;
  color: var(--text-soft);
  background: rgba(246, 248, 244, 0.9);
  flex: 0 0 auto;
}

.copy-button:hover {
  border-color: var(--line-strong);
}

.copy-button__icon {
  width: 13px;
  height: 13px;
  opacity: 0.62;
  display: block;
}

.empty-state {
  display: grid;
  place-items: center;
  gap: 10px;
  padding: 46px 18px;
  text-align: center;
  border: 1px dashed var(--line-strong);
  border-radius: 24px;
  background: rgba(244, 247, 242, 0.78);
}

.empty-state[hidden] {
  display: none;
}

.empty-state h3 {
  margin: 0;
  font-size: 22px;
}

.empty-state__dot {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background:
    radial-gradient(circle at 35% 35%, rgba(255, 255, 255, 0.95), rgba(110, 145, 122, 0.18)),
    rgba(110, 145, 122, 0.16);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.7),
    0 14px 28px rgba(110, 145, 122, 0.16);
}

.toast-stack {
  position: fixed;
  top: 22px;
  right: 22px;
  z-index: 20;
  display: grid;
  gap: 10px;
}

.toast {
  min-width: 260px;
  max-width: 360px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 18px 40px rgba(39, 49, 44, 0.14);
  animation: toast-in 0.2s ease;
}

.toast__title {
  margin: 0 0 4px;
  font-weight: 700;
}

.toast__message {
  margin: 0;
  color: var(--text-soft);
}

.toast--success {
  border-color: rgba(110, 145, 122, 0.24);
}

.toast--error {
  border-color: rgba(188, 107, 101, 0.24);
}

.toast--error .toast__title {
  color: var(--danger-strong);
}

.toast--info .toast__title {
  color: var(--accent-strong);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@keyframes toast-in {
  from {
    opacity: 0;
    transform: translateY(-4px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 920px) {
  .page-shell {
    padding: 24px 16px 42px;
  }

  .topbar__content,
  .auth-card__header,
  .simple-header,
  .section-heading,
  .section-heading--stacked {
    flex-direction: column;
    align-items: flex-start;
  }

  .topbar__side,
  .search-form__actions,
  .form-actions {
    width: 100%;
  }

  .topbar__side .button,
  .search-form__actions .button,
  .form-actions .button {
    width: 100%;
  }

  .search-form__row {
    grid-template-columns: 1fr;
  }

  .result-grid-header {
    display: none;
  }

  .result-card {
    grid-template-columns: 1fr;
    padding: 15px 14px;
  }

  .result-card__label {
    display: block;
  }

  .result-card__actions {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .result-card__actions .button {
    min-height: 32px;
    padding: 0 8px;
    font-size: 12px;
  }

  .copy-button {
    width: 28px;
    height: 28px;
  }

  .toast-stack {
    top: 16px;
    right: 16px;
    bottom: auto;
    left: 16px;
  }

  .toast {
    min-width: 0;
    max-width: none;
  }
}
