:root {
  --green: #20b67a;
  --green-deep: #0f8f62;
  --black: #151719;
  --ink: #1c1f22;
  --muted: #92979c;
  --bg: #f5f6f7;
  --card: #fff;
  --line: #edf0f2;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: #e7ebef;
  font-family: "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  color: var(--ink);
}

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

.phone {
  position: relative;
  width: min(430px, 100vw);
  min-height: 100vh;
  margin: 0 auto;
  padding-bottom: 88px;
  background: var(--bg);
  overflow: hidden;
}

.mini-header {
  position: sticky;
  top: 0;
  z-index: 5;
  display: grid;
  grid-template-columns: 64px 1fr 76px;
  align-items: center;
  height: 102px;
  padding: 22px 16px 0;
  background: #fff;
  border-bottom: 1px solid rgba(0, 0, 0, 0.04);
}

.mini-header strong {
  text-align: center;
  font-size: 21px;
}

.predicting .mini-header {
  color: #f7f8f9;
  background: #0f1318;
  border-bottom-color: rgba(255, 255, 255, 0.08);
}

.predicting .mini-back,
.predicting .mini-menu {
  color: #f7f8f9;
}

.mini-menu {
  text-align: right;
  color: #111;
  letter-spacing: 1px;
}

.mini-back {
  border: 0;
  background: transparent;
  color: #222;
  font-size: 42px;
  line-height: 1;
  visibility: hidden;
}

.mini-back.visible {
  visibility: visible;
}

.mini-page {
  display: none;
}

.mini-page.active {
  display: block;
}

.year-switch,
.mini-search,
.mini-dates {
  background: #fff;
}

.year-switch {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 18px;
}

.year-switch span {
  color: #888;
}

.year-switch button,
.rank-switch button,
.mini-search button,
.mini-dates button,
.mini-tabbar button,
.dialog-card button,
.create-block button,
.run-prediction {
  border: 0;
  border-radius: 16px;
  background: #f1f2f3;
  color: #888;
  font-weight: 800;
}

.year-switch button {
  min-width: 76px;
  min-height: 40px;
  font-size: 18px;
}

.year-switch button.active,
.rank-switch button.active,
.mini-dates button.active {
  color: #fff;
  background: var(--black);
}

.mini-search {
  display: grid;
  grid-template-columns: 1fr 74px;
  gap: 10px;
  padding: 0 18px 18px;
}

.mini-search input,
.mini-search button,
.create-block select,
.create-block button,
.mini-upload {
  min-height: 48px;
  border-radius: 10px;
}

.mini-search input,
.create-block select {
  width: 100%;
  border: 0;
  padding: 0 16px;
  background: #f3f4f5;
}

.mini-dates {
  display: flex;
  gap: 4px;
  overflow-x: auto;
  padding: 8px 18px;
}

.mini-dates button {
  width: 76px;
  max-width: 76px;
  min-height: 44px;
  flex: 0 0 auto;
  padding: 0;
  border-radius: 22px;
  font-size: 10px;
  line-height: 44px;
  overflow: hidden;
  text-align: center;
  white-space: nowrap;
}

.mini-meta {
  margin: 0;
  padding: 14px 18px;
  color: #aaa;
  font-size: 14px;
}

.mini-list {
  display: grid;
  gap: 12px;
  padding: 0 14px 24px;
}

.mini-match {
  display: grid;
  gap: 16px;
  padding: 18px;
  border: 0;
  border-radius: 16px;
  background: var(--card);
  box-shadow: 0 8px 18px rgba(20, 20, 20, 0.04);
}

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

.mini-match-top {
  color: #9b9b9b;
  font-size: 14px;
  font-weight: 700;
}

.mini-date {
  margin-right: 6px;
  padding: 2px 6px;
  border-radius: 999px;
  color: #15865e;
  background: #e9f7f0;
}

.mini-match-body {
  display: grid;
  grid-template-columns: 1fr 78px 1fr;
  align-items: center;
  gap: 8px;
}

.mini-team {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.mini-team.right {
  justify-content: flex-end;
}

.mini-team strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 20px;
}

.mini-time {
  text-align: center;
}

.mini-time strong,
.mini-time span {
  display: block;
}

.mini-time strong {
  font-size: 28px;
}

.mini-time span {
  color: #aaa;
  font-size: 13px;
}

.mini-actions {
  justify-content: flex-end;
}

.mini-actions button,
.mini-actions span {
  min-height: 34px;
  padding: 0 10px;
  border: 0;
  border-radius: 8px;
  color: var(--green);
  background: #eaf8f1;
  font-weight: 800;
}

.mini-actions span {
  display: inline-flex;
  align-items: center;
  color: #999;
  background: #f4f4f4;
}

.rank-switch {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  padding: 0 18px 12px;
}

.rank-switch button {
  min-height: 46px;
  font-size: 18px;
}

