/* ============================================================
   奇迹司 · 王牌弈录（王者万象棋王牌对决数据统计）
   深色霓虹竞技风 —— 贴合首图视觉
   ============================================================ */

.wp-page {
  --wp-bg: #0a0a1c;
  --wp-bg-2: #120f2e;
  --wp-panel: rgba(23, 19, 54, .86);
  --wp-panel-2: rgba(32, 26, 72, .92);
  --wp-panel-3: rgba(44, 36, 92, .72);
  --wp-line: rgba(158, 138, 255, .22);
  --wp-line-strong: rgba(178, 158, 255, .42);
  --wp-pink: #ff6fd8;
  --wp-purple: #a06bff;
  --wp-purple-deep: #7b4dff;
  --wp-cyan: #5fd8ff;
  --wp-gold: #ffd479;
  --wp-text: #f3efff;
  --wp-dim: #b7afe0;
  --wp-dim-2: #8b83b8;
  --wp-good: #7ee6b0;
  --wp-warn: #ffcf6b;
  --wp-bad: #ff7d92;
  --wp-radius: 1rem;
  --wp-radius-sm: .6rem;
  --wp-shadow: 0 1.4rem 3.4rem rgba(4, 2, 20, .55);

  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(120% 60% at 50% -10%, rgba(123, 77, 255, .35), transparent 60%),
    radial-gradient(80% 40% at 90% 8%, rgba(255, 111, 216, .18), transparent 60%),
    linear-gradient(180deg, var(--wp-bg) 0%, var(--wp-bg-2) 45%, #0a0a1c 100%);
  background-attachment: fixed;
  color: var(--wp-text);
  font-family: "PingFang SC", "Microsoft YaHei", "Hiragino Sans GB", "Source Han Sans SC", system-ui, -apple-system, "Segoe UI", sans-serif;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

.wp-page * { box-sizing: border-box; }
/* 作者样式里的 display 会盖过 UA 的 [hidden]{display:none}，必须显式兜底，
   否则带 hidden 的空态/弹窗会一直显示。 */
.wp-page [hidden] { display: none !important; }
.wp-visually-hidden {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}

/* ---------------- 顶栏 ---------------- */
.wp-topbar {
  position: sticky;
  top: 0;
  z-index: 60;
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
  padding: .7rem clamp(.9rem, 3vw, 2.2rem);
  background: rgba(10, 9, 28, .82);
  border-bottom: 1px solid var(--wp-line);
  backdrop-filter: blur(18px);
}
.wp-brand { display: flex; align-items: center; gap: .6rem; text-decoration: none; color: inherit; }
.wp-brand-mark {
  position: relative; display: grid; place-items: center;
  width: 2.3rem; height: 2.3rem; border-radius: .7rem;
  background: linear-gradient(135deg, var(--wp-purple), var(--wp-pink));
  box-shadow: 0 0 1.2rem rgba(160, 107, 255, .6);
}
.wp-brand-mark i {
  width: .86rem; height: .86rem; border: 2.5px solid #fff; border-radius: 50%;
  border-right-color: transparent; border-bottom-color: transparent; transform: rotate(-45deg);
}
.wp-brand-text { display: grid; line-height: 1.1; }
.wp-brand-text b { font-size: 1.02rem; font-weight: 900; letter-spacing: .04em; }
.wp-brand-text small { font-size: .66rem; color: var(--wp-dim-2); letter-spacing: .22em; }

.wp-topnav { display: flex; gap: .15rem; flex-wrap: wrap; }
.wp-topnav a {
  padding: .42rem .72rem; border-radius: 999px; color: var(--wp-dim);
  text-decoration: none; font-size: .88rem; font-weight: 700; transition: .2s;
}
.wp-topnav a:hover { color: #fff; background: rgba(160, 107, 255, .2); }

.wp-toptools { display: flex; align-items: center; gap: .5rem; margin-left: auto; }

.wp-search { position: relative; display: flex; align-items: center; }
.wp-search input {
  width: min(19rem, 42vw); padding: .5rem 2.1rem .5rem .9rem;
  background: rgba(255, 255, 255, .06); border: 1px solid var(--wp-line);
  border-radius: 999px; color: var(--wp-text); font-size: .86rem; outline: none; transition: .2s;
}
.wp-search input::placeholder { color: var(--wp-dim-2); }
.wp-search input:focus { border-color: var(--wp-purple); box-shadow: 0 0 0 3px rgba(160, 107, 255, .22); }
.wp-search i {
  position: absolute; right: .85rem; width: .7rem; height: .7rem;
  border: 2px solid var(--wp-dim-2); border-radius: 50%; pointer-events: none;
}
.wp-search i::after {
  content: ""; position: absolute; right: -.42rem; bottom: -.32rem; width: .42rem; height: 2px;
  background: var(--wp-dim-2); transform: rotate(45deg); transform-origin: left center;
}
.wp-search button {
  position: absolute; right: .5rem; width: 1.5rem; height: 1.5rem; border: 0; border-radius: 50%;
  background: rgba(255, 255, 255, .14); color: #fff; cursor: pointer; font-size: .9rem; line-height: 1;
}

/* ---------------- 顶部游戏切换 ---------------- */
.wp-game-switch {
  position: sticky; top: 3.45rem; z-index: 55;
  margin: .55rem clamp(.9rem, 3vw, 2.2rem) 0;
  --game-switch-line: var(--wp-line);
  background: rgba(18, 15, 46, .9);
}
.wp-game-switch a { color: var(--wp-dim); }
.wp-game-switch a:hover { color: #fff; background: rgba(160, 107, 255, .22); }
.wp-game-switch a.is-current { color: #fff; background: var(--wp-purple-deep); }

/* ---------------- 首屏 ---------------- */
.wp-hero {
  position: relative;
  margin: 1rem clamp(.6rem, 2vw, 1.4rem) 0;
  border-radius: calc(var(--wp-radius) + .4rem);
  overflow: hidden;
  border: 1px solid var(--wp-line-strong);
  box-shadow: var(--wp-shadow), 0 0 4rem rgba(123, 77, 255, .25);
}
.wp-hero-media { display: block; margin: 0; }
.wp-hero-media img { display: block; width: 100%; height: auto; }
.wp-hero::after {
  content: ""; position: absolute; inset: auto 0 0 0; height: 46%;
  background: linear-gradient(180deg, transparent, rgba(8, 6, 24, .82));
  pointer-events: none;
}
.wp-hero-links {
  position: absolute; left: 0; right: 0; bottom: clamp(.7rem, 2.4vw, 1.5rem);
  z-index: 2; display: flex; gap: .6rem; justify-content: center; flex-wrap: wrap;
  padding: 0 clamp(.7rem, 3vw, 2rem);
}
.wp-hero-link {
  display: grid; gap: .05rem; padding: .5rem 1.1rem; text-decoration: none; color: #fff;
  background: rgba(20, 15, 48, .68); border: 1px solid var(--wp-line-strong);
  border-radius: 999px; backdrop-filter: blur(10px); transition: .2s;
}
.wp-hero-link:hover { background: var(--wp-purple-deep); border-color: var(--wp-pink); transform: translateY(-2px); }
.wp-hero-link b { font-size: .92rem; font-weight: 800; }
.wp-hero-link small { font-size: .66rem; color: var(--wp-dim); }

/* ---------------- 数据概览 ---------------- */
.wp-stat-strip {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(9rem, 1fr));
  gap: .7rem; margin: 1rem clamp(.9rem, 3vw, 2.2rem) 0;
}
.wp-stat {
  display: grid; gap: .1rem; padding: .8rem 1rem;
  background: var(--wp-panel); border: 1px solid var(--wp-line);
  border-radius: var(--wp-radius); text-align: center;
}
.wp-stat b { font-size: 1.5rem; font-weight: 900; color: var(--wp-cyan); font-variant-numeric: tabular-nums; }
.wp-stat span { font-size: .74rem; color: var(--wp-dim-2); letter-spacing: .08em; }

/* ---------------- 主体 ---------------- */
.wp-main { display: grid; gap: 1.4rem; padding: 1.4rem clamp(.6rem, 2vw, 1.4rem) 3rem; }
.wp-section {
  padding: clamp(.9rem, 2.4vw, 1.6rem);
  background: linear-gradient(180deg, rgba(26, 21, 62, .72), rgba(15, 12, 38, .82));
  border: 1px solid var(--wp-line);
  border-radius: calc(var(--wp-radius) + .2rem);
  box-shadow: var(--wp-shadow);
  scroll-margin-top: 7.5rem;
}
.wp-section-head {
  display: flex; align-items: flex-end; justify-content: space-between;
  gap: 1rem; flex-wrap: wrap; margin-bottom: 1rem;
  padding-bottom: .8rem; border-bottom: 1px solid var(--wp-line);
}
.wp-section-title { display: grid; gap: .1rem; }
.wp-section-title p { margin: 0; font-size: .66rem; letter-spacing: .3em; color: var(--wp-purple); font-weight: 800; }
.wp-section-title h2 { margin: 0; font-size: clamp(1.25rem, 3.6vw, 1.7rem); font-weight: 900; letter-spacing: .02em; }
.wp-section-title span { font-size: .76rem; color: var(--wp-dim-2); }
.wp-section-title h2 small { font-size: .5em; font-weight: 600; letter-spacing: .04em; color: var(--wp-cyan); opacity: .8; margin-left: .45em; vertical-align: .12em; }
.wp-field-tip { font-style: normal; font-size: .72rem; font-weight: 600; color: var(--wp-cyan); opacity: .85; }
.wp-section-tools { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; }
.wp-section-hint { margin: -.2rem 0 .8rem; font-size: .78rem; color: var(--wp-dim); }

/* 标签页 */
.wp-tabs { display: inline-flex; padding: .22rem; gap: .2rem; background: rgba(255, 255, 255, .05); border: 1px solid var(--wp-line); border-radius: 999px; }
.wp-tabs button {
  padding: .4rem .95rem; border: 0; border-radius: 999px; cursor: pointer;
  background: transparent; color: var(--wp-dim); font-size: .84rem; font-weight: 800; transition: .2s;
}
.wp-tabs button:hover { color: #fff; }
.wp-tabs button.is-current { background: linear-gradient(135deg, var(--wp-purple), var(--wp-pink)); color: #fff; box-shadow: 0 0 1rem rgba(255, 111, 216, .4); }

/* 内联筛选 */
.wp-filter-inline { display: inline-flex; align-items: center; gap: .35rem; padding: .24rem .6rem; background: rgba(255, 255, 255, .05); border: 1px solid var(--wp-line); border-radius: .7rem; }
.wp-filter-inline span { font-size: .72rem; color: var(--wp-dim-2); white-space: nowrap; }
.wp-filter-inline input { width: 7.4rem; padding: .28rem .2rem; border: 0; background: transparent; color: var(--wp-text); font-size: .82rem; outline: none; }
.wp-filter-inline input[type="date"] { width: 8.4rem; color-scheme: dark; }
.wp-filter-inline input::placeholder { color: var(--wp-dim-2); }

/* ---------------- 按钮 ---------------- */
.wp-btn {
  padding: .5rem 1rem; border-radius: .7rem; border: 1px solid var(--wp-line-strong);
  background: rgba(255, 255, 255, .06); color: var(--wp-text);
  font-size: .84rem; font-weight: 800; cursor: pointer; transition: .2s; white-space: nowrap;
}
.wp-btn:hover { border-color: var(--wp-purple); background: rgba(160, 107, 255, .2); }
.wp-btn--primary { background: linear-gradient(135deg, var(--wp-purple), var(--wp-pink)); border-color: transparent; box-shadow: 0 0 1.1rem rgba(160, 107, 255, .45); }
.wp-btn--primary:hover { filter: brightness(1.1); background: linear-gradient(135deg, var(--wp-purple), var(--wp-pink)); }
.wp-btn--add { border-color: rgba(95, 216, 255, .5); color: var(--wp-cyan); }
.wp-btn--add:hover { background: rgba(95, 216, 255, .16); }
.wp-btn--danger { border-color: rgba(255, 125, 146, .5); color: var(--wp-bad); }
.wp-btn--danger:hover { background: rgba(255, 125, 146, .16); }
.wp-btn--sm { padding: .3rem .6rem; font-size: .76rem; border-radius: .55rem; }

/* ---------------- 表格 ---------------- */
.wp-table-scroll { overflow-x: auto; border-radius: var(--wp-radius); border: 1px solid var(--wp-line); }
.wp-table { width: 100%; border-collapse: collapse; min-width: 40rem; font-size: .86rem; }
.wp-table thead th {
  position: sticky; top: 0; z-index: 2;
  padding: .7rem .8rem; text-align: left; font-size: .74rem; letter-spacing: .06em;
  color: var(--wp-dim); font-weight: 800; white-space: nowrap;
  background: rgba(28, 22, 66, .96); border-bottom: 1px solid var(--wp-line-strong);
}
.wp-table tbody td { padding: .62rem .8rem; border-bottom: 1px solid rgba(158, 138, 255, .1); vertical-align: middle; }
.wp-table tbody tr:hover { background: rgba(160, 107, 255, .1); }
.wp-table tbody tr:last-child td { border-bottom: 0; }
.wp-table .wp-col-rank { width: 2.6rem; text-align: center; }
.wp-num { font-variant-numeric: tabular-nums; font-weight: 700; }
.wp-player-name { font-weight: 800; color: #fff; }
.wp-rate { font-variant-numeric: tabular-nums; color: var(--wp-cyan); font-weight: 800; }
.wp-note { color: var(--wp-dim-2); font-size: .78rem; }

.wp-rank-badge {
  display: inline-grid; place-items: center; width: 1.7rem; height: 1.7rem; border-radius: 50%;
  font-size: .78rem; font-weight: 900; background: rgba(255, 255, 255, .1); color: var(--wp-dim);
}
.wp-rank-badge.is-1 { background: linear-gradient(135deg, #ffe08a, #e0a824); color: #2a1c00; box-shadow: 0 0 1rem rgba(255, 212, 121, .7); }
.wp-rank-badge.is-2 { background: linear-gradient(135deg, #e6ecf6, #a9b6c9); color: #1c2430; }
.wp-rank-badge.is-3 { background: linear-gradient(135deg, #ffc9a0, #c9835a); color: #2a1508; }

/* 头像 / 缩略图 */
.wp-avatar { width: 2.1rem; height: 2.1rem; border-radius: 50%; object-fit: cover; border: 1px solid var(--wp-line-strong); background: rgba(255,255,255,.06); }
.wp-lord-cell { display: inline-flex; align-items: center; gap: .5rem; }

/* 卡牌 / 阵容 chips */
.wp-chips { display: flex; flex-wrap: wrap; gap: .3rem; }
.wp-chip {
  display: inline-flex; align-items: center; gap: .32rem;
  padding: .16rem .5rem .16rem .2rem; border-radius: 999px;
  background: rgba(160, 107, 255, .16); border: 1px solid var(--wp-line);
  font-size: .74rem; color: var(--wp-text); white-space: nowrap;
}
.wp-chip img { width: 1.2rem; height: 1.2rem; border-radius: .35rem; object-fit: cover; background: rgba(255,255,255,.08); }
.wp-chip--lord img { border-radius: 50%; }
.wp-chip--muted { background: rgba(255,255,255,.06); color: var(--wp-dim); }
.wp-chips-empty { color: var(--wp-dim-2); font-size: .76rem; }

/* ---------------- 对局记录 ---------------- */
.wp-record-list { display: grid; gap: .9rem; }
.wp-record {
  border: 1px solid var(--wp-line); border-radius: var(--wp-radius);
  background: var(--wp-panel); overflow: hidden;
}
.wp-record-head {
  display: flex; align-items: center; gap: .7rem; flex-wrap: wrap;
  padding: .7rem 1rem; background: rgba(44, 36, 92, .5); border-bottom: 1px solid var(--wp-line);
}
.wp-record-date { font-weight: 900; font-size: .98rem; color: var(--wp-gold); font-variant-numeric: tabular-nums; }
.wp-record-session { font-size: .84rem; color: var(--wp-dim); }
.wp-record-meta { margin-left: auto; display: flex; align-items: center; gap: .4rem; }
.wp-record-body { overflow-x: auto; }
.wp-record-body .wp-table { min-width: 32rem; }
.wp-record-body .wp-table thead th { position: static; }

.wp-diamond-num { font-variant-numeric: tabular-nums; font-weight: 800; }
.wp-diamond-num.is-gain { color: var(--wp-good); }
.wp-diamond-num.is-loss { color: var(--wp-bad); }
.wp-diamond-num.is-zero { color: var(--wp-dim-2); }

/* ---------------- 空态 / 提示 ---------------- */
.wp-empty {
  display: grid; place-items: center; gap: .3rem; padding: 2.4rem 1rem; text-align: center;
  border: 1px dashed var(--wp-line-strong); border-radius: var(--wp-radius); color: var(--wp-dim);
}
.wp-empty strong { font-size: 1rem; color: var(--wp-text); }
.wp-empty p { margin: 0; font-size: .82rem; color: var(--wp-dim-2); }
.wp-error { margin: .4rem 0 0; color: var(--wp-bad); font-size: .8rem; }

/* ---------------- 弹窗 ---------------- */
.wp-modal { position: fixed; inset: 0; z-index: 200; display: grid; place-items: center; padding: 1rem; }
.wp-modal[hidden] { display: none; }
.wp-modal-mask { position: absolute; inset: 0; background: rgba(4, 3, 16, .74); backdrop-filter: blur(6px); }
.wp-modal-panel {
  position: relative; z-index: 2; width: min(60rem, 96vw); max-height: 92vh;
  display: flex; flex-direction: column;
  background: linear-gradient(180deg, #1a1540, #12102e);
  border: 1px solid var(--wp-line-strong); border-radius: calc(var(--wp-radius) + .2rem);
  box-shadow: 0 2rem 5rem rgba(0, 0, 0, .7), 0 0 3rem rgba(123, 77, 255, .3);
}
.wp-modal-panel--sm { width: min(26rem, 94vw); }
.wp-modal-panel--picker { width: min(64rem, 96vw); }
.wp-modal-head {
  display: flex; align-items: center; gap: .6rem;
  padding: .85rem 1.1rem; border-bottom: 1px solid var(--wp-line);
}
.wp-modal-head h3 { margin: 0; font-size: 1.02rem; font-weight: 900; }
.wp-role-chip { padding: .16rem .6rem; border-radius: 999px; font-size: .7rem; font-weight: 800; background: rgba(95, 216, 255, .18); color: var(--wp-cyan); }
.wp-role-chip.is-admin { background: rgba(255, 212, 121, .2); color: var(--wp-gold); }
.wp-modal-x { margin-left: auto; width: 2rem; height: 2rem; border: 0; border-radius: .5rem; background: rgba(255,255,255,.08); color: #fff; font-size: 1.2rem; cursor: pointer; }
.wp-modal-x:hover { background: rgba(255, 125, 146, .3); }
.wp-modal-body { padding: 1.1rem; overflow-y: auto; }
.wp-modal-body,
.wp-picker-list,
.wp-table-scroll { scrollbar-width: thin; scrollbar-color: rgba(158, 171, 255, .42) transparent; }
.wp-modal-body::-webkit-scrollbar,
.wp-picker-list::-webkit-scrollbar,
.wp-table-scroll::-webkit-scrollbar { width: .45rem; height: .45rem; }
.wp-modal-body::-webkit-scrollbar-thumb,
.wp-picker-list::-webkit-scrollbar-thumb,
.wp-table-scroll::-webkit-scrollbar-thumb { background: rgba(158, 171, 255, .35); border-radius: 999px; }
.wp-modal-foot { display: flex; justify-content: flex-end; gap: .6rem; padding: .85rem 1.1rem; border-top: 1px solid var(--wp-line); }

/* 表单 */
.wp-field { display: grid; gap: .35rem; margin-bottom: .9rem; }
.wp-field > span { font-size: .78rem; color: var(--wp-dim); font-weight: 700; }
.wp-field input, .wp-field select, .wp-field textarea {
  width: 100%; padding: .55rem .7rem; background: rgba(255, 255, 255, .06);
  border: 1px solid var(--wp-line); border-radius: var(--wp-radius-sm);
  color: var(--wp-text); font-size: .88rem; font-family: inherit; outline: none;
}
.wp-field input:focus, .wp-field select:focus, .wp-field textarea:focus { border-color: var(--wp-purple); box-shadow: 0 0 0 3px rgba(160, 107, 255, .2); }
.wp-field input[type="date"] { color-scheme: dark; }
.wp-field select option { background: #1a1540; color: #fff; }
.wp-field-hint { margin: -.4rem 0 .8rem; font-size: .76rem; color: var(--wp-dim-2); }
.wp-grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr)); gap: .2rem .9rem; }

.wp-subgroup { margin: 1rem 0; padding: .8rem .9rem; border: 1px solid var(--wp-line); border-radius: var(--wp-radius-sm); background: rgba(255,255,255,.03); }
.wp-subgroup > h4 { margin: 0 0 .7rem; font-size: .9rem; font-weight: 900; color: var(--wp-cyan); }
.wp-subgroup > h4 small { color: var(--wp-dim-2); font-weight: 600; margin-left: .4rem; }

/* 行编辑器 */
.wp-rows { display: grid; gap: .6rem; }
.wp-row-edit {
  display: flex; flex-wrap: wrap; gap: .5rem; align-items: flex-end;
  padding: .6rem; border: 1px solid var(--wp-line); border-radius: var(--wp-radius-sm); background: rgba(255,255,255,.03);
}
.wp-row-edit .wp-field { margin: 0; flex: 1 1 7.5rem; min-width: 0; }
.wp-row-edit .wp-field--rank { flex: 0 0 3.8rem; }
.wp-row-edit .wp-field--wide { flex: 1 1 12rem; }
.wp-row-edit .wp-field > span { font-size: .68rem; }
.wp-row-edit input { padding: .42rem .5rem; font-size: .82rem; }
.wp-row-remove { align-self: flex-end; }
.wp-rows-actions { display: flex; gap: .5rem; margin-top: .6rem; }

.wp-select-trigger {
  display: flex; align-items: center; gap: .4rem; min-height: 2.4rem; width: 100%;
  padding: .3rem .5rem; background: rgba(255,255,255,.06); border: 1px dashed var(--wp-line-strong);
  border-radius: var(--wp-radius-sm); cursor: pointer; text-align: left; color: var(--wp-text);
}
.wp-select-trigger:hover { border-color: var(--wp-purple); background: rgba(160,107,255,.12); }
.wp-select-trigger em { color: var(--wp-dim-2); font-style: normal; font-size: .8rem; }

/* ---------------- 图鉴选择器 ---------------- */
.wp-picker-bar { display: flex; align-items: center; gap: .6rem; padding: .7rem 1.1rem; border-bottom: 1px solid var(--wp-line); flex-wrap: wrap; }
.wp-picker-bar input { flex: 1 1 12rem; padding: .5rem .8rem; background: rgba(255,255,255,.06); border: 1px solid var(--wp-line); border-radius: 999px; color: var(--wp-text); font-size: .86rem; outline: none; }
.wp-picker-tabs { display: flex; gap: .25rem; flex-wrap: wrap; }
.wp-picker-tabs button { padding: .32rem .7rem; border: 1px solid var(--wp-line); border-radius: 999px; background: transparent; color: var(--wp-dim); font-size: .76rem; font-weight: 700; cursor: pointer; }
.wp-picker-tabs button.is-current { background: var(--wp-purple-deep); color: #fff; border-color: transparent; }
.wp-picker-list {
  flex: 1; overflow-y: auto; padding: .8rem 1.1rem; min-height: 12rem;
  display: grid; grid-template-columns: repeat(auto-fill, minmax(8.4rem, 1fr)); gap: .5rem; align-content: start;
}
.wp-pick {
  display: flex; align-items: center; gap: .5rem; padding: .45rem .55rem;
  border: 1px solid var(--wp-line); border-radius: var(--wp-radius-sm);
  background: rgba(255,255,255,.03); cursor: pointer; transition: .15s; text-align: left;
}
.wp-pick:hover { border-color: var(--wp-purple); background: rgba(160,107,255,.14); }
.wp-pick.is-on { border-color: var(--wp-pink); background: rgba(255,111,216,.18); box-shadow: 0 0 0 2px rgba(255,111,216,.28) inset; }
.wp-pick img { width: 2.2rem; height: 2.2rem; border-radius: .45rem; object-fit: cover; background: rgba(255,255,255,.08); flex: none; }
.wp-pick--lord img { border-radius: 50%; }
.wp-pick span { font-size: .82rem; font-weight: 700; color: var(--wp-text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wp-pick small { font-size: .64rem; color: var(--wp-dim-2); }
.wp-picker-selected { display: flex; flex-wrap: wrap; gap: .35rem; padding: .6rem 1.1rem; border-top: 1px solid var(--wp-line); min-height: 2.6rem; }

/* ---------------- Toast ---------------- */
.wp-toast {
  position: fixed; left: 50%; bottom: 2.2rem; transform: translateX(-50%);
  z-index: 300; padding: .7rem 1.2rem; border-radius: 999px;
  background: rgba(20, 15, 48, .96); border: 1px solid var(--wp-line-strong);
  color: #fff; font-size: .86rem; font-weight: 700; box-shadow: var(--wp-shadow);
}
.wp-toast.is-error { border-color: rgba(255,125,146,.6); color: #ffd7de; }

/* ---------------- 页脚 ---------------- */
.wp-foot { padding: 2rem 1rem 3rem; text-align: center; border-top: 1px solid var(--wp-line); }
.wp-foot p { margin: 0; color: var(--wp-dim); font-size: .84rem; letter-spacing: .06em; }
.wp-foot-sub { margin-top: .4rem !important; font-size: .74rem !important; color: var(--wp-dim-2) !important; }

/* ---------------- 响应式 ---------------- */
@media (max-width: 900px) {
  .wp-toptools { width: 100%; margin-left: 0; }
  .wp-search { flex: 1; }
  .wp-search input { width: 100%; }
  .wp-topnav { order: 3; width: 100%; overflow-x: auto; }
  .wp-game-switch { top: 6.6rem; }
}
@media (max-width: 640px) {
  .wp-hero-links { gap: .4rem; }
  .wp-hero-link { padding: .38rem .8rem; }
  .wp-hero-link b { font-size: .8rem; }
  .wp-section-head { flex-direction: column; align-items: stretch; }
  .wp-section-tools { flex-direction: column; align-items: stretch; }
  .wp-tabs { width: 100%; }
  .wp-tabs button { flex: 1; }
  .wp-filter-inline { justify-content: space-between; }
  .wp-filter-inline input { width: auto; flex: 1; text-align: right; }
  .wp-row-edit .wp-field { flex: 1 1 100%; }
  .wp-row-edit .wp-field--rank { flex: 0 0 3.6rem; }
  .wp-row-remove { margin-left: auto; }
}

/* ============================================================
   V2 · 王牌赛事控制台
   克制的午夜蓝 + 冰川紫，重排桌面信息层级并提供原生移动布局
   ============================================================ */
.wp-page {
  --wp-bg: #080c16;
  --wp-bg-2: #0d1322;
  --wp-panel: rgba(17, 24, 41, .92);
  --wp-panel-2: rgba(23, 31, 52, .96);
  --wp-panel-3: rgba(31, 41, 67, .82);
  --wp-line: rgba(165, 179, 220, .14);
  --wp-line-strong: rgba(171, 186, 232, .28);
  --wp-accent: #9eabff;
  --wp-accent-strong: #8292f2;
  --wp-accent-soft: rgba(158, 171, 255, .12);
  --wp-pink: var(--wp-accent);
  --wp-purple: var(--wp-accent);
  --wp-purple-deep: var(--wp-accent-strong);
  --wp-cyan: #b9c5ff;
  --wp-gold: #e8cf98;
  --wp-text: #f5f7ff;
  --wp-dim: #aeb8d1;
  --wp-dim-2: #77829f;
  --wp-good: #85d4ad;
  --wp-warn: #e8cf98;
  --wp-bad: #ee8f9e;
  --wp-radius: 1.1rem;
  --wp-radius-sm: .7rem;
  --wp-shadow: 0 1.5rem 4.5rem rgba(1, 4, 12, .42);

  min-height: 100dvh;
  background:
    radial-gradient(70rem 40rem at 50% -15rem, rgba(105, 122, 210, .19), transparent 72%),
    radial-gradient(45rem 28rem at 100% 22rem, rgba(88, 104, 177, .1), transparent 72%),
    #080c16;
  background-attachment: scroll;
  color: var(--wp-text);
  font-family: "MiSans", "HarmonyOS Sans SC", "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  letter-spacing: .01em;
}
.wp-page::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  opacity: .25;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.8' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.065'/%3E%3C/svg%3E");
}
.wp-page a,
.wp-page button,
.wp-page input { -webkit-tap-highlight-color: transparent; }
.wp-page button:active,
.wp-page a:active { transform: translateY(1px); }
.wp-page :focus-visible {
  outline: 2px solid var(--wp-accent);
  outline-offset: 3px;
}
.wp-skip-link {
  position: fixed;
  top: .75rem;
  left: .75rem;
  z-index: 500;
  padding: .55rem .8rem;
  color: #0b1020;
  background: #fff;
  border-radius: .45rem;
  text-decoration: none;
  transform: translateY(-180%);
  transition: transform .2s ease;
}
.wp-skip-link:focus { transform: translateY(0); }

/* 顶部控制栏 */
.wp-topbar {
  min-height: 4.6rem;
  padding: .8rem clamp(1rem, 3vw, 3rem);
  gap: clamp(.9rem, 2vw, 2rem);
  flex-wrap: nowrap;
  background: rgba(8, 12, 22, .86);
  border-bottom-color: rgba(185, 197, 255, .1);
  box-shadow: 0 .75rem 2rem rgba(2, 5, 13, .2);
  backdrop-filter: blur(24px) saturate(125%);
}
.wp-brand { gap: .72rem; flex: none; }
.wp-brand-mark {
  width: 2.45rem;
  height: 2.45rem;
  border-radius: .72rem .72rem .72rem .25rem;
  background: #9eabff;
  box-shadow: 0 .6rem 1.8rem rgba(92, 108, 203, .28);
}
.wp-brand-text b { font-size: 1.08rem; letter-spacing: .08em; }
.wp-brand-text small { color: #8894b2; letter-spacing: .25em; }
.wp-topnav { gap: .2rem; flex-wrap: nowrap; }
.wp-topnav a {
  position: relative;
  padding: .5rem .65rem;
  border-radius: .45rem;
  color: #aab4cc;
  font-size: .82rem;
  font-weight: 650;
  white-space: nowrap;
}
.wp-topnav a::after {
  content: "";
  position: absolute;
  right: .65rem;
  bottom: .24rem;
  left: .65rem;
  height: 1px;
  background: var(--wp-accent);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform .22s ease;
}
.wp-topnav a:hover { color: #fff; background: transparent; }
.wp-topnav a:hover::after { transform: scaleX(1); }
.wp-toptools { min-width: 20rem; }
.wp-search { flex: 1; }
.wp-search input {
  width: 100%;
  min-height: 2.45rem;
  padding-left: 1rem;
  border-color: rgba(165, 179, 220, .16);
  border-radius: .7rem;
  background: rgba(255, 255, 255, .045);
}
.wp-search input:focus {
  border-color: rgba(158, 171, 255, .62);
  box-shadow: 0 0 0 3px rgba(158, 171, 255, .1);
}
.wp-btn {
  min-height: 2.4rem;
  padding: .52rem .9rem;
  border-color: rgba(171, 186, 232, .25);
  border-radius: .62rem;
  background: rgba(255, 255, 255, .04);
  font-weight: 700;
  letter-spacing: .02em;
  transition: transform .18s ease, border-color .2s ease, background-color .2s ease, color .2s ease;
}
.wp-btn:hover {
  border-color: rgba(158, 171, 255, .62);
  background: rgba(158, 171, 255, .11);
}
.wp-btn--primary {
  color: #11172a;
  background: var(--wp-accent);
  border-color: var(--wp-accent);
  box-shadow: 0 .55rem 1.5rem rgba(88, 104, 190, .25);
}
.wp-btn--primary:hover { color: #090d18; background: #b5beff; filter: none; }
.wp-btn--add { color: #dbe0ff; border-color: rgba(158, 171, 255, .42); }
.wp-btn--add:hover { background: rgba(158, 171, 255, .13); }
.wp-btn--danger { color: #f4a5b2; border-color: rgba(238, 143, 158, .34); }
.wp-btn--sm { min-height: 2rem; padding: .32rem .55rem; font-size: .72rem; }

/* 资料库切换 */
.wp-game-switch {
  position: relative;
  top: auto;
  z-index: 2;
  max-width: 92rem;
  margin: 1rem auto 0;
  background: rgba(18, 25, 43, .8);
  border-color: rgba(165, 179, 220, .14);
  box-shadow: none;
}
.wp-game-switch a { color: #9ba6c1; }
.wp-game-switch a:hover { color: #fff; background: rgba(158, 171, 255, .08); }
.wp-game-switch a.is-current { color: #11172a; background: var(--wp-accent); }

/* 首图 */
.wp-hero {
  max-width: 92rem;
  margin: .75rem auto 0;
  border: 0;
  border-radius: 1.45rem;
  box-shadow: 0 2rem 7rem rgba(1, 3, 12, .58);
  isolation: isolate;
}
.wp-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  border: 1px solid rgba(210, 219, 255, .18);
  border-radius: inherit;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .025);
}
.wp-hero::after {
  z-index: 1;
  height: 37%;
  background: linear-gradient(180deg, transparent, rgba(7, 10, 19, .78));
}
.wp-hero-media img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; }
.wp-hero-links {
  right: clamp(1rem, 3vw, 3rem);
  bottom: clamp(1rem, 2.4vw, 2rem);
  left: auto;
  justify-content: flex-end;
  padding: 0;
}
.wp-hero-link {
  grid-template-columns: auto auto;
  column-gap: .55rem;
  align-items: baseline;
  padding: .58rem .82rem;
  border-color: rgba(215, 222, 255, .22);
  border-radius: .62rem;
  background: rgba(9, 13, 24, .68);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .05);
  backdrop-filter: blur(18px);
}
.wp-hero-link:hover {
  border-color: rgba(158, 171, 255, .7);
  background: rgba(24, 32, 55, .88);
  transform: translateY(-2px);
}
.wp-hero-link b { font-size: .84rem; }
.wp-hero-link small { color: #8994ae; }

/* 概览和统计口径 */
.wp-stat-strip {
  position: relative;
  z-index: 3;
  max-width: 80rem;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  margin: -1.6rem auto 0;
  padding: 0 1rem;
}
.wp-stat {
  position: relative;
  min-height: 6.7rem;
  align-content: center;
  padding: 1.1rem 1.35rem;
  border: 0;
  border-radius: 0;
  text-align: left;
  background: rgba(18, 25, 43, .96);
  box-shadow: 0 1.4rem 3.2rem rgba(2, 5, 14, .32);
}
.wp-stat:first-child { border-radius: .95rem 0 0 .95rem; }
.wp-stat:last-child { border-radius: 0 .95rem .95rem 0; }
.wp-stat + .wp-stat::before {
  content: "";
  position: absolute;
  top: 1.1rem;
  bottom: 1.1rem;
  left: 0;
  width: 1px;
  background: rgba(165, 179, 220, .14);
}
.wp-stat b {
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: clamp(1.55rem, 3vw, 2.15rem);
  line-height: 1;
  color: #f7f8ff;
  font-variant-numeric: tabular-nums;
}
.wp-stat > span:last-child { color: #8d98b4; letter-spacing: .04em; }
.wp-stat-index {
  position: absolute;
  top: .75rem;
  right: .85rem;
  color: rgba(158, 171, 255, .42);
  font: 600 .65rem/1 "SFMono-Regular", Consolas, monospace;
}
.wp-method-note {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 1rem;
  max-width: 80rem;
  margin: 1rem auto 0;
  padding: .9rem 1.1rem;
  border: 1px solid rgba(158, 171, 255, .14);
  border-left: 3px solid var(--wp-accent);
  background: rgba(15, 21, 36, .72);
}
.wp-method-kicker {
  color: var(--wp-accent);
  font: 700 .66rem/1 "SFMono-Regular", Consolas, monospace;
  letter-spacing: .14em;
}
.wp-method-note strong { display: block; margin-bottom: .1rem; font-size: .86rem; }
.wp-method-note p { max-width: 66rem; margin: 0; color: var(--wp-dim); font-size: .77rem; line-height: 1.55; }
.wp-method-note a { color: #cbd2ff; font-size: .76rem; font-weight: 700; text-decoration: none; white-space: nowrap; }

/* 主体章节 */
.wp-main {
  width: min(92rem, calc(100% - 2rem));
  max-width: 92rem;
  gap: 1.2rem;
  margin: 0 auto;
  padding: 1.3rem 0 4.5rem;
}
.wp-section {
  position: relative;
  padding: clamp(1rem, 2vw, 1.65rem);
  overflow: hidden;
  border-color: rgba(165, 179, 220, .13);
  border-radius: 1.15rem;
  background: rgba(14, 20, 34, .9);
  box-shadow: 0 1.2rem 3.6rem rgba(1, 4, 12, .24);
  scroll-margin-top: 6rem;
}
.wp-section::before {
  content: "";
  position: absolute;
  top: 0;
  left: clamp(1rem, 2vw, 1.65rem);
  width: 5rem;
  height: 2px;
  background: var(--wp-accent);
  box-shadow: 0 0 1.2rem rgba(158, 171, 255, .5);
}
.wp-section-head {
  align-items: center;
  margin-bottom: .8rem;
  padding: .25rem 0 .9rem;
  border-bottom-color: rgba(165, 179, 220, .1);
}
.wp-section-title {
  grid-template-columns: auto auto;
  column-gap: .7rem;
  align-items: baseline;
}
.wp-section-title p {
  grid-column: 1 / -1;
  color: #7886b8;
  font: 700 .62rem/1 "SFMono-Regular", Consolas, monospace;
  letter-spacing: .22em;
}
.wp-section-title h2 {
  font-size: clamp(1.45rem, 2.6vw, 2.05rem);
  line-height: 1.1;
  letter-spacing: -.04em;
  text-wrap: balance;
}
.wp-section-title span { color: #7f8aa5; }
.wp-section-tools { justify-content: flex-end; }
.wp-section-caption {
  display: flex;
  align-items: center;
  gap: .65rem;
  margin: 0 0 .8rem;
}
.wp-section-hint { margin: 0; color: #8f9ab4; line-height: 1.5; }
.wp-auto-badge {
  flex: none;
  padding: .18rem .46rem;
  border: 1px solid rgba(158, 171, 255, .24);
  border-radius: .3rem;
  color: #bfc7ff;
  background: rgba(158, 171, 255, .08);
  font-size: .65rem;
  font-weight: 700;
}
.wp-tabs {
  gap: 0;
  padding: .18rem;
  border-color: rgba(165, 179, 220, .14);
  border-radius: .68rem;
  background: rgba(255, 255, 255, .025);
}
.wp-tabs button { border-radius: .5rem; font-size: .78rem; }
.wp-tabs button.is-current {
  color: #11172a;
  background: var(--wp-accent);
  box-shadow: 0 .35rem 1rem rgba(89, 104, 184, .22);
}
.wp-filter-inline {
  min-height: 2.4rem;
  padding: .28rem .58rem;
  border-color: rgba(165, 179, 220, .15);
  border-radius: .58rem;
  background: rgba(255, 255, 255, .025);
}
.wp-filter-inline:focus-within { border-color: rgba(158, 171, 255, .55); }
.wp-filter-inline span { color: #7f8aa5; }
.wp-filter-inline input { color: #f6f7ff; }
.wp-filter-inline select {
  width: 7.6rem;
  padding: .28rem 1.25rem .28rem .2rem;
  border: 0;
  outline: 0;
  color: #f6f7ff;
  background: transparent;
  font-family: inherit;
  font-size: .76rem;
  font-weight: 600;
  line-height: 1.2;
  color-scheme: dark;
  cursor: pointer;
}
.wp-filter-inline select option { color: #eef1ff; background: #151d31; }

/* 表格 */
.wp-table-scroll {
  border-color: rgba(165, 179, 220, .12);
  border-radius: .8rem;
  background: rgba(7, 11, 20, .36);
  scrollbar-color: #6673b1 transparent;
}
.wp-table { font-size: .82rem; }
.wp-table thead th {
  padding: .72rem .8rem;
  color: #909bb6;
  background: #151d31;
  border-bottom-color: rgba(165, 179, 220, .14);
  font-size: .69rem;
  letter-spacing: .08em;
}
.wp-table tbody td {
  padding: .7rem .8rem;
  border-bottom-color: rgba(165, 179, 220, .075);
}
.wp-table tbody tr { transition: background-color .18s ease; }
.wp-table tbody tr:hover { background: rgba(158, 171, 255, .055); }
.wp-table-empty td { padding: 2.4rem 1rem !important; text-align: center; }
.wp-num,
.wp-rate,
.wp-diamond-num { font-family: "SFMono-Regular", Consolas, monospace; font-variant-numeric: tabular-nums; }
.wp-num small { color: #65708b; font: inherit; }
.wp-rate { color: #c7ceff; }
.wp-player-name { color: #f8f9ff; font-weight: 750; }
.wp-rank-badge {
  width: 1.8rem;
  height: 1.8rem;
  border-radius: .5rem .5rem .5rem .18rem;
  background: rgba(255, 255, 255, .055);
  color: #9da7bf;
  font-family: "SFMono-Regular", Consolas, monospace;
}
.wp-rank-badge.is-1 { background: #e7cb8e; color: #271f10; box-shadow: 0 .4rem 1rem rgba(184, 145, 67, .22); }
.wp-rank-badge.is-2 { background: #bec8da; color: #17202c; }
.wp-rank-badge.is-3 { background: #c49479; color: #28170f; }
.wp-avatar {
  width: 2.5rem;
  height: 2.5rem;
  border-color: rgba(181, 194, 237, .22);
  border-radius: .7rem .7rem .7rem .25rem;
}
.wp-avatar--fallback { display: grid; place-items: center; color: #d8ddff; background: #28324f; font-weight: 800; }
.wp-lord-cell > span:last-child { display: grid; line-height: 1.25; }
.wp-lord-cell small { color: #78839f; font-size: .66rem; }
.wp-chips { gap: .26rem; }
.wp-chip {
  padding: .16rem .5rem .16rem .2rem;
  border-color: rgba(158, 171, 255, .15);
  border-radius: .42rem;
  color: #dce1f6;
  background: rgba(158, 171, 255, .075);
}
.wp-chip img { border-radius: .28rem; }
.wp-chip--lord { border-radius: 999px; }

/* 对局记录 */
.wp-record-list { gap: .75rem; }
.wp-record {
  border-color: rgba(165, 179, 220, .12);
  border-radius: .82rem;
  background: rgba(8, 13, 23, .42);
}
.wp-record-head {
  min-height: 3.55rem;
  gap: .65rem;
  padding: .7rem .9rem;
  background: rgba(25, 34, 57, .72);
  border-bottom-color: rgba(165, 179, 220, .12);
}
.wp-record-date {
  color: #edf0ff;
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: .88rem;
  letter-spacing: -.02em;
}
.wp-record-session {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  padding: .28rem .52rem;
  border: 1px solid rgba(158, 171, 255, .18);
  border-radius: .42rem;
  color: #cbd2ff;
  background: rgba(158, 171, 255, .07);
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: .74rem;
  font-weight: 700;
}
.wp-record-session i,
.wp-hour-select > i {
  position: relative;
  display: inline-block;
  width: .82rem;
  height: .82rem;
  flex: none;
  border: 1.5px solid currentColor;
  border-radius: 50%;
  opacity: .8;
}
.wp-record-session i::before,
.wp-hour-select > i::before {
  content: "";
  position: absolute;
  top: .16rem;
  left: .34rem;
  width: 1px;
  height: .26rem;
  background: currentColor;
  box-shadow: .13rem .2rem 0 -.05rem currentColor;
  transform-origin: bottom;
}
.wp-record-meta { color: #77829e; font-size: .75rem; }
.wp-record-body .wp-table { min-width: 38rem; }
.wp-diamond-num.is-gain { color: #8ddbb5; }
.wp-diamond-num.is-loss { color: #ee98a6; }
.wp-diamond-num.is-zero { color: #7f8aa6; }

/* 空态、弹窗和表单 */
.wp-empty {
  min-height: 11rem;
  border-color: rgba(165, 179, 220, .18);
  border-radius: .75rem;
  background: rgba(255, 255, 255, .015);
}
.wp-modal-mask { background: rgba(3, 6, 13, .78); backdrop-filter: blur(10px); }
.wp-modal-panel {
  background: #121a2c;
  border-color: rgba(181, 194, 237, .22);
  border-radius: 1rem;
  box-shadow: 0 2rem 6rem rgba(0, 0, 0, .62);
}
.wp-modal-head,
.wp-modal-foot { border-color: rgba(165, 179, 220, .12); }
.wp-modal-x { background: rgba(255, 255, 255, .05); }
.wp-role-chip { color: #c7ceff; background: rgba(158, 171, 255, .1); }
.wp-role-chip.is-admin { color: #dfcc9f; background: rgba(232, 207, 152, .1); }
.wp-field > span { color: #aeb8d1; }
.wp-field input,
.wp-field select,
.wp-field textarea {
  min-height: 2.55rem;
  border-color: rgba(165, 179, 220, .16);
  border-radius: .58rem;
  background: rgba(255, 255, 255, .035);
}
.wp-field input:focus,
.wp-field select:focus,
.wp-field textarea:focus {
  border-color: rgba(158, 171, 255, .65);
  box-shadow: 0 0 0 3px rgba(158, 171, 255, .09);
}
.wp-hour-select {
  position: relative;
  display: flex;
  align-items: center;
  color: #aeb8d1;
}
.wp-hour-select > i { position: absolute; left: .78rem; z-index: 1; pointer-events: none; }
.wp-hour-select select {
  width: 100%;
  min-height: 2.55rem;
  padding: .55rem 2.1rem .55rem 2.15rem;
  border: 1px solid rgba(165, 179, 220, .16);
  border-radius: .58rem;
  outline: none;
  color: #f5f7ff;
  background: rgba(255, 255, 255, .035);
  font: 700 .86rem/1 "SFMono-Regular", Consolas, monospace;
  color-scheme: dark;
}
.wp-hour-select select:focus { border-color: rgba(158, 171, 255, .65); box-shadow: 0 0 0 3px rgba(158, 171, 255, .09); }
.wp-hour-select option { color: #f5f7ff; background: #151d31; }
.wp-auto-explain {
  margin: .1rem 0 1rem;
  padding: .8rem .9rem;
  border-left: 3px solid var(--wp-accent);
  background: rgba(158, 171, 255, .065);
}
.wp-auto-explain strong { font-size: .83rem; }
.wp-auto-explain p { margin: .15rem 0 0; color: #98a3bd; font-size: .75rem; line-height: 1.6; }
.wp-subgroup {
  border-color: rgba(165, 179, 220, .13);
  background: rgba(255, 255, 255, .018);
}
.wp-subgroup > h4 { color: #c7ceff; }
.wp-row-edit {
  display: grid;
  grid-template-columns: 4.2rem minmax(8rem, .7fr) minmax(10rem, 1fr) minmax(14rem, 1.8fr) auto;
  align-items: end;
  border-color: rgba(165, 179, 220, .12);
  background: rgba(3, 7, 15, .24);
}
.wp-row-edit .wp-field,
.wp-row-edit .wp-field--rank,
.wp-row-edit .wp-field--wide { min-width: 0; margin: 0; }
.wp-select-trigger {
  min-height: 2.55rem;
  border-color: rgba(165, 179, 220, .22);
  border-radius: .58rem;
  background: rgba(255, 255, 255, .025);
}
.wp-select-trigger:hover { border-color: rgba(158, 171, 255, .58); background: rgba(158, 171, 255, .07); }
.wp-picker-bar input { border-radius: .58rem; }
.wp-picker-tabs button { border-radius: .4rem; }
.wp-picker-tabs button.is-current { color: #11172a; background: var(--wp-accent); }
.wp-pick {
  border-color: rgba(165, 179, 220, .13);
  border-radius: .58rem;
  background: rgba(255, 255, 255, .018);
}
.wp-pick.is-on { border-color: var(--wp-accent); background: rgba(158, 171, 255, .1); box-shadow: inset 0 0 0 1px rgba(158, 171, 255, .25); }
.wp-toast {
  border-color: rgba(171, 186, 232, .28);
  border-radius: .62rem;
  background: rgba(19, 27, 46, .96);
}
.wp-foot { border-top-color: rgba(165, 179, 220, .1); }

@media (max-width: 1180px) {
  .wp-topbar { flex-wrap: wrap; }
  .wp-topnav { order: 3; width: 100%; overflow-x: auto; scrollbar-width: none; }
  .wp-topnav::-webkit-scrollbar { display: none; }
  .wp-toptools { margin-left: auto; }
  .wp-game-switch,
  .wp-hero { width: calc(100% - 2rem); }
  .wp-method-note { width: calc(100% - 2rem); }
}

@media (max-width: 760px) {
  .wp-page { background: #080c16; }
  .wp-topbar {
    position: relative;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    min-height: 0;
    padding: .72rem .85rem .6rem;
    gap: .65rem .7rem;
  }
  .wp-brand-mark { width: 2.2rem; height: 2.2rem; }
  .wp-brand-text b { font-size: .96rem; }
  .wp-brand-text small { font-size: .58rem; }
  .wp-toptools {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    width: auto;
    min-width: 0;
    margin: 0;
  }
  .wp-search input { min-height: 2.2rem; font-size: .78rem; }
  .wp-toptools .wp-btn { min-height: 2.2rem; padding: .42rem .58rem; font-size: .72rem; }
  .wp-topnav {
    grid-column: 1 / -1;
    order: initial;
    margin: 0 -.85rem;
    padding: .05rem .85rem .12rem;
  }
  .wp-topnav a { padding: .42rem .55rem; font-size: .73rem; }
  .wp-game-switch {
    width: calc(100% - 1.4rem);
    margin-top: .7rem;
    border-radius: .72rem;
  }
  .wp-game-switch a { min-width: 0; padding: .45rem .7rem; }
  .wp-game-switch a span { font-size: .76rem; }
  .wp-game-switch a small { font-size: .56rem; }
  .wp-hero {
    width: calc(100% - 1.4rem);
    margin-top: .55rem;
    border-radius: 1rem;
    overflow: hidden;
  }
  .wp-hero-media img { aspect-ratio: auto; height: auto; object-fit: contain; }
  .wp-hero::after { height: 19%; }
  .wp-hero-links {
    position: relative;
    right: auto;
    bottom: auto;
    left: auto;
    z-index: 3;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1px;
    background: rgba(165, 179, 220, .12);
  }
  .wp-hero-link {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0;
    min-width: 0;
    padding: .62rem .35rem;
    border: 0;
    border-radius: 0;
    text-align: center;
    background: #11182a;
  }
  .wp-hero-link b { font-size: .74rem; }
  .wp-hero-link small { font-size: .58rem; }
  .wp-stat-strip {
    width: calc(100% - 1.4rem);
    grid-template-columns: repeat(2, 1fr);
    gap: 1px;
    margin-top: .7rem;
    padding: 0;
    background: rgba(165, 179, 220, .1);
    border: 1px solid rgba(165, 179, 220, .1);
    border-radius: .82rem;
    overflow: hidden;
  }
  .wp-stat {
    min-height: 5.25rem;
    padding: .8rem .9rem;
    border-radius: 0 !important;
    box-shadow: none;
    background: #11182a;
  }
  .wp-stat + .wp-stat::before { display: none; }
  .wp-stat b { font-size: 1.55rem; }
  .wp-stat-index { top: .55rem; right: .6rem; }
  .wp-method-note {
    width: calc(100% - 1.4rem);
    grid-template-columns: 1fr auto;
    gap: .45rem .7rem;
    margin-top: .7rem;
    padding: .75rem .8rem;
  }
  .wp-method-kicker { grid-column: 1; }
  .wp-method-note div { grid-column: 1 / -1; grid-row: 2; }
  .wp-method-note a { grid-column: 2; grid-row: 1; }
  .wp-main { width: calc(100% - 1.4rem); gap: .75rem; padding-top: .75rem; }
  .wp-section { padding: 1rem .8rem 1.05rem; border-radius: .9rem; }
  .wp-section::before { left: .8rem; width: 3.5rem; }
  .wp-section-head { align-items: stretch; gap: .75rem; }
  .wp-section-title h2 { font-size: 1.42rem; }
  .wp-section-tools {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: .42rem;
  }
  .wp-tabs { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(3, 1fr); width: 100%; }
  .wp-tabs button { padding: .48rem .3rem; font-size: .73rem; }
  .wp-filter-inline { width: 100%; min-width: 0; padding: .24rem .5rem; }
  .wp-filter-inline span { font-size: .64rem; }
  .wp-filter-inline input,
  .wp-filter-inline input[type="date"],
  .wp-filter-inline select { width: 100%; min-width: 0; text-align: right; font-size: .72rem; }
  .wp-section-tools > .wp-btn--add { grid-column: 1 / -1; }
  .wp-section-caption { align-items: flex-start; }
  .wp-section-hint { font-size: .72rem; }

  /* 手机上的表格转为原生排名卡片，不要求横向拖动 */
  .wp-table-scroll,
  .wp-record-body { overflow: visible; border: 0; background: transparent; }
  .wp-table,
  .wp-record-body .wp-table { display: block; min-width: 0; width: 100%; }
  .wp-table thead { display: none; }
  .wp-table tbody { display: grid; gap: .5rem; }
  .wp-table tbody tr {
    position: relative;
    display: grid;
    grid-template-columns: 2.35rem minmax(0, 1fr) minmax(5.8rem, auto);
    min-width: 0;
    padding: .72rem .68rem .68rem;
    border: 1px solid rgba(165, 179, 220, .12);
    border-radius: .68rem;
    background: rgba(255, 255, 255, .025);
  }
  .wp-table tbody td {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .65rem;
    min-width: 0;
    padding: .42rem .25rem;
    border: 0;
    border-top: 1px solid rgba(165, 179, 220, .075);
    text-align: right;
  }
  .wp-table tbody td::before {
    content: attr(data-label);
    flex: none;
    color: #707b96;
    font-family: inherit;
    font-size: .65rem;
    font-weight: 600;
  }
  .wp-table tbody td.wp-col-rank {
    grid-column: 1;
    grid-row: 1;
    align-self: start;
    justify-content: flex-start;
    padding: 0;
    border: 0;
  }
  .wp-table tbody td.wp-col-rank::before { display: none; }
  .wp-table tbody td:nth-child(2) {
    grid-column: 2 / -1;
    grid-row: 1;
    min-height: 2rem;
    justify-content: flex-start;
    padding: 0 0 .55rem;
    border: 0;
    text-align: left;
  }
  .wp-table tbody td:nth-child(2)::before { display: none; }
  .wp-table--players tbody td:nth-child(3),
  .wp-table--players tbody td:nth-child(4),
  .wp-table--players tbody td:nth-child(5) { grid-column: auto; }
  .wp-table--players tbody td:nth-child(n + 3) { grid-row: auto; }
  .wp-table--players tbody td[data-label="历史阵容"],
  .wp-table--players tbody td[data-label="资料维护"] { grid-column: 1 / -1; }
  .wp-table--players tbody td[data-label="历史阵容"] .wp-chips { justify-content: flex-end; }
  .wp-table--lords tbody td:nth-child(n + 3) { grid-column: auto; }
  .wp-table--lords tbody td:nth-child(5) { grid-column: 2 / -1; }
  .wp-table-empty { display: block !important; padding: 0 !important; }
  .wp-table-empty td { display: block !important; padding: 2rem .7rem !important; border: 0 !important; text-align: center !important; }
  .wp-table-empty td::before { display: none !important; }
  .wp-rank-badge { width: 1.75rem; height: 1.75rem; }
  .wp-record { border: 0; background: transparent; overflow: visible; }
  .wp-record-head {
    min-height: 0;
    padding: .68rem .72rem;
    border: 1px solid rgba(165, 179, 220, .12);
    border-radius: .68rem .68rem 0 0;
  }
  .wp-record-session { order: initial; width: auto; padding: .26rem .46rem; border: 1px solid rgba(158, 171, 255, .18); }
  .wp-record-meta { align-self: flex-start; }
  .wp-record-body { padding: .48rem 0 0; }
  .wp-record-body .wp-table tbody tr { background: rgba(13, 19, 33, .9); }
  .wp-record-body .wp-table tbody td:nth-child(n + 3) { grid-column: 2 / -1; }
  .wp-record-body .wp-table tbody td .wp-chips { justify-content: flex-end; }
  .wp-chip { max-width: 100%; font-size: .68rem; }
  .wp-chip img { width: 1.1rem; height: 1.1rem; }

  /* 手机录入使用底部工作台 */
  .wp-modal { align-items: end; padding: 0; }
  .wp-modal-panel,
  .wp-modal-panel--sm,
  .wp-modal-panel--picker {
    width: 100%;
    max-height: min(92dvh, 52rem);
    border-right: 0;
    border-bottom: 0;
    border-left: 0;
    border-radius: 1.05rem 1.05rem 0 0;
  }
  .wp-modal-head { padding: .85rem .9rem; }
  .wp-modal-body { padding: .9rem; }
  .wp-modal-foot { padding: .7rem .9rem max(.7rem, env(safe-area-inset-bottom)); background: #121a2c; }
  .wp-modal-foot .wp-btn { flex: 1; }
  .wp-grid-2 { grid-template-columns: 1fr; gap: 0; }
  .wp-subgroup { padding: .7rem; }
  .wp-subgroup > h4 small { display: block; margin: .15rem 0 0; }
  .wp-row-edit {
    grid-template-columns: 4.2rem minmax(0, 1fr);
    gap: .5rem;
    padding: .65rem;
  }
  .wp-row-edit .wp-field { grid-column: 1 / -1; }
  .wp-row-edit .wp-field--rank { grid-column: 1; }
  .wp-row-edit .wp-field:nth-child(2) { grid-column: 2; }
  .wp-row-edit .wp-field--wide { grid-column: 1 / -1; }
  .wp-row-remove { grid-column: 2; justify-self: end; margin: 0; }
  .wp-picker-bar { padding: .65rem .8rem; }
  .wp-picker-list { grid-template-columns: repeat(2, minmax(0, 1fr)); padding: .7rem .8rem; }
  .wp-picker-selected { padding: .55rem .8rem; max-height: 5rem; overflow-y: auto; }
  .wp-toast { bottom: calc(1rem + env(safe-area-inset-bottom)); width: calc(100% - 2rem); text-align: center; }
  .wp-foot { padding-bottom: calc(2rem + env(safe-area-inset-bottom)); }
}

@media (max-width: 410px) {
  .wp-topbar { grid-template-columns: 1fr; }
  .wp-brand { justify-self: start; }
  .wp-toptools { grid-column: 1; }
  .wp-topnav { grid-column: 1; }
  .wp-section-tools { grid-template-columns: 1fr; }
  .wp-section-tools > * { grid-column: 1 !important; }
  .wp-table--players tbody tr,
  .wp-table--lords tbody tr { grid-template-columns: 2.25rem minmax(0, 1fr); }
  .wp-table--players tbody td:nth-child(n + 3),
  .wp-table--lords tbody td:nth-child(n + 3) { grid-column: 1 / -1; }
}

@media (prefers-reduced-motion: reduce) {
  .wp-page *,
  .wp-page *::before,
  .wp-page *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important; }
}

/* ============ 多页模块拆分后新增 ============ */
.wp-modnav { display: flex; gap: .4rem; flex-wrap: wrap; align-items: center; padding: .8rem clamp(.6rem, 2vw, 1.4rem) 0; }
.wp-modnav a { display: inline-flex; align-items: center; gap: .32rem; padding: .38rem .82rem; border-radius: 999px; border: 1px solid var(--wp-line); background: rgba(23, 19, 54, .6); color: var(--wp-dim); font-size: .84rem; font-weight: 700; text-decoration: none; transition: .2s; }
.wp-modnav a:hover { color: #fff; border-color: var(--wp-purple); background: rgba(160, 107, 255, .18); }
.wp-modnav a.is-current { color: #fff; border-color: transparent; background: linear-gradient(135deg, var(--wp-purple), var(--wp-pink)); box-shadow: 0 0 1rem rgba(255, 111, 216, .35); }
.wp-modnav a small { font-size: .62rem; letter-spacing: .16em; font-weight: 800; opacity: .7; }
.wp-modnav a.is-current small { opacity: .85; }

.wp-modgrid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 1rem; }
.wp-modcard { display: grid; gap: .35rem; align-content: start; padding: 1.1rem 1.2rem; border-radius: var(--wp-radius); border: 1px solid var(--wp-line); background: linear-gradient(160deg, rgba(32, 26, 72, .92), rgba(18, 15, 46, .9)); text-decoration: none; transition: .22s; }
.wp-modcard:hover { transform: translateY(-3px); border-color: var(--wp-pink); box-shadow: 0 .8rem 2rem rgba(4, 2, 20, .5); }
.wp-modcard i { font-style: normal; font-size: .66rem; letter-spacing: .24em; color: var(--wp-purple); font-weight: 800; }
.wp-modcard b { font-size: 1.05rem; color: #fff; }
.wp-modcard span { font-size: .8rem; line-height: 1.5; color: var(--wp-dim); }

.wp-home-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: .8rem; }
.wp-home-card { display: grid; gap: .25rem; padding: .85rem 1rem; border-radius: var(--wp-radius-sm); border: 1px solid var(--wp-line); background: rgba(23, 19, 54, .7); text-decoration: none; transition: .2s; }
.wp-home-card:hover { border-color: var(--wp-cyan); background: rgba(44, 36, 92, .75); }
.wp-home-card__tag { justify-self: start; padding: .1rem .5rem; border-radius: 999px; font-size: .68rem; font-weight: 800; color: #0b0b1f; background: var(--wp-purple); }
.wp-home-card__tag.is-diamond { background: var(--wp-gold); }
.wp-home-card b { color: #fff; font-size: .92rem; }
.wp-home-card b em { font-style: normal; color: var(--wp-cyan); }
.wp-home-card__champ { font-size: .8rem; color: var(--wp-dim); }
.wp-subgroup-title { margin: 0 0 .5rem; font-size: .92rem; color: var(--wp-text); }

/* 截图录入页 */
.wp-upload-grid { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); gap: 1.2rem; align-items: start; }
.wp-shot-stage { position: relative; border-radius: var(--wp-radius); border: 1px solid var(--wp-line); background: #0d0b22; overflow: hidden; margin-top: .8rem; }
.wp-shot-stage img { display: block; width: 100%; height: auto; }
.wp-shot-box { position: absolute; border: 1px solid rgba(95, 216, 255, .5); background: rgba(95, 216, 255, .12); border-radius: 3px; cursor: pointer; transition: .15s; }
.wp-shot-box:hover { background: rgba(95, 216, 255, .3); }
.wp-shot-box.is-on { border-color: var(--wp-pink); background: rgba(255, 111, 216, .28); }
.wp-ocr-lines { display: grid; gap: .35rem; max-height: 24rem; overflow: auto; }
.wp-ocr-line { display: flex; gap: .5rem; align-items: center; padding: .35rem .55rem; border-radius: .45rem; border: 1px solid var(--wp-line); background: rgba(23, 19, 54, .6); font-size: .82rem; }
.wp-ocr-text { color: var(--wp-text); word-break: break-all; flex: 1 1 auto; }
.wp-ocr-line .wp-btn { flex: 0 0 auto; }
.wp-dropzone { display: grid; place-items: center; gap: .4rem; padding: 1.7rem 1rem; border: 1.5px dashed var(--wp-line-strong); border-radius: var(--wp-radius); background: rgba(23, 19, 54, .5); text-align: center; cursor: pointer; transition: .2s; }
.wp-dropzone:hover, .wp-dropzone.is-over { border-color: var(--wp-cyan); background: rgba(95, 216, 255, .1); }
.wp-dropzone b { color: #fff; }
.wp-dropzone small { color: var(--wp-dim-2); font-size: .76rem; }
.wp-up-row { display: grid; grid-template-columns: 4.2rem minmax(0, 1fr) minmax(0, 1.1fr) auto; gap: .5rem; align-items: end; padding: .5rem 0; border-bottom: 1px dashed var(--wp-line); }
.wp-up-row .wp-field { margin: 0; }
.wp-up-row .wp-field > span { font-size: .68rem; }
.wp-up-row.is-diamond { grid-template-columns: 4.2rem minmax(0, 1fr) minmax(0, 1fr) 6rem 6rem; }
@media (max-width: 980px) {
  .wp-upload-grid { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .wp-up-row, .wp-up-row.is-diamond { grid-template-columns: 3.6rem minmax(0, 1fr); }
  .wp-up-row .wp-field { grid-column: 1 / -1; }
}
