@font-face {
  font-family: "Huakang";
  src: url("/assets/huakang-w7p.ttf") format("truetype");
  font-display: swap;
  font-style: normal;
  font-weight: 400;
}

:root {
  --bg: #0a0d0c;
  --surface: #111614;
  --surface-raised: #151b18;
  --line: #26302b;
  --line-strong: #344139;
  --text: #e6ede8;
  --text-strong: #f5faf6;
  --muted: #8b9991;
  --muted-strong: #a9b5ae;
  --accent: #a7cdb5;
  --accent-strong: #c9ead5;
  --accent-ink: #0d1711;
  --error: #e3aaa0;
  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
  --shadow-soft: 0 16px 32px rgba(0, 0, 0, 0.2);
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  min-width: 320px;
  scroll-behavior: smooth;
  background: var(--bg);
}

body {
  min-width: 320px;
  min-height: 100svh;
  margin: 0;
  color: var(--text);
  background: var(--bg);
  font-family: "Huakang", "DFPYuanW7-GB", "Microsoft YaHei", system-ui, sans-serif;
  font-size: 15px;
  letter-spacing: 0;
  overflow-x: hidden;
}

button,
input {
  font: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

button:focus-visible,
a:focus-visible,
input:focus-visible {
  outline: 2px solid var(--accent-strong);
  outline-offset: 3px;
}

button {
  border: 0;
}

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

.site-shell {
  width: min(1080px, 100%);
  min-height: 100svh;
  margin: 0 auto;
  padding: 0 28px;
}

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 72px;
  border-bottom: 1px solid var(--line);
}

.wordmark {
  color: var(--text-strong);
  font-size: 16px;
  font-weight: 400;
  text-decoration: none;
}

.header-note,
.eyebrow,
.section-label,
.field-label,
.query-help,
.site-footer,
.record-number,
.record-meta {
  color: var(--muted);
  font-size: 11px;
  letter-spacing: 0.08em;
}

.header-note {
  letter-spacing: 0;
}

.search-section {
  max-width: 760px;
  padding: 84px 0 76px;
}

.eyebrow,
.section-label {
  margin: 0 0 16px;
  color: var(--accent);
  font-weight: 400;
  text-transform: uppercase;
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  max-width: 650px;
  color: var(--text-strong);
  font-size: clamp(40px, 6vw, 66px);
  font-weight: 400;
  letter-spacing: -0.035em;
  line-height: 1.08;
}

.lede {
  max-width: 500px;
  margin-top: 20px;
  color: var(--muted-strong);
  font-size: 16px;
  line-height: 1.8;
}

.query-form {
  max-width: 720px;
  margin-top: 42px;
}

.field-label {
  display: block;
  margin-bottom: 10px;
}

.query-control {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 62px;
  padding: 7px 8px 7px 18px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow-soft);
  transition: border-color 180ms ease, background-color 180ms ease, box-shadow 180ms ease;
}

.query-control:focus-within {
  border-color: var(--accent);
  background: var(--surface-raised);
  box-shadow: 0 0 0 3px rgba(167, 205, 181, 0.08), var(--shadow-soft);
}

.query-control.is-invalid {
  border-color: var(--error);
  box-shadow: 0 0 0 3px rgba(227, 170, 160, 0.08), var(--shadow-soft);
}

.query-control input {
  min-width: 0;
  flex: 1;
  height: 45px;
  padding: 0;
  color: var(--text-strong);
  border: 0;
  outline: 0;
  background: transparent;
  font-size: 16px;
}

.query-control input::placeholder {
  color: #637169;
}

.query-control button,
.retry-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  min-height: 46px;
  padding: 0 17px;
  color: var(--accent-ink);
  border-radius: 6px;
  background: var(--accent-strong);
  cursor: pointer;
  font-size: 14px;
  font-weight: 400;
  transition: transform 150ms var(--ease-out), background-color 150ms ease, opacity 150ms ease;
}

.query-control button:hover,
.retry-button:hover {
  background: #d7f2df;
}

.query-control button:active,
.retry-button:active {
  transform: scale(0.98);
}

.query-control button:disabled {
  cursor: wait;
  opacity: 0.62;
}

.button-arrow {
  font-family: inherit;
  font-size: 18px;
  line-height: 1;
}

.query-help {
  margin-top: 11px;
  color: var(--muted);
  font-size: 11px;
  letter-spacing: 0;
}

.query-feedback {
  min-height: 20px;
  margin-top: 6px;
  color: var(--error);
  font-size: 12px;
}

.results-section {
  padding: 32px 0 72px;
  border-top: 1px solid var(--line);
}

.results-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 18px;
}

