:root {
  color-scheme: light;
  --bg: #f5f7f8;
  --panel: #ffffff;
  --panel-soft: #f9fbfb;
  --text: #182226;
  --muted: #66757c;
  --line: #dce4e7;
  --accent: #0f8c6d;
  --accent-dark: #067254;
  --error: #b42318;
  --shadow: 0 12px 34px rgba(17, 35, 43, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  background: var(--bg);
  font-family: "PingFang SC", "Microsoft YaHei", Arial, sans-serif;
}

button,
input {
  font: inherit;
}

h2,
p,
dl,
figure {
  margin: 0;
}

.page {
  width: min(100%, 560px);
  margin: 0 auto;
  padding: 18px 14px 32px;
}

.search-box,
.result-panel,
.ticket-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.search-box {
  padding: 16px;
}

.lookup-form {
  display: grid;
}

.search-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 96px;
  gap: 8px;
}

input {
  width: 100%;
  height: 56px;
  padding: 0 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-soft);
  color: var(--text);
  outline: none;
  font-size: 17px;
}

input::placeholder {
  color: #7b8990;
}

input:focus {
  border-color: rgba(15, 140, 109, 0.62);
  box-shadow: 0 0 0 3px rgba(15, 140, 109, 0.12);
}

button {
  min-height: 56px;
  border: 0;
  border-radius: 8px;
  background: var(--accent);
  color: #ffffff;
  font-weight: 700;
  cursor: pointer;
}

button:disabled {
  cursor: wait;
  opacity: 0.68;
}

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

.summary,
dt,
figcaption {
  color: var(--muted);
}

.summary {
  line-height: 1.55;
}

.result-panel {
  display: grid;
  gap: 12px;
  margin-top: 14px;
  padding: 16px;
}

.result-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

h2 {
  font-size: 18px;
}

.text-button {
  min-height: 34px;
  padding: 0;
  background: transparent;
  color: var(--accent-dark);
  box-shadow: none;
}

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

.ticket-card {
  display: grid;
  gap: 16px;
  padding: 14px;
  box-shadow: none;
}

.ticket-fields {
  display: grid;
  gap: 10px;
}

.ticket-fields div {
  display: grid;
  grid-template-columns: 56px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
}

.ticket-fields div:last-child {
  padding-bottom: 0;
  border-bottom: 0;
}

dt {
  font-size: 14px;
}

dd {
  min-width: 0;
  margin: 0;
  overflow-wrap: anywhere;
  font-weight: 700;
  line-height: 1.45;
}

.qr-section {
  display: grid;
  gap: 10px;
}

.qr-title {
  font-weight: 800;
}

.qr-list {
  display: grid;
  gap: 12px;
  justify-items: center;
  padding: 12px;
  border: 1px dashed #c7d5d9;
  border-radius: 8px;
  background: var(--panel-soft);
}

.qr-item {
  display: grid;
  justify-items: center;
  gap: 8px;
}

.qr-item img {
  display: block;
  width: min(240px, 100%);
  height: auto;
  border: 8px solid #ffffff;
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(17, 35, 43, 0.1);
}

.qr-loading,
.qr-empty,
.qr-error,
.empty-state {
  width: 100%;
  padding: 18px 12px;
  color: var(--muted);
  text-align: center;
  line-height: 1.5;
}

.qr-error {
  color: var(--error);
}

.empty-state {
  border: 1px dashed var(--line);
  border-radius: 8px;
  background: var(--panel-soft);
}

@media (max-width: 360px) {
  .search-row {
    grid-template-columns: 1fr;
  }

  button {
    width: 100%;
  }
}
