:root {
  color-scheme: light;
  --ink: #202124;
  --muted: #5f6368;
  --line: #dadce0;
  --paper: #ffffff;
  --soft: #f7f8fa;
  --blue: #1665d8;
  --green: #188038;
  --amber: #b06000;
  --red: #c5221f;
  --shadow: 0 12px 28px rgba(32, 33, 36, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  color: var(--ink);
  background: var(--soft);
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans TC", sans-serif;
  line-height: 1.5;
}

.topbar {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
  padding: 32px clamp(18px, 4vw, 56px) 24px;
  background: var(--paper);
  border-bottom: 1px solid var(--line);
}

.eyebrow {
  margin: 0 0 4px;
  color: var(--blue);
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
}

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

h1 {
  margin-bottom: 0;
  font-size: clamp(30px, 5vw, 52px);
  letter-spacing: 0;
}

h2 {
  font-size: 20px;
}

.status-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.status-strip span,
.badge,
.quick-filters button {
  min-height: 32px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
  padding: 6px 10px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 650;
  white-space: nowrap;
}

main {
  padding: 22px clamp(18px, 4vw, 56px) 40px;
}

.controls {
  display: grid;
  grid-template-columns: minmax(220px, 2fr) repeat(3, minmax(150px, 1fr));
  gap: 12px;
  margin-bottom: 12px;
}

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

input,
select {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
  padding: 0 12px;
  color: var(--ink);
  font: inherit;
}

input:focus,
select:focus,
button:focus-visible,
a:focus-visible {
  outline: 3px solid rgba(22, 101, 216, 0.22);
  outline-offset: 2px;
}

.quick-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 20px;
}

.quick-filters button {
  cursor: pointer;
}

.quick-filters button:hover {
  border-color: var(--blue);
  color: var(--blue);
}

.content-grid {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.panel,
.results {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.panel {
  padding: 18px;
  position: sticky;
  top: 16px;
}

.panel p,
footer p,
.empty p {
  color: var(--muted);
}

dl {
  display: grid;
  gap: 12px;
  margin: 18px 0 0;
}

dl div {
  border-top: 1px solid var(--line);
  padding-top: 12px;
}

dt {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

dd {
  margin: 2px 0 0;
  font-weight: 700;
}

.results {
  padding: 18px;
}

.results-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
}

.results-head p {
  margin: 0;
  color: var(--muted);
}

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 12px;
}

.card {
  display: grid;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
  background: #fff;
  min-height: 276px;
}

.card-head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 12px;
}

.brand {
  margin: 0;
  font-size: 18px;
}

.title {
  margin: 4px 0 0;
  color: var(--muted);
}

.badge.verified {
  color: var(--green);
  border-color: rgba(24, 128, 56, 0.35);
  background: #f0f8f2;
}

.badge.needs_review {
  color: var(--amber);
  border-color: rgba(176, 96, 0, 0.35);
  background: #fff7e6;
}

.badge.expired {
  color: var(--red);
  border-color: rgba(197, 34, 31, 0.35);
  background: #fceeee;
}

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

.meta div {
  background: var(--soft);
  border-radius: 8px;
  padding: 10px;
}

.meta span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.meta strong {
  display: block;
  margin-top: 2px;
  overflow-wrap: anywhere;
}

.card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: auto;
}

.card-actions a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  border-radius: 8px;
  padding: 0 12px;
  border: 1px solid var(--line);
  color: var(--blue);
  font-weight: 700;
  text-decoration: none;
}

.card-actions a:hover {
  border-color: var(--blue);
}

.empty {
  padding: 42px 20px;
  text-align: center;
}

footer {
  border-top: 1px solid var(--line);
  padding: 18px clamp(18px, 4vw, 56px);
  background: var(--paper);
}

footer p {
  margin: 0;
}

@media (max-width: 880px) {
  .topbar,
  .results-head {
    align-items: start;
    flex-direction: column;
  }

  .status-strip {
    justify-content: flex-start;
  }

  .controls,
  .content-grid {
    grid-template-columns: 1fr;
  }

  .panel {
    position: static;
  }
}

@media (max-width: 520px) {
  .meta {
    grid-template-columns: 1fr;
  }

  .card-head {
    flex-direction: column;
  }
}
