:root {
  --red-bg: #f3f6f9;
  --red-text: #0f172a;
  --red-muted: #64748b;
  --red-line: #e2e8f0;
  --red-main: #0f766e;
  --red-deep: #172033;
  --red-danger: #dc2626;
  --red-card: #ffffff;
  --red-shadow: 0 8px 18px rgba(15, 23, 42, .07);
}

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

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

button,
input {
  font: inherit;
}

button {
  border: 0;
}

.red-app {
  width: 100%;
  max-width: 430px;
  min-height: 100vh;
  margin: 0 auto;
  background: var(--red-bg);
  padding-bottom: calc(20px + env(safe-area-inset-bottom, 0px));
  box-shadow: 0 0 36px rgba(15, 23, 42, .18);
}

.red-header {
  min-height: 92px;
  padding: 14px 14px 18px;
  display: flex;
  align-items: center;
  gap: 12px;
  background: linear-gradient(135deg, #0f766e 0%, #155e75 54%, #172033 100%);
  color: #fff;
}

.red-back {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  display: inline-grid;
  place-items: center;
  color: #fff;
  background: rgba(255, 255, 255, .14);
  border: 1px solid rgba(255, 255, 255, .2);
}

.red-back svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.3;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.red-title {
  min-width: 0;
}

.red-title h1 {
  margin: 0;
  font-size: 24px;
  line-height: 1.1;
  font-weight: 900;
}

.red-title p {
  margin: 6px 0 0;
  color: rgba(255, 255, 255, .84);
  font-size: 13px;
  line-height: 1.3;
}

.red-content {
  padding: 5px 5px 0;
}

.red-filter-grid {
  margin-top: 6px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
}

.red-filter-card {
  min-width: 0;
  min-height: 58px;
  padding: 9px 10px;
  border-radius: 9px;
  background: linear-gradient(180deg, #ffffff, #f8fafc);
  border: 1px solid rgba(15, 118, 110, .18);
  box-shadow: none;
  text-align: left;
  position: relative;
}

.red-filter-card::after {
  content: "";
  position: absolute;
  right: 10px;
  top: 50%;
  width: 7px;
  height: 7px;
  border: solid var(--red-main);
  border-width: 0 2px 2px 0;
  transform: translateY(-50%) rotate(-45deg);
  opacity: .65;
}

.red-filter-card span {
  display: block;
  color: #0f766e;
  font-size: 12px;
  line-height: 1;
  font-weight: 850;
}

.red-filter-card strong {
  display: -webkit-box;
  margin-top: 7px;
  padding-right: 12px;
  color: #334155;
  font-size: 13px;
  line-height: 1.25;
  font-weight: 760;
  overflow: hidden;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.red-summary {
  margin-top: 8px;
  min-height: 36px;
  padding: 8px 10px;
  border-radius: 999px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: rgba(15, 118, 110, .07);
  border: 1px solid rgba(15, 118, 110, .12);
  color: #475569;
  overflow-x: auto;
  white-space: nowrap;
  scrollbar-width: none;
}

.red-summary span {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  color: #475569;
  font-size: 11px;
  line-height: 1;
  font-weight: 760;
}

.red-summary strong {
  color: var(--red-main);
  font-size: 12px;
  line-height: 1;
  font-weight: 900;
}

.red-summary i {
  width: 3px;
  height: 3px;
  border-radius: 50%;
  flex: 0 0 3px;
  background: rgba(71, 85, 105, .38);
}

.red-list-head {
  margin: 12px 2px 7px;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 10px;
}

.red-list-head h2 {
  margin: 0;
  font-size: 18px;
  line-height: 1.1;
  font-weight: 900;
}

.red-list-head p {
  margin: 5px 0 0;
  color: var(--red-muted);
  font-size: 12px;
}

.red-refresh {
  min-width: 58px;
  height: 32px;
  border-radius: 999px;
  color: var(--red-main);
  background: #ecfdf5;
  border: 1px solid rgba(15, 118, 110, .18);
  font-size: 12px;
  font-weight: 800;
}

.red-list {
  display: grid;
  gap: 7px;
}

.red-year {
  margin: 4px 2px 0;
  color: var(--red-muted);
  font-size: 12px;
  font-weight: 800;
}

.red-match-card {
  padding: 11px;
  border-radius: 10px;
  background: #fff;
  border: 1px solid rgba(15, 23, 42, .06);
  box-shadow: var(--red-shadow);
}

.red-match-card.is-hit {
  border-color: rgba(220, 38, 38, .18);
}

.red-match-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.red-match-main {
  min-width: 0;
}

.red-match-meta {
  display: flex;
  align-items: center;
  gap: 7px;
  color: var(--red-muted);
  font-size: 11px;
}

.red-league-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex: 0 0 8px;
}

.red-teams {
  margin-top: 7px;
  color: #0f172a;
  font-size: 15px;
  line-height: 1.25;
  font-weight: 850;
}

.red-score {
  color: var(--red-danger);
}

.red-hit-badge {
  flex: 0 0 auto;
  min-width: 54px;
  padding: 7px 9px;
  border-radius: 999px;
  text-align: center;
  color: #475569;
  background: #f1f5f9;
  font-size: 12px;
  line-height: 1;
  font-weight: 850;
}

.red-match-card.is-hit .red-hit-badge {
  color: #dc2626;
  background: #fff1f2;
}

.red-result-row {
  margin-top: 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.red-pills {
  min-width: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.red-pill {
  min-height: 24px;
  padding: 0 8px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  color: #475569;
  background: #f1f5f9;
  font-size: 11px;
  font-weight: 760;
}

.red-pill.hit {
  color: #dc2626;
  background: #fff1f2;
}

.red-sp {
  flex: 0 0 auto;
  color: var(--red-muted);
  font-size: 12px;
  white-space: nowrap;
}

.red-empty {
  min-height: 180px;
  margin-top: 8px;
  border-radius: 12px;
  display: grid;
  place-content: center;
  gap: 8px;
  text-align: center;
  background: #fff;
  border: 1px dashed #cbd5e1;
  color: #64748b;
}

.red-empty strong {
  color: #0f172a;
  font-size: 18px;
}

.red-loading {
  position: fixed;
  left: 50%;
  top: 50%;
  z-index: 120;
  transform: translate(-50%, -50%);
  padding: 10px 14px;
  border-radius: 999px;
  color: #fff;
  background: rgba(15, 23, 42, .82);
  font-size: 13px;
  font-weight: 800;
}

.red-sheet-mask {
  position: fixed;
  inset: 0;
  z-index: 90;
  background: rgba(15, 23, 42, .48);
}

.red-sheet-mask[hidden],
.red-loading[hidden],
.red-empty[hidden] {
  display: none !important;
}

.red-sheet {
  position: fixed;
  left: 50%;
  bottom: 0;
  z-index: 91;
  width: min(430px, 100%);
  max-height: 78vh;
  transform: translate(-50%, 100%);
  display: flex;
  flex-direction: column;
  border-radius: 18px 18px 0 0;
  background: #fff;
  box-shadow: 0 -18px 38px rgba(15, 23, 42, .18);
  transition: transform .22s ease;
}

.red-sheet.show {
  transform: translate(-50%, 0);
}

.red-sheet-head {
  padding: 15px 16px 10px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid var(--red-line);
}

.red-sheet-head h2 {
  margin: 0;
  color: #0f172a;
  font-size: 18px;
  line-height: 1.2;
  font-weight: 900;
}

.red-sheet-head p {
  margin: 4px 0 0;
  color: var(--red-muted);
  font-size: 12px;
}

.red-sheet-close {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  color: #64748b;
  background: #f1f5f9;
  font-size: 22px;
}

.red-sheet-body {
  padding: 12px 12px 96px;
  overflow: auto;
}

.red-sheet-footer {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 10px 12px calc(10px + env(safe-area-inset-bottom, 0px));
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  background: linear-gradient(180deg, rgba(255,255,255,.88), #fff 28%);
  border-top: 1px solid var(--red-line);
}

.red-sheet-btn {
  min-height: 42px;
  border-radius: 10px;
  color: #0f172a;
  background: #f1f5f9;
  font-weight: 850;
}

.red-sheet-btn.primary {
  color: #fff;
  background: var(--red-main);
}

.red-chip-group,
.red-letter-index,
.red-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.red-letter-index {
  margin-bottom: 12px;
}

.red-section-title {
  margin: 0 0 8px;
  color: #0f172a;
  font-size: 13px;
  font-weight: 900;
}

.red-letter-title {
  margin: 14px 0 8px;
  color: var(--red-muted);
  font-size: 12px;
  font-weight: 900;
}

.red-chip,
.red-tab,
.red-letter-btn {
  min-height: 34px;
  padding: 0 11px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #334155;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  font-size: 13px;
  font-weight: 780;
}

.red-chip.active,
.red-tab.active,
.red-letter-btn.active {
  color: #fff;
  background: var(--red-main);
  border-color: var(--red-main);
}

.red-chip i {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #cbd5e1;
}

@media (prefers-reduced-motion: reduce) {
  .red-sheet {
    transition: none;
  }
}