.section-label {
  margin-bottom: 9px;
  font-size: 10px;
}

h2 {
  color: var(--text-strong);
  font-size: 23px;
  font-weight: 400;
  letter-spacing: -0.02em;
}

.results-count {
  color: var(--muted);
  font-size: 12px;
}

.results-content {
  min-height: 148px;
  margin-top: 28px;
}

.state-message {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  min-height: 148px;
  padding: 26px;
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(17, 22, 20, 0.52);
  animation: fade-in 220ms var(--ease-out) both;
}

.state-message-error {
  color: var(--error);
  border-color: rgba(227, 170, 160, 0.28);
}

.state-message-text {
  line-height: 1.7;
}

.retry-button {
  min-height: 38px;
  margin-top: 18px;
  padding: 0 14px;
  color: var(--accent-ink);
  font-size: 12px;
}

.results-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  animation: fade-in 220ms var(--ease-out) both;
}

.result-card {
  min-width: 0;
  padding: 20px 20px 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 12px 26px rgba(0, 0, 0, 0.15);
}

.result-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 13px;
  border-bottom: 1px solid var(--line);
}

.record-number {
  color: var(--accent);
  font-size: 10px;
}

.record-meta {
  color: var(--muted);
  font-size: 10px;
  letter-spacing: 0;
}

.field-list {
  margin: 0;
}

.field-row {
  display: grid;
  grid-template-columns: minmax(100px, 0.44fr) minmax(0, 1fr);
  gap: 16px;
  padding: 13px 0;
  border-bottom: 1px solid rgba(38, 48, 43, 0.72);
}

.field-row:last-child {
  border-bottom: 0;
}

.field-label,
.field-value {
  margin: 0;
  overflow-wrap: anywhere;
  line-height: 1.6;
}

.field-label {
  color: var(--muted);
  font-size: 12px;
  letter-spacing: 0;
}

.field-value {
  color: var(--muted-strong);
  font-size: 13px;
}

.field-row.is-emphasis {
  border-bottom-color: rgba(167, 205, 181, 0.23);
}

.field-row.is-emphasis .field-label,
.field-row.is-emphasis .field-value {
  color: var(--text-strong);
  font-weight: 700;
}

.field-row.is-emphasis .field-label {
  color: var(--accent-strong);
}

.skeleton-grid {
  opacity: 0.75;
}

.skeleton-card {
  min-height: 220px;
  padding: 22px 20px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.skeleton-line {
  display: block;
  width: 82%;
  height: 11px;
  margin-top: 22px;
  border-radius: 4px;
  background: var(--line-strong);
  animation: skeleton-pulse 1.1s ease-in-out infinite alternate;
}

.skeleton-line:first-child {
  margin-top: 0;
}

.skeleton-line-short { width: 28%; }
.skeleton-line-medium { width: 58%; }

.site-footer {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  padding: 20px 0 28px;
  border-top: 1px solid var(--line);
  font-size: 10px;
  letter-spacing: 0;
}

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

@keyframes skeleton-pulse {
  from { opacity: 0.48; }
  to { opacity: 0.9; }
}

@media (max-width: 760px) {
  .site-shell {
    padding: 0 18px;
  }

  .search-section {
    padding: 60px 0 58px;
  }

  h1 {
    font-size: clamp(38px, 11vw, 54px);
  }

  .lede {
    font-size: 14px;
  }

  .results-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 520px) {
  .site-header {
    min-height: 64px;
  }

  .header-note {
    font-size: 10px;
  }

  .search-section {
    padding-top: 48px;
  }

  .query-control {
    align-items: stretch;
    flex-wrap: wrap;
    gap: 8px;
    padding: 8px;
  }

  .query-control input {
    width: 100%;
    flex-basis: 100%;
  }

  .query-control button {
    width: 100%;
  }

  .results-heading {
    align-items: flex-start;
    flex-direction: column;
    gap: 6px;
  }

  .result-card {
    padding-inline: 16px;
  }

  .field-row {
    grid-template-columns: 1fr;
    gap: 4px;
  }

  .site-footer {
    flex-direction: column;
    gap: 7px;
  }
}

@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;
  }
}

/* Authenticated workspace and admin surfaces */
.header-tools {
  display: flex;
  align-items: center;
  gap: 18px;
}

.header-user {
  color: var(--muted-strong);
  font-size: 12px;
}

.text-button,
.secondary-button,
.table-button {
  color: var(--muted-strong);
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  background: transparent;
  cursor: pointer;
  transition: color 150ms ease, border-color 150ms ease, background-color 150ms ease, transform 150ms var(--ease-out);
}

.text-button {
  padding: 0;
  border: 0;
  font-size: 12px;
}

