/* Dashboard shell — ai.ufootball.com.my
   Look follows the lab /panel layout: near-black ground, dark sidebar,
   the content as one white rounded panel with a sticky topbar.
   Plain CSS on purpose — the panel uses the Tailwind CDN, this page vendors
   nothing it can write in forty lines. */

:root {
  --green: #009E4F;
  --green-dark: #007A3D;
  --accent: #22c55e;
  --red: #FF3B30;

  --ground: #eef5ee;          /* light sage page ground */
  --ground-2: rgba(0, 158, 79, .08);  /* hover on the light ground */
  --side-ink: #33413a;

  --ink: #0f172a;
  --ink-2: #475569;
  --ink-3: #94a3b8;

  --surface: #FFF;
  --surface-2: #f1f5f9;
  --line: #e5eee7;

  --r-sm: 12px;
  --r-md: 16px;
  --r-lg: 24px;

  --body: 'Inter', 'Noto Sans SC', system-ui, -apple-system, 'Segoe UI', sans-serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: var(--body);
  font-size: 15px;
  line-height: 1.5;
  color: var(--ink);
  /* the faint stadium art grounds the whole page; a translucent wash keeps it subtle */
  background:
    linear-gradient(155deg, rgba(246, 250, 246, .82) 0%, rgba(234, 243, 236, .72) 55%, rgba(226, 239, 229, .78) 100%),
    url(img/side-bg.webp) bottom center / cover no-repeat fixed #eef5ee;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 { margin: 0; letter-spacing: -0.02em; }

[hidden] { display: none !important; }

/* ── login ─────────────────────────────────────────────────────────────── */

/* full-bleed stadium background: dark left, light right; the seam in the
   generated art is bridged by the gradient overlay */
.login-wrap {
  position: relative;
  min-height: 100vh;
  background: url(img/login-bg.webp) center / cover no-repeat, #0d3b26;
  display: grid;
  grid-template-columns: 1.15fr 1fr;
  align-items: center;
  padding: 96px 4vw 64px;
}
@media (max-width: 1100px) {
  .login-wrap { grid-template-columns: 1fr; padding: 84px 16px 48px; }
  .login-hero, .lg-deco, .lg-slogan, .lg-top-right > span:first-child { display: none; }
}
@media (max-width: 560px) {
  .login-card { padding: 32px 22px 28px; }
}

/* top bar */
.lg-top {
  position: absolute; top: 0; left: 0; right: 0;
  display: flex; justify-content: space-between; align-items: center;
  padding: 22px 40px;
  color: #fff;
}
.lg-brand { display: flex; align-items: center; gap: 12px; }
.lg-logo { height: 32px; width: auto; }
.lg-brand i { width: 1px; height: 18px; background: rgba(255, 255, 255, .35); }
.lg-slogan { font-size: 14px; opacity: .85; }
.lg-top-right { display: flex; align-items: center; gap: 18px; font-size: 13.5px; }
.lg-top-right > span:first-child { color: #55675c; }
.lg-lang {
  display: flex; align-items: center; gap: 7px;
  background: rgba(255, 255, 255, .92); color: var(--ink);
  border-radius: 999px; padding: 8px 16px; font-weight: 600;
}
.lg-lang svg { width: 16px; height: 16px; }

/* left hero copy */
.login-hero { color: #fff; padding-left: 4vw; }
.login-hero h1 { font-size: 54px; font-weight: 900; line-height: 1.3; letter-spacing: 2px; }
.lh-ai { color: var(--accent); }
.lh-tag { margin: 18px 0 56px; font-size: 17px; letter-spacing: 5px; opacity: .9; }
.lh-feats { display: flex; gap: 44px; flex-wrap: wrap; }
.lh-feat { display: flex; flex-direction: column; gap: 3px; }
.lh-feat svg { width: 27px; height: 27px; color: var(--accent); margin-bottom: 8px; }
.lh-feat b { font-size: 15px; font-weight: 700; }
.lh-feat span { font-size: 12.5px; opacity: .72; }
.lh-script {
  margin-top: 72px;
  font-family: 'Segoe Script', 'Brush Script MT', 'Kaiti SC', 'STKaiti', cursive;
  font-size: 26px; line-height: 1.5;
  transform: rotate(-5deg);
  width: max-content;
  opacity: .92;
}
.lh-stamp {
  position: absolute; left: 40px; bottom: 56px;
  font-size: 11px; font-weight: 700; letter-spacing: .28em; line-height: 1.8;
  opacity: .85;
}
.lh-stamp i { display: block; width: 26px; height: 3px; background: var(--accent); margin-bottom: 10px; }

/* right-edge decoration: the background art carries its own swoosh, keep only the tiny caption */
.lg-deco { position: absolute; right: 26px; top: 0; bottom: 0; pointer-events: none; }
.lg-deco-u { display: none; }
.lg-deco-u {
  position: absolute; right: -30px; top: 40px;
  font-size: 340px; font-weight: 900; line-height: 1;
  color: rgba(0, 158, 79, .07);
}
.lg-deco-txt {
  position: absolute; right: 10px; top: 270px;
  font-size: 11px; font-weight: 700; letter-spacing: .28em; line-height: 1.8;
  color: #9fbfae;
}

.login-side { display: grid; place-items: center; }
/* Nickname view has no hero, so its card must be told to take the right
   column; on login the hero fills column 1 and pushes the card right. */
#view-nickname .login-side { grid-column: 2; }
@media (max-width: 1100px) { #view-nickname .login-side { grid-column: 1; } }

.login-card {
  width: 100%;
  max-width: 480px;
  background: var(--surface);
  border-radius: 24px;
  padding: 44px 48px 36px;
  box-shadow: 0 30px 70px -20px rgba(15, 40, 25, .35);
  text-align: center;
  position: relative;
  z-index: 1;
}
.login-card .field { text-align: left; }
.login-logo { width: 300px; max-width: 80%; height: auto; margin: 0 auto 22px; }
.login-card .brand { font-size: 26px; font-weight: 800; }
.login-card .login-sub { font-size: 14px; margin: 8px 0 26px; }
.login-card .btn { height: 52px; border-radius: 12px; font-size: 15px; }
.login-card .btn-primary { font-size: 16px; font-weight: 700; }
.login-card input { height: 52px; border-radius: 12px; padding-left: 42px; font-size: 14.5px; }
.login-card .field > span:first-child { font-size: 14px; font-weight: 600; color: var(--ink); }
#email {
  padding-left: 42px;
  background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='2' y='4' width='20' height='16' rx='2'/%3E%3Cpath d='m2 7 10 6 10-6'/%3E%3C/svg%3E") 14px center no-repeat;
}
#password {
  padding-left: 42px;
  padding-right: 40px;
  background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='11' width='18' height='11' rx='2'/%3E%3Cpath d='M7 11V7a5 5 0 0 1 10 0v4'/%3E%3C/svg%3E") 14px center no-repeat;
}

/* bottom footer over the background */
.lg-foot {
  position: absolute; left: 0; right: 0; bottom: 0;
  display: flex; justify-content: space-between; align-items: center;
  padding: 18px 40px;
  font-size: 13px; color: #5c6f63;
}
.lg-foot > div:first-child { display: flex; gap: 26px; color: rgba(255, 255, 255, .8); }
.lg-foot span { cursor: default; }
@media (max-width: 900px) { .lg-foot { position: static; flex-direction: column; gap: 6px; margin-top: 24px; } }
.pw-wrap { position: relative; display: block; }
.pw-eye {
  position: absolute; right: 8px; top: 50%; transform: translateY(-50%);
  background: none; border: 0; padding: 4px; cursor: pointer; color: var(--ink-3);
}
.pw-eye svg { width: 18px; height: 18px; display: block; }
.login-links { text-align: right; margin: -4px 0 14px; }
.login-reg { margin: 18px 0 0; font-size: 13.5px; color: var(--ink-2); }
.link-btn { background: none; border: 0; padding: 0; font: inherit; font-size: 13px; color: var(--green); cursor: pointer; }
.link-btn:hover { text-decoration: underline; }

.brand { font-size: 22px; font-weight: 800; }
.brand span { color: var(--green); }

.login-sub { color: var(--ink-3); font-size: 14px; margin: 4px 0 28px; }

.field { display: block; margin-bottom: 14px; }
.field span { display: block; font-size: 13px; color: var(--ink-2); margin-bottom: 6px; }

input[type=email], input[type=password], input[type=text] {
  width: 100%;
  padding: 11px 13px;
  font: inherit;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid #e2e8f0;
  border-radius: var(--r-sm);
}
input:focus-visible {
  outline: none;
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(0, 158, 79, .16);
}

.btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  padding: 11px 16px;
  font: inherit;
  font-weight: 600;
  border-radius: var(--r-sm);
  border: 1px solid transparent;
  cursor: pointer;
}
.btn:disabled { opacity: .55; cursor: default; }
.btn-primary { background: var(--green); color: #fff; }
.btn-primary:not(:disabled):hover { background: var(--green-dark); }
.btn-ghost { background: var(--surface); color: var(--ink); border-color: #e2e8f0; }
.btn-ghost:not(:disabled):hover { background: var(--surface-2); }

.divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 20px 0;
  color: var(--ink-3);
  font-size: 12px;
}
.divider::before, .divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: #e2e8f0;
}

/* Status messages never rely on colour alone — each carries a word. */
.msg { margin-top: 16px; font-size: 13px; padding: 10px 12px; border-radius: var(--r-sm); }
.msg-error { color: #8A1F19; background: #FDECEA; border: 1px solid #F5C6C2; }
.msg-info { color: var(--ink-2); background: var(--surface-2); border: 1px solid var(--line); }
.msg-ok { color: #0A5B33; background: #E8F6EE; border: 1px solid #B9E3CC; }

/* ── app shell: dark ground, sidebar, white rounded main ───────────────── */

.shell {
  display: flex;
  height: 100vh;
  padding: 20px 24px 20px 12px;
  gap: 4px;
  overflow: hidden;
}

.sidebar {
  width: 240px;
  flex: 0 0 240px;
  color: var(--side-ink);
  padding: 12px 10px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  overflow-y: auto;
}
.side-brand { padding: 6px 16px 18px; }
.side-brand img { display: block; width: 140px; height: auto; }

.nav-sec {
  padding: 16px 16px 6px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: #7b8f81;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 16px;
  border-radius: var(--r-sm);
  color: var(--side-ink);
  font-size: 14px;
  text-decoration: none;
  background: none;
  border: 0;
  width: 100%;
  text-align: left;
  font-family: inherit;
  cursor: pointer;
  transition: background .15s, color .15s;
}
.nav-item svg { width: 19px; height: 19px; flex: none; }
.nav-item:hover { background: var(--ground-2); color: var(--green-dark); }
.nav-item[aria-current="page"] {
  background: linear-gradient(135deg, var(--green), var(--green-dark));
  color: #fff;
  font-weight: 600;
  box-shadow: 0 6px 16px -6px rgba(0, 158, 79, .55);
}
.nav-quiet { color: #7b8f81; font-size: 13px; }
.nav-quiet:hover { color: #d33a2c; background: var(--ground-2); }

.sidebar-foot { margin-top: auto; padding: 10px 6px 8px; }
.who { padding: 8px 16px 6px; font-size: 12px; color: #55675c; font-weight: 600; word-break: break-all; }

/* The white panel. It owns the scrolling; the page itself never scrolls. */
.main {
  flex: 1;
  min-width: 0;
  background: var(--surface);
  border: 1px solid rgba(255, 255, 255, .8);
  border-radius: 32px;
  overflow-y: auto;
  box-shadow: 0 18px 45px -18px rgba(23, 60, 35, .25);
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  background: rgba(255, 255, 255, .85);
  backdrop-filter: blur(8px);
  padding: 22px 32px 16px;
  border-bottom: 1px solid var(--line);
}
.topbar h1 { font-size: 26px; font-weight: 800; }
.topbar p { margin: 2px 0 0; color: var(--ink-3); font-size: 13px; }
.topbar-mark {
  float: right;
  display: flex;
  align-items: center;
  gap: 10px;
  opacity: .5;
  pointer-events: none;
}
.topbar-mark img { width: 96px; height: auto; }

.page-body-wrap { padding: 22px 32px 44px; }

/* ── content blocks ────────────────────────────────────────────────────── */

.tiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
@media (max-width: 980px) { .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 520px) { .tiles { grid-template-columns: 1fr; } }

.tile {
  position: relative;
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 18px 20px;
  box-shadow: 0 1px 2px rgba(15, 23, 42, .04);
}
.tile-label { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--ink-2); font-weight: 600; }
.tile-label img { width: 22px; height: 22px; mix-blend-mode: multiply; }
.tile-value { font-size: 32px; font-weight: 800; margin-top: 6px; letter-spacing: -0.03em; }
.tile-note { font-size: 12px; color: var(--ink-3); margin-top: 2px; }
.tile-mark {
  position: absolute;
  right: 14px;
  bottom: 12px;
  width: 84px;
  height: 84px;
  object-fit: contain;
  opacity: .12;
  filter: grayscale(.3);
  pointer-events: none;
}
.card h2 img { width: 20px; height: 20px; vertical-align: -4px; margin-right: 8px; mix-blend-mode: multiply; }

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 20px 22px;
  margin-top: 16px;
  box-shadow: 0 1px 2px rgba(15, 23, 42, .04);
}
.card h2 { font-size: 16px; font-weight: 700; margin-bottom: 4px; }

/* An empty state always says what is happening. A blank card is a bug. */
.empty { color: var(--ink-3); font-size: 14px; padding: 22px 0; text-align: center; }

.tabs { display: inline-flex; gap: 8px; margin-top: 2px; }
.tab {
  border: 0;
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  padding: 8px 18px;
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--ink-2);
  cursor: pointer;
}
.tab.on {
  background: linear-gradient(135deg, var(--green), var(--green-dark));
  color: #fff;
  box-shadow: 0 6px 16px -6px rgba(0, 158, 79, .55);
}

.hint { color: var(--ink-3); font-size: 13px; margin: 0 0 16px; }
.count { color: var(--ink-3); font-weight: 400; font-size: 13px; }

select {
  width: 100%;
  padding: 11px 13px;
  font: inherit;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid #e2e8f0;
  border-radius: var(--r-sm);
}
select:focus-visible { outline: 2px solid var(--green); outline-offset: 1px; }

/* Badges pair colour with a word, so meaning survives colour blindness,
   greyscale printing and a screen reader. */
.badge {
  display: inline-block;
  padding: 2px 9px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}
.b-red { background: #E8F6EE; color: #0A5B33; border: 1px solid #B9E3CC; }
.b-black { background: #F1F2F4; color: #33383F; border: 1px solid #D8DBE0; }
.b-push { background: #FBF3E4; color: #6B5220; border: 1px solid #EBD9B4; }
.b-open { background: var(--surface-2); color: var(--ink-3); border: 1px solid var(--line); }

.sum-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px 20px; flex-wrap: wrap; }
.card-sub { color: var(--ink-3); font-size: 13px; margin-top: 3px; }

.sum-chips { display: flex; gap: 12px; }
.sum-chip {
  display: inline-flex; align-items: center; gap: 10px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 7px 16px;
  box-shadow: 0 1px 2px rgba(15, 23, 42, .05);
}
.sum-chip .dot { width: 28px; height: 28px; }
.sum-chip b { font-size: 18px; }
.n-red { color: var(--green); }
.n-black { color: #33383F; }
.n-push { color: #B98A1B; }

.dots { display: flex; flex-wrap: wrap; gap: 12px 14px; padding: 16px 0 2px; }
.dot-i { display: grid; justify-items: center; gap: 5px; }
.dot {
  width: 38px; height: 38px;
  display: grid; place-items: center;
  border-radius: 50%;
  font-size: 12px; font-weight: 600;
}
.dot-n { font-size: 12px; color: var(--ink-3); }

/* Weekly stacked bars, plain CSS. Pill row / bar band / label row have fixed
   heights so the axis numbers line up with the gridlines behind the bars. */
.wk-chart { display: flex; gap: 12px; margin-top: 18px; }
.wk-axis {
  display: flex; flex-direction: column; justify-content: space-between;
  margin: 28px 0 24px;
  font-size: 11px; color: var(--ink-3); text-align: right;
}
.wk-axis span { line-height: 0; }
.wk-cols { position: relative; flex: 1; display: flex; }
.wk-cols::before {
  content: '';
  position: absolute; left: 0; right: 0; top: 28px; bottom: 24px;
  background: linear-gradient(to top, var(--line) 1px, transparent 1px);
  background-size: 100% calc(100% / var(--ax));
}
.wk-col { position: relative; flex: 1; display: flex; flex-direction: column; align-items: center; }
.wk-rate {
  height: 20px; margin-bottom: 8px;
  display: inline-flex; align-items: center;
  padding: 0 10px; border-radius: 999px;
  background: #E8F6EE; color: var(--green);
  font-size: 12px; font-weight: 700;
}
.wk-bars { height: 190px; width: 100%; display: flex; align-items: flex-end; justify-content: center; }
.wk-stack {
  width: min(56px, 70%);
  display: flex; flex-direction: column;
  border-radius: 8px; overflow: hidden;
}
.wk-seg {
  display: grid; place-items: center;
  color: #fff; font-size: 12px; font-weight: 600;
  min-height: 0;
}
.wk-red { background: var(--green); }
.wk-black { background: #8A8F98; }
.wk-week { height: 24px; display: flex; align-items: flex-end; font-size: 12px; color: var(--ink-2); }

.wk-legend { display: flex; gap: 16px; align-items: center; font-size: 13px; color: var(--ink-2); padding-top: 4px; }
.wk-legend i { width: 10px; height: 10px; border-radius: 50%; display: inline-block; margin-right: 6px; vertical-align: -1px; }
.lg-red { background: var(--green); }
.lg-black { background: #8A8F98; }

/* Wide content scrolls inside its own box; the panel never scrolls sideways. */
.table-wrap { overflow-x: auto; margin-top: 12px; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th {
  text-align: left;
  font-size: 12px;
  font-weight: 600;
  color: var(--ink-3);
  padding: 0 12px 8px 0;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
td { padding: 11px 12px 11px 0; border-bottom: 1px solid var(--line); vertical-align: top; }
tr:last-child td { border-bottom: 0; }
td.num { white-space: nowrap; font-variant-numeric: tabular-nums; color: var(--ink-2); }
.vs { color: var(--ink-3); font-size: 12px; }
.note { color: var(--ink-3); font-size: 12px; margin-top: 3px; }
.locked { color: var(--ink-3); font-size: 12px; }

.link-btn {
  background: none; border: 0; padding: 0;
  font: inherit; font-size: 13px;
  color: var(--ink-2);
  text-decoration: underline;
  cursor: pointer;
}
.link-btn:hover { color: var(--red); }

.kv { display: grid; grid-template-columns: 90px 1fr; gap: 8px 16px; margin: 12px 0 0; }
.kv dt { color: var(--ink-3); font-size: 13px; }
.kv dd { margin: 0; }

/* The tipster page is embedded as-is, so it keeps its own styling. JS sets the
   height to the content height, so the panel keeps the only scrollbar. */
.frame-wrap {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  overflow: hidden;
  margin-top: 16px;
}
/* bare page (AI 分析): the embedded tipster fills the panel edge to edge —
   no topbar, no page padding, no inner frame border */
.main.bare .page-body-wrap { padding: 0; }
.main.bare .frame-wrap { margin: 0; border: 0; border-radius: 0; }

/* ── history row cards (预测记录 / 分析记录 share the layout) ───────────── */
.hrows { margin-top: 8px; }
.hrow {
  display: grid;
  grid-template-columns: 200px 190px minmax(0, 1fr) 100px 76px;
  gap: 16px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: 14px 18px;
  margin-top: 12px;
  box-shadow: 0 1px 2px rgba(15, 23, 42, .04);
}
.h-team { display: flex; align-items: center; gap: 8px; font-weight: 600; font-size: 13.5px; padding: 2px 0; }
.h-team img { width: 22px; height: 22px; flex: none; }
.h-analyst { display: flex; align-items: center; gap: 10px; }
.h-avatar {
  width: 38px; height: 38px; flex: none;
  display: grid; place-items: center;
  background: #e8f6ee; color: var(--green-dark);
  border-radius: 12px; font-size: 12px; font-weight: 800;
}
.h-title { font-weight: 700; font-size: 14px; }
.h-sub { color: var(--ink-3); font-size: 12px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.chip {
  background: #eef7f0; color: var(--green-dark);
  border-radius: 999px; padding: 2px 10px; font-size: 12px; white-space: nowrap;
}
.h-outcome { display: flex; align-items: center; gap: 8px; }
.h-score { font-weight: 700; font-size: 13px; }
.h-time { color: var(--ink-3); font-size: 12.5px; white-space: nowrap; }
.h-act { text-align: right; }
.row-btn {
  font: inherit; font-size: 13px; font-weight: 600;
  color: var(--green); background: var(--surface);
  border: 1px solid #cde9d9; border-radius: var(--r-sm);
  padding: 7px 14px; cursor: pointer;
}
.row-btn:hover { background: #f0faf4; }
.row-btn.danger { color: #b3402f; border-color: #f0d4cf; }
.row-btn.danger:hover { background: #fdf1ef; }
@media (max-width: 900px) {
  .hrow { grid-template-columns: 1fr auto; }
  .h-crit, .h-analyst, .h-main { grid-column: 1 / -1; }
}

/* custom dropdown (fancySelect) */
.fsel { position: relative; display: block; }
.fsel select { display: none; }
.fsel-btn {
  width: 100%; height: 52px;
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  background: var(--surface); color: var(--ink);
  border: 1px solid #e2e8f0; border-radius: 12px;
  padding: 0 14px; font: inherit; font-weight: 600; cursor: pointer;
  text-align: left;
}
.fsel-btn:focus-visible { outline: none; border-color: var(--green); box-shadow: 0 0 0 3px rgba(0, 158, 79, .16); }
.fsel-btn svg { width: 18px; height: 18px; flex: none; color: var(--ink-3); }
.fsel-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sel-wrap .fsel-btn { padding-left: 42px; }
.fsel-list {
  position: absolute; z-index: 60; left: 0; right: 0; top: calc(100% + 6px);
  background: var(--surface); border: 1px solid var(--line); border-radius: 14px;
  box-shadow: 0 18px 45px -12px rgba(23, 60, 35, .28);
  max-height: 320px; overflow-y: auto; padding: 6px;
}
.fsel-item {
  padding: 10px 12px; border-radius: 9px; cursor: pointer;
  font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.fsel-item:hover { background: var(--surface-2); }
.fsel-item.on { background: #E8F6EE; color: #0A5B33; font-weight: 600; }

/* 添加预测 form */
.add-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 16px; }
/* min-width:0 so a long fixture label ellipsizes instead of widening the page */
.add-grid .field, .add-grid .sel-wrap, .add-grid .fsel { min-width: 0; }
.add-grid .field[id="wrap-line"] { grid-column: auto; }
@media (max-width: 900px) { .add-grid { grid-template-columns: 1fr; } }
.sel-wrap { position: relative; display: block; }
.sel-wrap > svg {
  position: absolute; left: 14px; top: 50%; transform: translateY(-50%);
  width: 18px; height: 18px; color: var(--green); pointer-events: none;
  z-index: 1;
}
.sel-wrap select { height: 52px; border-radius: 12px; padding-left: 42px; font-weight: 600; }
.txt-wrap { position: relative; display: block; }
.txt-wrap svg { position: absolute; left: 14px; top: 16px; width: 18px; height: 18px; color: var(--ink-3); pointer-events: none; }
.txt-wrap textarea {
  width: 100%; font: inherit; color: var(--ink);
  border: 1px solid #e2e8f0; border-radius: 12px;
  padding: 13px 13px 24px 42px; resize: vertical; min-height: 96px;
}
.txt-wrap textarea:focus-visible { outline: none; border-color: var(--green); box-shadow: 0 0 0 3px rgba(0, 158, 79, .16); }
.txt-count { position: absolute; right: 14px; bottom: 10px; font-style: normal; font-size: 12.5px; color: var(--ink-3); }
.info-strip {
  display: flex; align-items: center; gap: 10px;
  background: #E8F6EE; color: #0A5B33;
  border-radius: var(--r-sm); padding: 13px 16px;
  font-size: 14px; margin: 18px 0;
}
.info-strip svg { width: 18px; height: 18px; flex: none; }
.btn-record { height: 54px; font-size: 16px; font-weight: 700; border-radius: 14px; }
.btn-record .arrow { margin-left: 6px; }

/* 用户排行榜 rank rows */
.rank-head { display: flex; align-items: flex-start; gap: 12px; margin-bottom: 14px; }
.rank-head .tabs { margin-left: auto; }
.rank-head-ic {
  width: 44px; height: 44px; flex: none;
  display: grid; place-items: center;
  background: linear-gradient(135deg, var(--green), var(--green-dark));
  color: #fff; border-radius: 14px;
}
.rank-head-ic svg { width: 24px; height: 24px; }
.rank-row {
  display: flex; align-items: center; gap: 14px;
  border: 1px solid var(--line); border-radius: var(--r-md);
  padding: 12px 16px; margin-top: 10px;
  background: var(--surface);
}
.rank-1 { background: #fffaf0; border-color: #f2e2bb; }
.rank-2 { background: #f7fafc; border-color: #dde6ee; }
.rank-3 { background: #fdf6f0; border-color: #eeddcb; }
.medal {
  position: relative; width: 40px; height: 40px; flex: none;
  display: grid; place-items: center;
}
.medal svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.medal b { position: relative; font-size: 13px; color: #fff; top: 3px; }
.m-1 { color: #e8b019; }
.m-2 { color: #a9b6c2; }
.m-3 { color: #cd8a4e; }
.m-plain { color: var(--ink-3); font-weight: 700; font-size: 15px; }
.rk-who { min-width: 130px; }
.rk-stats { display: flex; gap: 10px; margin-left: auto; flex-wrap: wrap; }
.rk-stat {
  min-width: 82px; text-align: center;
  background: var(--surface-2); border-radius: var(--r-sm);
  padding: 7px 10px;
}
.rk-stat i { display: block; font-style: normal; font-size: 11.5px; color: var(--ink-3); }
.rk-stat b { font-size: 15px; }
.rk-stat.rk-best { background: #E8F6EE; }
.rk-stat.rk-best b { color: #0A5B33; }
.rk-stat.rk-hot { background: #FDEFE9; }
.rk-stat.rk-hot b { color: #b3402f; }
.rk-badge { min-width: 96px; text-align: right; }
.b-fire { background: #FDEFE9; color: #b3402f; border: 1px solid #F5CFC2; }
@media (max-width: 900px) {
  .rank-row { flex-wrap: wrap; }
  .rk-stats { margin-left: 0; width: 100%; }
  .rk-badge { min-width: 0; }
}

/* AI 分析师排行榜 table */
.an-table { border-collapse: separate; border-spacing: 0 8px; width: 100%; }
.an-table thead th {
  background: var(--surface-2); color: var(--ink-2); font-size: 13px; font-weight: 600;
  padding: 10px 12px; text-align: left;
}
.an-table thead th:first-child { border-radius: var(--r-sm) 0 0 var(--r-sm); }
.an-table thead th:last-child { border-radius: 0 var(--r-sm) var(--r-sm) 0; }
.an-table tbody td { padding: 10px 12px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.an-table tbody tr td:first-child { border-left: 1px solid var(--line); border-radius: var(--r-sm) 0 0 var(--r-sm); }
.an-table tbody tr td:last-child { border-right: 1px solid var(--line); border-radius: 0 var(--r-sm) var(--r-sm) 0; }
.an-table .detail-row td { border: 0; padding: 0 8px 6px; }
.an-name { font-weight: 700; font-size: 14.5px; }
.pct-cell b { display: block; font-size: 14.5px; }
.bar-track {
  display: block; width: 110px; height: 8px; margin-top: 4px;
  background: #e8edea; border-radius: 4px; overflow: hidden;
}
.bar-fill { display: block; height: 100%; background: var(--green); border-radius: 4px; }
.c-red { color: #d33a2c; font-weight: 700; }
.c-black { color: var(--ink); font-weight: 700; }
td.num.roi-pos, .roi-pos { color: #0A8A4A; font-weight: 700; }
td.num.roi-neg, .roi-neg { color: #d33a2c; font-weight: 700; }
.rk-chip {
  display: inline-grid; place-items: center;
  min-width: 30px; height: 30px; padding: 0 6px;
  background: var(--surface-2); border-radius: 50%;
  font-weight: 700; color: var(--ink-2);
}

/* 优质高手预测 cards */
.expert-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; margin-top: 10px; }
@media (max-width: 980px) { .expert-grid { grid-template-columns: 1fr; } }
.expert-card {
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  box-shadow: 0 1px 2px rgba(15, 23, 42, .04);
}
.expert-head { display: flex; align-items: center; gap: 10px; }
.expert-badges { display: flex; flex-wrap: wrap; gap: 6px; }
.chip-hot { background: #fdefe9; color: #b3402f; }
.expert-pick {
  background: var(--surface-2);
  border-radius: var(--r-sm);
  padding: 10px 12px;
  font-size: 13px;
}
.pick-match { color: var(--ink-2); }
.pick-masked { margin-top: 4px; font-weight: 700; letter-spacing: 2px; color: var(--ink-3); filter: blur(3px); user-select: none; }
.btn-unlock { margin-top: auto; }

/* admin-only expandable pick detail under an analyst ranking row */
.detail-row > td { padding: 0 8px 14px; }
.detail-box {
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: 12px 14px;
  overflow-x: auto;
}
.detail-box table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.detail-box th { text-align: left; color: var(--ink-3); font-weight: 600; padding: 6px 8px; }
.detail-box td { padding: 6px 8px; border-top: 1px solid var(--line); white-space: nowrap; }
.frame-wrap iframe {
  display: block;
  width: 100%;
  height: 620px;
  border: 0;
}

/* ── mobile: sidebar becomes the /panel bottom bar ─────────────────────── */

.bottom-nav { display: none; }
.mob-head { display: none; }

@media (max-width: 767px) {
  .shell { padding: 0; height: auto; overflow: visible; display: block; }
  .sidebar { display: none; }
  .main {
    background: transparent;
    border: 0;
    border-radius: 0;
    box-shadow: none;
    min-height: 100vh;
    overflow: visible;
    /* 64px bar + the 30px the centre button rises above it */
    padding-bottom: calc(112px + env(safe-area-inset-bottom, 0px));
  }
  /* App bar replaces the desktop page-title bar, like the mock. */
  .topbar { display: none; }
  .mob-head {
    display: flex;
    align-items: center;
    gap: 12px;
    position: sticky;
    top: 0;
    z-index: 20;
    background: rgba(255, 255, 255, .92);
    backdrop-filter: blur(8px);
    border-bottom: 1px solid var(--line);
    padding: 12px 16px;
  }
  .mob-head img { width: 36px; height: 36px; }
  .mh-txt { display: grid; line-height: 1.3; min-width: 0; }
  .mh-txt b { font-size: 15.5px; font-weight: 800; }
  .mh-txt span {
    font-size: 11.5px; color: var(--ink-3);
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  }
  .mh-spacer { flex: 1; }
  .mh-bell, .mh-avatar {
    width: 38px; height: 38px;
    display: grid; place-items: center;
    border: 0; border-radius: 50%; cursor: pointer;
  }
  .mh-bell { position: relative; background: var(--surface-2); color: var(--ink-2); }
  .mh-bell svg { width: 19px; height: 19px; }
  .mh-avatar {
    background: linear-gradient(135deg, var(--green), var(--green-dark));
    color: #fff; font-weight: 700; font-size: 15px;
  }
  .mh-tip {
    position: absolute; top: calc(100% + 8px); right: 0; z-index: 21;
    background: var(--ink); color: #fff;
    font-size: 12px; font-weight: 500; white-space: nowrap;
    padding: 6px 10px; border-radius: 8px;
  }
  .page-body-wrap { padding: 16px 16px 40px; }
  .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  /* Tab pills drop to their own full-width row instead of crushing vertical */
  .rank-head { flex-wrap: wrap; }
  .rank-head .tabs { margin-left: 0; width: 100%; }
  .tab { white-space: nowrap; }

  .bottom-nav {
    display: flex;
    position: fixed;
    bottom: 0; left: 0; right: 0;
    height: 64px;
    background: var(--surface);
    border-top: 1px solid var(--line);
    box-shadow: 0 -6px 20px rgba(15, 40, 25, .06);
    z-index: 30;
    align-items: stretch;
    padding-bottom: env(safe-area-inset-bottom, 0px);
  }
  .bottom-nav .nav-item {
    position: relative;
    flex-direction: column;
    justify-content: center;
    gap: 2px;
    flex: 1;
    padding: 6px 2px;
    border-radius: 0;
    font-size: 10px;
    font-weight: 700;
    color: var(--ink-3);
    text-align: center;
  }
  .bottom-nav .nav-item svg { width: 20px; height: 20px; }
  .bottom-nav .nav-item:hover { background: none; }
  .bottom-nav .nav-item[aria-current="page"] { background: none; color: var(--green); }
  .bottom-nav .nav-item[aria-current="page"]::after {
    content: '';
    position: absolute; bottom: 5px; left: 50%; transform: translateX(-50%);
    width: 22px; height: 3px; border-radius: 2px;
    background: var(--green);
  }

  /* Raised center action, like the mock's floating ball button. */
  .bottom-nav .nav-center { color: var(--green); }
  .bottom-nav .nav-center svg {
    width: 54px; height: 54px;
    padding: 15px;
    margin-top: -30px;
    background: linear-gradient(135deg, var(--green), var(--green-dark));
    color: #fff;
    border-radius: 50%;
    box-shadow: 0 0 0 6px #e4f2e7, 0 10px 22px -6px rgba(0, 158, 79, .5);
  }
  .bottom-nav .nav-center[aria-current="page"] svg { background: var(--green-dark); }
}

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}
