:root {
  color-scheme: light;
  --bg: #f6f8fb;
  --card: #ffffff;
  --text: #1f2937;
  --muted: #667085;
  --line: #d9e2ec;
  --brand: #1f3a5f;
  --accent: #1b7f79;
  --blue: #2d6cdf;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sans-serif;
  line-height: 1.55;
}

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

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  justify-content: space-between;
  gap: 24px;
  padding: 14px 28px;
  background: rgba(255, 255, 255, 0.94);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(10px);
}

.brand {
  color: var(--brand);
  font-weight: 800;
}

nav {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

.container {
  width: min(1080px, calc(100vw - 32px));
  margin: 28px auto 64px;
}

.hero {
  margin: 38px 0 22px;
}

.hero h1,
h1 {
  margin: 0 0 10px;
  color: var(--brand);
  font-size: 32px;
  line-height: 1.2;
}

h2 {
  margin: 0 0 10px;
  color: var(--brand);
  font-size: 19px;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--accent);
  font-weight: 800;
}

.card {
  margin: 16px 0;
  padding: 20px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 8px 26px rgba(15, 23, 42, 0.04);
}

.success {
  border-color: #9bd9b2;
  background: #effaf3;
}

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

label {
  display: grid;
  gap: 6px;
  color: var(--brand);
  font-weight: 700;
}

input,
textarea,
select {
  width: 100%;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--text);
  font: inherit;
}

textarea {
  min-height: 92px;
  resize: vertical;
}

button {
  width: fit-content;
  padding: 10px 15px;
  border: 0;
  border-radius: 6px;
  background: var(--brand);
  color: white;
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}

button:hover {
  background: #294b78;
}

button.secondary {
  background: #e5e7eb;
  color: var(--text);
}

button.secondary:hover {
  background: #d1d5db;
}

.button-link {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  min-height: 42px;
  padding: 10px 15px;
  border-radius: 6px;
  background: #e8f6f5;
  color: var(--accent);
  font-weight: 800;
}

.button-link:hover {
  background: #d9f0ee;
}

.grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
}

.grid.two {
  grid-template-columns: repeat(2, 1fr);
}

.metric {
  display: grid;
  gap: 4px;
  padding: 18px;
  background: white;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.metric strong {
  color: var(--brand);
  font-size: 30px;
}

.metric span,
.meta,
.recommend,
p {
  color: var(--muted);
}

.meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

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

.inline-form {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 320px;
}

.recommend {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 10px;
}

.ai-match {
  align-items: stretch;
}

.recommend-item {
  display: grid;
  gap: 6px;
  min-width: min(260px, 100%);
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
  color: var(--text);
}

.recommend-item span {
  color: var(--brand);
  font-weight: 800;
}

.recommend-item small {
  color: var(--muted);
}

.recommend-item button {
  margin-top: 4px;
}

pre {
  overflow: auto;
  white-space: pre-wrap;
  padding: 14px;
  background: #f6f8fa;
  border-radius: 6px;
}

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

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

.copy-grid article {
  min-width: 0;
}

.copy-grid h3 {
  margin: 0 0 8px;
  color: var(--brand);
}

.section-title-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.pill {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 4px 10px;
  border-radius: 999px;
  background: #e8f6f5;
  color: var(--accent);
  font-weight: 800;
  white-space: nowrap;
}

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

.checkin-item {
  display: flex;
  gap: 11px;
  min-height: 86px;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
}

.checkin-item.is-done {
  border-color: #9bd9b2;
  background: #f3fbf6;
}

.checkin-item p,
.checkin-item small {
  display: block;
  margin: 3px 0 0;
  color: var(--muted);
}

.checkin-item .plan-line {
  color: var(--accent);
  font-weight: 700;
}

.checkin-item .muted {
  color: var(--muted);
  font-weight: 500;
}

.avatar {
  display: grid;
  place-items: center;
  flex: 0 0 34px;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--brand);
  color: white;
  font-weight: 900;
}

.ticket-code {
  display: inline-flex;
  margin: 10px 0;
  padding: 10px 14px;
  border-radius: 8px;
  background: var(--brand);
  color: white;
  font-size: 28px;
  font-weight: 900;
  letter-spacing: 0;
}

.check-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  padding: 14px 0;
  border-top: 1px solid var(--line);
}

.check-row:first-of-type {
  border-top: 0;
}

.check-row p {
  margin: 4px 0 0;
}

.check-row small {
  display: block;
  margin: 4px 0;
  color: var(--muted);
}

.alert-row {
  padding: 14px;
  border: 1px solid #f2b8a0;
  border-radius: 8px;
  background: #fff7ed;
}

.qr-preview {
  display: block;
  width: min(220px, 100%);
  aspect-ratio: 1;
  margin: 12px 0;
  object-fit: contain;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
}

.qr-preview.large {
  width: min(320px, 100%);
}

@media (max-width: 760px) {
  .topbar,
  .row,
  .inline-form,
  .check-row {
    display: grid;
  }

  .grid,
  .grid.two,
  .checkin-board,
  .copy-grid {
    grid-template-columns: 1fr;
  }

  .inline-form {
    min-width: 0;
  }
}