.rank-layout {
  display: grid;
  grid-template-columns: 82px 1fr;
  min-height: 580px;
  background: #fff;
}

.mini-groups {
  display: grid;
  align-content: start;
  background: #f7f8f9;
}

.mini-groups button {
  min-height: 62px;
  border: 0;
  color: #8b8b8b;
  background: transparent;
  font-size: 18px;
  font-weight: 800;
}

.mini-groups button.active {
  color: var(--green);
  background: #eaf8f1;
}

.mini-standings-wrap {
  padding: 16px 10px;
  overflow-x: auto;
}

.mini-standings {
  min-width: 620px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
}

.mini-standing-row {
  display: grid;
  grid-template-columns: 38px minmax(130px, 1fr) repeat(6, 48px);
  align-items: center;
  padding: 14px 10px;
  border-bottom: 1px solid var(--line);
  font-size: 16px;
}

.mini-standing-row.header {
  color: #999;
  font-size: 14px;
  font-weight: 800;
  background: #fafafa;
}

.mini-standing-row.qualified {
  box-shadow: inset 4px 0 0 var(--green);
}

.mini-standing-row strong {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.flag-img {
  width: 34px;
  height: 24px;
  flex: 0 0 auto;
  border-radius: 4px;
  object-fit: cover;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.08);
}

.flag-img.large {
  width: 72px;
  height: 50px;
  border-radius: 6px;
}

.flag-fallback {
  font-size: 25px;
}

.data-page,
.create-page {
  padding: 18px;
}

.data-grid,
.create-block,
.detail-info-card,
.predict-card {
  background: #fff;
  border-radius: 16px;
}

.data-grid {
  display: grid;
  gap: 1px;
  overflow: hidden;
}

.data-grid div {
  display: flex;
  justify-content: space-between;
  padding: 16px;
  background: #fff;
}

.data-grid span,
.detail-info-card span {
  color: #888;
}

.create-block {
  display: grid;
  gap: 12px;
  margin-bottom: 14px;
  padding: 18px;
}

.create-block h2 {
  margin: 0;
  font-size: 20px;
}

.create-block button {
  color: #fff;
  background: var(--green);
}

.mini-upload {
  display: grid;
  place-items: center start;
  padding: 0 14px;
  background: #f3f4f5;
  color: #777;
  font-weight: 800;
}

.mini-upload input {
  display: none;
}

.mini-task-list {
  display: grid;
  gap: 8px;
}

.mini-task-list button {
  display: grid;
  gap: 2px;
  border: 0;
  border-radius: 10px;
  padding: 10px;
  background: #f5f7f8;
  color: #333;
  text-align: left;
}

.detail-page {
  background: #f4f5f6;
}

.mini-live {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  padding: 14px 18px;
  color: #999;
  background: #fff;
}

.mini-live span {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--green);
}

.mini-live button {
  margin-left: auto;
  min-height: 34px;
  border: 0;
  border-radius: 8px;
  padding: 0 14px;
  color: var(--green-deep);
  background: #e9f8f1;
  font-weight: 800;
}

.detail-hero {
  display: grid;
  grid-template-columns: 1fr 112px 1fr;
  align-items: center;
  gap: 8px;
  padding: 34px 20px 32px;
  background: #fff;
  text-align: center;
}

.detail-team {
  display: grid;
  gap: 8px;
  justify-items: center;
}

.detail-team strong {
  font-size: 24px;
}

.detail-team em,
.detail-center em {
  color: #aaa;
  font-style: normal;
}

.detail-center strong {
  display: block;
  font-size: 46px;
}

.detail-center span {
  color: #888;
}

.detail-status {
  display: inline-flex;
  margin-top: 12px;
  padding: 4px 12px;
  border-radius: 8px;
  background: #f3f3f3;
  color: #777;
}

.detail-ai {
  display: grid;
  grid-template-columns: 60px 1fr 24px;
  align-items: center;
  gap: 10px;
  width: calc(100% - 28px);
  margin: 18px 14px;
  border: 0;
  border-radius: 14px;
  padding: 18px;
  color: #fff;
  background: linear-gradient(135deg, #17a86f, #0f8f62);
  text-align: left;
  box-shadow: 0 12px 26px rgba(15, 143, 98, 0.24);
}

.detail-ai span {
  display: grid;
  place-items: center;
  width: 54px;
  height: 54px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.18);
  font-weight: 900;
}

.detail-ai strong,
.detail-ai em {
  display: block;
  grid-column: 2;
}

.detail-ai strong {
  font-size: 22px;
}

.detail-ai em {
  color: rgba(255, 255, 255, 0.72);
  font-style: normal;
}

.detail-ai::after {
  content: "›";
  grid-column: 3;
  grid-row: 1 / span 2;
  font-size: 34px;
}

.detail-tabs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  background: #fff;
}

.detail-tabs button {
  min-height: 58px;
  border: 0;
  background: #fff;
  color: #888;
  font-size: 19px;
  font-weight: 800;
}

