:root {
  color-scheme: light;
  --bg: #f5f7fb;
  --panel: #ffffff;
  --text: #172033;
  --muted: #667085;
  --line: #e5e9f2;
  --primary: #0b64f4;
  --primary-dark: #084bb8;
  --success: #16835a;
  --warning: #b76b00;
  --danger: #c1342e;
  --amber: #f5b544;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  letter-spacing: 0;
}

button {
  font: inherit;
}

.page {
  width: min(100%, 520px);
  margin: 0 auto;
  padding: 24px 18px calc(36px + env(safe-area-inset-bottom));
}

.hero {
  display: flex;
  align-items: center;
  gap: 16px;
  min-height: 124px;
}

.brand-mark {
  display: block;
  flex: 0 0 64px;
  width: 64px;
  height: 64px;
  border-radius: 8px;
  overflow: hidden;
  background: #ffd34f;
}

.brand-mark-image {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--primary);
  font-size: 13px;
  font-weight: 700;
}

h1 {
  margin: 0;
  font-size: 28px;
  line-height: 1.18;
}

.intro {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.6;
}

.status-panel {
  margin-top: 10px;
  padding: 26px 22px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: 0 12px 34px rgba(33, 43, 66, 0.08);
  text-align: center;
}

.status-icon {
  display: grid;
  place-items: center;
  width: 58px;
  height: 58px;
  margin: 0 auto 14px;
  border-radius: 50%;
  background: #eaf1ff;
  color: var(--primary);
  font-size: 24px;
  font-weight: 800;
}

.status-icon.is-success {
  background: #e8f6ef;
  color: var(--success);
}

.status-icon.is-warning {
  background: #fff3df;
  color: var(--warning);
}

.status-icon.is-danger {
  background: #ffebe9;
  color: var(--danger);
}

h2 {
  margin: 0;
  font-size: 21px;
  line-height: 1.35;
}

#statusMessage {
  margin: 10px auto 0;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.65;
}

.details {
  display: grid;
  gap: 12px;
  margin: 22px 0 0;
  padding: 0;
  text-align: left;
}

.details div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 0;
  border-top: 1px solid var(--line);
}

.details dt {
  color: var(--muted);
  font-size: 14px;
}

.details dd {
  margin: 0;
  font-size: 15px;
  font-weight: 700;
  text-align: right;
}

.primary-button {
  width: 100%;
  height: 46px;
  margin-top: 22px;
  border: 0;
  border-radius: 8px;
  background: var(--primary);
  color: #fff;
  font-weight: 700;
}

.primary-button:active {
  background: var(--primary-dark);
}

.rules {
  display: grid;
  gap: 10px;
  margin-top: 16px;
}

.rules div {
  display: grid;
  grid-template-columns: 28px 1fr;
  align-items: center;
  gap: 10px;
  padding: 13px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.72);
}

.rule-index {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #fff7e6;
  color: #a96500;
  font-size: 14px;
  font-weight: 800;
}

.rules p {
  margin: 0;
  color: #435066;
  font-size: 14px;
  line-height: 1.45;
}

@media (max-width: 360px) {
  .page {
    padding-inline: 14px;
  }

  .brand-mark {
    flex-basis: 56px;
    width: 56px;
    height: 56px;
  }

  h1 {
    font-size: 25px;
  }
}

.history {
  margin-top: 16px;
}

.ghost-button {
  width: 100%;
  height: 44px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  color: var(--primary);
  font-weight: 600;
}

.ghost-button:active {
  background: #eaf1ff;
}

.history-panel {
  margin-top: 12px;
  padding: 18px 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: 0 8px 24px rgba(33, 43, 66, 0.06);
}

.history-controls {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}

.history-controls label {
  color: var(--muted);
  font-size: 14px;
}

.history-controls select {
  flex: 1;
  height: 38px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--text);
  font-size: 15px;
}

.history-summary {
  margin: 0 0 10px;
  color: var(--text);
  font-size: 14px;
  font-weight: 600;
}

.history-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.history-item {
  padding: 12px 0;
  border-top: 1px solid var(--line);
}

.history-item:first-child {
  border-top: 0;
}

.history-item-main {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 15px;
  font-weight: 700;
}

.history-item-amount {
  color: var(--primary);
}

.history-item-sub {
  margin-top: 4px;
  color: var(--muted);
  font-size: 13px;
}

.history-status {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 13px;
}
