:root {
  --paper: #f6f1e6;
  --ink: #17221f;
  --soft: #55615c;
  --teal: #2f7468;
  --coral: #e96555;
  --line: rgba(23, 34, 31, 0.16);
  --white: #fffaf0;
}

* {
  box-sizing: border-box;
}

body {
  max-width: 1180px;
  margin: 0 auto;
  padding: 28px 20px 60px;
  color: var(--ink);
  background:
    radial-gradient(circle at 90% 10%, rgba(47, 116, 104, 0.13), transparent 28rem),
    var(--paper);
  font-family: "Avenir Next", "Segoe UI", "Noto Sans TC", sans-serif;
}

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

header {
  margin-bottom: 28px;
  padding-bottom: 22px;
  border-bottom: 1px solid var(--line);
}

header p,
.panel-heading p {
  margin: 0 0 6px;
  color: var(--teal);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.18em;
}

h1,
h2 {
  margin: 0;
  font-family: Georgia, "Noto Serif TC", serif;
  font-weight: 500;
}

h1 {
  font-size: clamp(36px, 6vw, 62px);
}

h2 {
  font-size: 28px;
}

a,
button {
  color: inherit;
}

header a {
  font-size: 13px;
  font-weight: 700;
}

.notice {
  padding: 16px 18px;
  background: #dcebe5;
  border-radius: 14px;
  font-size: 13px;
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin: 20px 0;
}

.summary-card {
  padding: 20px;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 18px;
}

.summary-card span {
  color: var(--soft);
  font-size: 11px;
}

.summary-card strong {
  display: block;
  margin-top: 10px;
  font-family: Georgia, serif;
  font-size: 34px;
  font-weight: 500;
}

.panel {
  margin-top: 20px;
  padding: 24px;
  background: rgba(255, 250, 240, 0.74);
  border: 1px solid var(--line);
  border-radius: 22px;
}

.panel-heading {
  margin-bottom: 20px;
}

button {
  min-height: 38px;
  padding: 0 13px;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 999px;
  cursor: pointer;
  font-weight: 700;
}

button.danger {
  color: #983a2e;
}

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

.funnel-row {
  display: grid;
  grid-template-columns: 200px 1fr 64px;
  gap: 16px;
  align-items: center;
  padding: 10px 0;
}

.funnel-row span {
  font-size: 13px;
}

.funnel-row output {
  text-align: right;
  font-weight: 800;
}

.funnel-bar {
  height: 12px;
  overflow: hidden;
  background: rgba(23, 34, 31, 0.09);
  border-radius: 999px;
}

.funnel-bar i {
  display: block;
  width: var(--v);
  height: 100%;
  background: var(--teal);
  border-radius: inherit;
}

.table-wrap {
  max-height: 480px;
  overflow: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}

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

th {
  position: sticky;
  top: 0;
  background: var(--paper);
}

code {
  white-space: pre-wrap;
  word-break: break-word;
}

#status {
  position: fixed;
  right: 20px;
  bottom: 20px;
  padding: 12px 16px;
  color: var(--white);
  background: var(--ink);
  border-radius: 12px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 160ms ease;
}

#status.visible {
  opacity: 1;
}

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

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

  .funnel-row {
    grid-template-columns: 130px 1fr 44px;
    gap: 10px;
  }

  .funnel-row span {
    font-size: 11px;
  }

  table {
    table-layout: fixed;
  }

  th:nth-child(1) {
    width: 43%;
  }

  th:nth-child(2) {
    width: 25%;
  }

  th:nth-child(3) {
    width: 32%;
  }

  th:nth-child(4),
  td:nth-child(4) {
    display: none;
  }
}