.text-button:hover,
.secondary-button:hover,
.table-button:hover {
  color: var(--text-strong);
  border-color: var(--accent);
  background: rgba(167, 205, 181, 0.06);
}

.text-button:active,
.secondary-button:active,
.table-button:active {
  transform: scale(0.98);
}

.auth-view,
.password-view {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 380px);
  gap: clamp(42px, 10vw, 150px);
  align-items: end;
  max-width: 900px;
  padding: 108px 0 120px;
}

.auth-copy {
  align-self: center;
}

.auth-form {
  display: grid;
  gap: 10px;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(17, 22, 20, 0.72);
  box-shadow: var(--shadow-soft);
}

.auth-form .field-label {
  margin-top: 7px;
  margin-bottom: 0;
}

.auth-form .field-label:first-child {
  margin-top: 0;
}

.text-input {
  width: 100%;
  min-height: 44px;
  padding: 0 12px;
  color: var(--text-strong);
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  outline: 0;
  background: var(--surface);
  transition: border-color 150ms ease, background-color 150ms ease, box-shadow 150ms ease;
}

.text-input:focus {
  border-color: var(--accent);
  background: var(--surface-raised);
  box-shadow: 0 0 0 3px rgba(167, 205, 181, 0.08);
}

.form-note {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.6;
}

.primary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  min-height: 46px;
  padding: 0 17px;
  color: var(--accent-ink);
  border-radius: 6px;
  background: var(--accent-strong);
  cursor: pointer;
  font-size: 14px;
  font-weight: 400;
  transition: transform 150ms var(--ease-out), background-color 150ms ease, opacity 150ms ease;
}

.primary-button:hover {
  background: #d7f2df;
}

.primary-button:active {
  transform: scale(0.98);
}

.primary-button:disabled {
  cursor: wait;
  opacity: 0.62;
}

.full-button {
  width: 100%;
  margin-top: 5px;
}

.is-success {
  color: var(--accent-strong) !important;
}

.member-view,
.admin-view {
  padding: 72px 0 90px;
}

.workspace-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
}

.quota-display {
  display: grid;
  min-width: 126px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  text-align: right;
}

.quota-display span {
  color: var(--muted);
  font-size: 11px;
}

.quota-display strong {
  margin-top: 5px;
  color: var(--accent-strong);
  font-size: 26px;
  font-weight: 400;
}

.member-view .query-form {
  max-width: 760px;
  margin-top: 44px;
}

.admin-heading {
  margin-bottom: 44px;
}

.admin-grid {
  display: grid;
  gap: 16px;
}

.admin-panel {
  min-width: 0;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(17, 22, 20, 0.64);
  box-shadow: var(--shadow-soft);
}

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

.panel-heading h2 {
  font-size: 20px;
}

.secondary-button {
  min-height: 34px;
  padding: 0 12px;
  font-size: 12px;
}

.inline-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr) 140px auto;
  gap: 8px;
}

.inline-form .primary-button {
  min-height: 44px;
  font-size: 12px;
}

.admin-panel > .query-feedback {
  min-height: 22px;
  margin: 10px 0 0;
}

.table-wrap {
  margin-top: 16px;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 6px;
}

table {
  width: 100%;
  min-width: 650px;
  border-collapse: collapse;
  color: var(--muted-strong);
  font-size: 12px;
}

th,
td {
  padding: 12px 13px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

th {
  color: var(--accent);
  background: rgba(167, 205, 181, 0.04);
  font-size: 10px;
  font-weight: 400;
  letter-spacing: 0.06em;
}

tbody tr:last-child td {
  border-bottom: 0;
}

.table-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.table-button {
  min-height: 28px;
  padding: 0 8px;
  font-size: 10px;
  white-space: nowrap;
}

.result-card .field-label {
  color: var(--accent-strong);
  font-weight: 700;
}

.result-card .field-value {
  color: var(--text-strong);
}

.result-card .field-row {
  border-bottom-color: rgba(167, 205, 181, 0.2);
}

.retry-button {
  min-height: 36px;
  margin-top: 16px;
}

@media (max-width: 760px) {
  .auth-view,
  .password-view {
    grid-template-columns: 1fr;
    gap: 34px;
    padding: 62px 0 80px;
  }

  .member-view,
  .admin-view {
    padding: 54px 0 72px;
  }

  .workspace-heading {
    align-items: flex-start;
    flex-direction: column;
  }

  .quota-display {
    width: 100%;
    text-align: left;
  }

  .inline-form {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 520px) {
  .header-tools {
    gap: 10px;
  }

  .header-user {
    max-width: 140px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .auth-form,
  .admin-panel {
    padding: 17px;
  }
}