.detail-tabs button.active {
  color: #111;
  box-shadow: inset 0 -4px 0 var(--green);
}

#detailBody {
  padding: 18px;
}

.detail-info-card {
  display: grid;
  gap: 1px;
  overflow: hidden;
}

.detail-info-card div {
  display: flex;
  justify-content: space-between;
  padding: 18px;
  background: #fff;
  font-size: 17px;
}

.empty-note {
  display: grid;
  place-items: center;
  min-height: 126px;
  border-radius: 14px;
  background: #fff;
  color: #888;
}

.predict-page {
  min-height: calc(100vh - 102px);
  padding: 16px 14px 96px;
  background: #0f1318;
  color: #f7f8f9;
}

.predict-models {
  display: flex;
  gap: 18px;
  overflow-x: auto;
  padding: 2px 4px 14px;
}

.predict-models button {
  flex: 0 0 auto;
  border: 0;
  border-bottom: 3px solid transparent;
  padding: 10px 0;
  color: #8b9099;
  background: transparent;
  font-size: 20px;
  font-weight: 900;
}

.predict-models button.active {
  color: #fff;
  border-color: var(--green);
}

.predict-models button:disabled {
  opacity: 0.4;
}

.predict-match-card,
.predict-card,
.predict-disclaimer {
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: #171c23;
  border-radius: 16px;
}

.predict-match-card {
  display: grid;
  grid-template-columns: 1fr 64px 1fr;
  align-items: center;
  gap: 8px;
  padding: 22px 14px;
  text-align: center;
}

.predict-match-card strong {
  display: block;
  font-size: 20px;
}

.predict-match-card em {
  display: block;
  color: #808792;
  font-style: normal;
}

.predict-vs {
  color: var(--green);
  font-size: 28px;
  font-weight: 900;
}

.predict-score {
  display: grid;
  justify-items: center;
  gap: 8px;
  padding: 32px 0 22px;
}

.predict-score span,
.predict-score em {
  color: #8d939b;
  font-style: normal;
}

.predict-score strong {
  font-size: 64px;
  line-height: 1;
}

.run-prediction {
  width: 100%;
  min-height: 50px;
  margin-bottom: 16px;
  color: #0d1511;
  background: #49dd92;
}

.predict-card {
  margin-top: 14px;
  padding: 18px;
}

.predict-card h3 {
  margin: 0 0 12px;
  font-size: 20px;
}

.predict-card p {
  margin: 0;
  color: #c7ccd2;
  line-height: 1.7;
}

.predict-bars {
  display: grid;
  gap: 14px;
}

.predict-bar-row {
  display: grid;
  gap: 7px;
}

.predict-bar-row div {
  display: flex;
  justify-content: space-between;
  color: #cfd5dc;
  font-weight: 800;
}

.predict-bar-row i {
  display: block;
  height: 10px;
  overflow: hidden;
  border-radius: 999px;
  background: #2a3039;
}

.predict-bar-row b {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--green);
}

.predict-disclaimer {
  margin-top: 14px;
  padding: 14px;
  color: #e8d98b;
  background: rgba(112, 100, 29, 0.18);
  line-height: 1.6;
}

.share-fab {
  position: fixed;
  right: max(16px, calc((100vw - 430px) / 2 + 16px));
  bottom: 96px;
  z-index: 10;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 118px;
  height: 46px;
  padding: 0 18px;
  border: 0;
  border-radius: 999px;
  color: var(--green-deep);
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.12);
  font-weight: 900;
  line-height: 1;
}

.mini-tabbar {
  position: fixed;
  left: 50%;
  bottom: 0;
  z-index: 9;
  width: min(430px, 100vw);
  transform: translateX(-50%);
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  height: 78px;
  border-top: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.96);
}

.mini-subpage .mini-tabbar {
  display: none;
}

.mini-subpage .phone {
  padding-bottom: 20px;
}

.mini-subpage .share-fab {
  bottom: 28px;
}

.mini-tabbar button {
  display: grid;
  place-items: center;
  align-content: center;
  gap: 2px;
  border-radius: 0;
  background: transparent;
  font-size: 23px;
}

.mini-tabbar span {
  font-size: 13px;
}

.mini-tabbar button.active {
  color: var(--green);
}

.mini-dialog {
  width: min(360px, calc(100vw - 40px));
  border: 0;
  border-radius: 18px;
  padding: 0;
}

.mini-dialog::backdrop {
  background: rgba(0, 0, 0, 0.42);
}

.dialog-card {
  display: grid;
  gap: 12px;
  padding: 20px;
}

.dialog-card h3,
.dialog-card p {
  margin: 0;
}

.dialog-card button:first-of-type {
  min-height: 46px;
  color: #fff;
  background: var(--green);
}

.dialog-card button:last-of-type {
  min-height: 46px;
}
