/* ============================================================
 * 帕克球赛事管理端 · 后台样式
 * 桌面优先，窄屏可折叠为顶部导航
 * ============================================================ */

:root {
  --green: #16a34a;
  --green-d: #15803d;
  --green-l: #e8f6ec;
  --green-line: #c9e8d4;
  --ink: #10241a;
  --ink-2: #33503f;
  --muted: #7b8f84;
  --muted-2: #9aaba1;
  --bg: #f2f6f2;
  --card: #ffffff;
  --line: #e4ece5;
  --gold: #f59e0b;
  --gold-l: #fef6e7;
  --blue: #0ea5e9;
  --blue-l: #e8f5fd;
  --red: #e5484d;
  --red-l: #fdecec;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(16, 36, 26, 0.05), 0 10px 30px -18px rgba(16, 36, 26, 0.3);
  --side-w: 236px;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--ink);
  font-family:
    -apple-system, BlinkMacSystemFont, 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei',
    'Helvetica Neue', Arial, sans-serif;
  font-size: 14px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

button,
input,
select,
textarea {
  font-family: inherit;
  font-size: inherit;
  color: inherit;
}
button {
  border: 0;
  background: none;
  cursor: pointer;
}
a {
  color: var(--green-d);
  text-decoration: none;
}
h1,
h2,
h3,
h4 {
  margin: 0;
  font-weight: 700;
  letter-spacing: -0.3px;
}
table {
  border-collapse: collapse;
}
ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

/* ---------------- 骨架 ---------------- */
.shell {
  display: flex;
  min-height: 100vh;
}

.side {
  position: fixed;
  inset: 0 auto 0 0;
  width: var(--side-w);
  z-index: 40;
  background: linear-gradient(180deg, #0b6b34, #063d1f 72%, #052a15);
  color: #fff;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.side::after {
  content: '';
  position: absolute;
  left: -90px;
  bottom: -120px;
  width: 320px;
  height: 320px;
  border-radius: 50%;
  background: radial-gradient(circle at 40% 40%, rgba(127, 214, 157, 0.22), transparent 66%);
  pointer-events: none;
}
.side .brand {
  padding: 22px 20px 18px;
  display: flex;
  align-items: center;
  gap: 11px;
  position: relative;
  z-index: 1;
}
.side .logo {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  flex: 0 0 38px;
  background: rgba(255, 255, 255, 0.14);
  border: 1px solid rgba(255, 255, 255, 0.18);
  display: grid;
  place-items: center;
  font-size: 19px;
}
.side .brand b {
  display: block;
  font-size: 15px;
  letter-spacing: -0.2px;
}
.side .brand span {
  display: block;
  font-size: 11px;
  opacity: 0.66;
  letter-spacing: 1.4px;
  text-transform: uppercase;
}

.nav {
  padding: 6px 12px 12px;
  position: relative;
  z-index: 1;
  flex: 1;
  overflow-y: auto;
}
.nav .grp {
  font-size: 10.5px;
  letter-spacing: 1.6px;
  text-transform: uppercase;
  opacity: 0.5;
  font-weight: 800;
  padding: 16px 10px 8px;
}
.nav a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 11px;
  border-radius: 10px;
  color: rgba(255, 255, 255, 0.82);
  font-size: 13.5px;
  font-weight: 600;
  margin-bottom: 2px;
  transition:
    background 0.16s,
    color 0.16s;
}
.nav a:hover {
  background: rgba(255, 255, 255, 0.09);
  color: #fff;
}
.nav a.on {
  background: rgba(255, 255, 255, 0.16);
  color: #fff;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.1);
}
.nav a .i {
  width: 20px;
  text-align: center;
  font-size: 15px;
  opacity: 0.92;
}
.nav a .tagnum {
  margin-left: auto;
  font-size: 11px;
  font-weight: 700;
  opacity: 0.7;
  background: rgba(255, 255, 255, 0.12);
  padding: 1px 7px;
  border-radius: 999px;
}
.side .foot {
  padding: 14px 20px 18px;
  font-size: 11.5px;
  opacity: 0.5;
  position: relative;
  z-index: 1;
}

.main {
  flex: 1;
  margin-left: var(--side-w);
  min-width: 0;
}

/* ---------------- 顶栏 ---------------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  background: rgba(242, 246, 242, 0.84);
  backdrop-filter: saturate(180%) blur(14px);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid var(--line);
  padding: 14px 26px;
  display: flex;
  align-items: center;
  gap: 14px;
}
.topbar .ttl {
  font-size: 19px;
  font-weight: 800;
  letter-spacing: -0.5px;
}
.topbar .sub {
  font-size: 12.5px;
  color: var(--muted);
  margin-top: 1px;
}
.topbar .spacer {
  flex: 1;
}
.topbar .srv {
  font-size: 12px;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 6px;
  background: #fff;
  border: 1px solid var(--line);
  padding: 5px 11px;
  border-radius: 999px;
}
.topbar .srv i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--green);
  display: block;
}
.topbar .srv.off i {
  background: #c3cec6;
}
.burger {
  display: none;
  font-size: 20px;
  padding: 4px 8px;
  border-radius: 9px;
}

.wrap {
  padding: 22px 26px 60px;
  max-width: 1320px;
}

/* ---------------- 通用块 ---------------- */
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 18px 20px;
}
.card + .card {
  margin-top: 16px;
}
.card > .hd {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: -2px 0 14px;
}
.card > .hd h3 {
  font-size: 15px;
}
.card > .hd .spacer {
  flex: 1;
}
.card > .hd .note {
  font-size: 12.5px;
  color: var(--muted);
}

.grid {
  display: grid;
  gap: 16px;
}
.g4 {
  grid-template-columns: repeat(4, 1fr);
}
.g3 {
  grid-template-columns: repeat(3, 1fr);
}
.g2 {
  grid-template-columns: repeat(2, 1fr);
}

.stat {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px 18px;
  box-shadow: var(--shadow);
  position: relative;
  overflow: hidden;
}
.stat .lb {
  font-size: 12.5px;
  color: var(--muted);
  font-weight: 600;
}
.stat .v {
  font-size: 30px;
  font-weight: 800;
  letter-spacing: -1px;
  margin-top: 4px;
  line-height: 1.1;
}
.stat .hint {
  font-size: 12px;
  color: var(--muted);
  margin-top: 3px;
}
.stat .ico {
  position: absolute;
  right: 14px;
  top: 14px;
  width: 36px;
  height: 36px;
  border-radius: 11px;
  display: grid;
  place-items: center;
  font-size: 17px;
  background: var(--green-l);
}

/* ---------------- 按钮 ---------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 36px;
  padding: 0 14px;
  border-radius: 10px;
  font-size: 13.5px;
  font-weight: 700;
  background: #fff;
  border: 1px solid var(--line);
  color: var(--ink-2);
  transition: 0.15s;
}
.btn:hover {
  background: #fafcf9;
  border-color: #d5e2d7;
}
.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}
.btn-primary {
  background: var(--green);
  border-color: var(--green);
  color: #fff;
}
.btn-primary:hover {
  background: var(--green-d);
  border-color: var(--green-d);
}
.btn-danger {
  background: var(--red-l);
  border-color: #f6cfd0;
  color: var(--red);
}
.btn-danger:hover {
  background: #fbdedf;
}
.btn-ghost {
  background: transparent;
  border-color: transparent;
  color: var(--muted);
}
.btn-ghost:hover {
  background: #eff4ef;
  color: var(--ink-2);
}
.btn-sm {
  height: 30px;
  padding: 0 10px;
  font-size: 12.5px;
  border-radius: 8px;
}
.btn-xs {
  height: 26px;
  padding: 0 8px;
  font-size: 12px;
  border-radius: 7px;
  font-weight: 600;
}
.btn-block {
  width: 100%;
}

.seg {
  display: inline-flex;
  background: #eef3ee;
  border-radius: 10px;
  padding: 3px;
  gap: 2px;
}
.seg button {
  height: 30px;
  padding: 0 13px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 700;
  color: var(--muted);
}
.seg button.on {
  background: #fff;
  color: var(--ink);
  box-shadow: 0 1px 3px rgba(16, 36, 26, 0.12);
}

/* ---------------- 表单 ---------------- */
.field {
  margin-bottom: 14px;
}
.field > label {
  display: block;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--ink-2);
  margin-bottom: 6px;
}
.field .tip {
  font-size: 12px;
  color: var(--muted);
  margin-top: 5px;
}
.input,
.select,
.textarea {
  width: 100%;
  height: 38px;
  padding: 0 12px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: #fff;
  outline: none;
  transition: 0.15s;
  font-size: 13.5px;
}
.textarea {
  height: auto;
  min-height: 92px;
  padding: 10px 12px;
  line-height: 1.6;
  resize: vertical;
}
.input:focus,
.select:focus,
.textarea:focus {
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(22, 163, 74, 0.12);
}
select.select {
  appearance: none;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'><path d='M3 4.5L6 8l3-3.5' fill='none' stroke='%237b8f84' stroke-width='1.4' stroke-linecap='round'/></svg>");
  background-repeat: no-repeat;
  background-position: right 11px center;
  padding-right: 30px;
}
.row2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.row3 {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 12px;
}
.inline {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}
.inline .input,
.inline .select {
  width: auto;
}

/* ---------------- 表格 ---------------- */
.tblwrap {
  overflow-x: auto;
  margin: 0 -20px -18px;
  padding: 0 20px 18px;
}
.tbl {
  width: 100%;
  font-size: 13px;
  white-space: nowrap;
}
.tbl th {
  text-align: left;
  font-size: 11.5px;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 800;
  padding: 0 12px 9px;
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  background: #fff;
  z-index: 2;
}
.tbl td {
  padding: 11px 12px;
  border-bottom: 1px solid #f0f4f0;
  vertical-align: middle;
}
.tbl tbody tr:hover {
  background: #fafdfb;
}
.tbl tbody tr:last-child td {
  border-bottom: 0;
}
.tbl .nm {
  font-weight: 700;
  white-space: nowrap;
}
.tbl .num {
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.tbl .ctr {
  text-align: center;
}
/* 多轮赛事：每一轮的第一个洞画一条分隔线，横向滑动时好辨认 */
.tbl .rsep {
  box-shadow: inset 2px 0 0 var(--line);
}
.tbl tr.rsub td {
  background: #f6f9f6;
  font-size: 11.5px;
  font-weight: 800;
  letter-spacing: 0.4px;
  color: var(--muted);
  padding: 6px 12px;
  text-align: left;
}
.tbl td.acts {
  text-align: right;
  white-space: nowrap;
}
.tbl .mini-input {
  width: 44px;
  height: 28px;
  text-align: center;
  border: 1px solid transparent;
  border-radius: 7px;
  background: #f6f9f6;
  font-size: 13px;
  font-variant-numeric: tabular-nums;
  padding: 0 2px;
  outline: none;
}
.tbl .mini-input:hover {
  border-color: var(--line);
}
.tbl .mini-input:focus {
  border-color: var(--green);
  background: #fff;
  box-shadow: 0 0 0 2px rgba(22, 163, 74, 0.12);
}
.tbl .mini-input.bird {
  background: var(--green-l);
  color: var(--green-d);
  font-weight: 700;
}
.tbl .mini-input.bogey {
  background: var(--red-l);
  color: var(--red);
  font-weight: 700;
}
.tbl tr.active {
  background: var(--green-soft);
}

.empty {
  padding: 46px 20px;
  text-align: center;
  color: var(--muted);
}
.empty .ico {
  font-size: 30px;
  opacity: 0.5;
  margin-bottom: 8px;
}
.empty b {
  display: block;
  color: var(--ink-2);
  font-size: 14.5px;
  margin-bottom: 4px;
}

/* ---------------- 徽标 ---------------- */
.chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 22px;
  padding: 0 9px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 700;
  background: #f0f4f0;
  color: var(--muted);
}
.chip.g {
  background: var(--green-l);
  color: var(--green-d);
}
.chip.y {
  background: var(--gold-l);
  color: #a56700;
}
.chip.b {
  background: var(--blue-l);
  color: #0369a1;
}
.chip.r {
  background: var(--red-l);
  color: var(--red);
}
.dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  display: inline-block;
  margin-right: 5px;
}
.dot.live {
  background: var(--green);
  box-shadow: 0 0 0 3px rgba(22, 163, 74, 0.16);
}
.dot.upcoming {
  background: var(--gold);
}
.dot.finished {
  background: #b6c3ba;
}

/* ---------------- 模态 / 抽屉 ---------------- */
.mask {
  position: fixed;
  inset: 0;
  background: rgba(9, 24, 16, 0.42);
  z-index: 60;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 40px 16px;
  overflow-y: auto;
  animation: fade 0.18s ease both;
  backdrop-filter: blur(2px);
}
@keyframes fade {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}
.dialog {
  background: #fff;
  border-radius: 18px;
  box-shadow: 0 30px 70px -20px rgba(9, 24, 16, 0.5);
  width: 560px;
  max-width: 100%;
  animation: pop 0.22s cubic-bezier(0.2, 0.9, 0.3, 1.2) both;
  overflow: hidden;
}
.dialog.wide {
  width: 860px;
}
@keyframes pop {
  from {
    opacity: 0;
    transform: translateY(-14px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: none;
  }
}
.dialog .dh {
  padding: 16px 20px;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  gap: 10px;
}
.dialog .dh h3 {
  font-size: 15.5px;
}
.dialog .dh .x {
  margin-left: auto;
  font-size: 20px;
  color: var(--muted);
  line-height: 1;
  padding: 2px 6px;
  border-radius: 8px;
}
.dialog .dh .x:hover {
  background: #f0f4f0;
}
.dialog .db {
  padding: 18px 20px;
  max-height: calc(100vh - 220px);
  overflow-y: auto;
}
.dialog .df {
  padding: 14px 20px;
  border-top: 1px solid var(--line);
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  background: #fbfdfb;
}

/* ---------------- Toast ---------------- */
.toasts {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 90;
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: flex-end;
}
.toast {
  background: #10241a;
  color: #fff;
  padding: 11px 16px;
  border-radius: 12px;
  font-size: 13.5px;
  font-weight: 600;
  box-shadow: 0 18px 40px -18px rgba(9, 24, 16, 0.7);
  animation: tin 0.22s ease both;
  max-width: 380px;
}
.toast.ok {
  background: var(--green-d);
}
.toast.err {
  background: #b42318;
}
.toast.warn {
  background: #a56700;
}
@keyframes tin {
  from {
    opacity: 0;
    transform: translateX(16px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

/* ---------------- 页面零件 ---------------- */
.crumbs {
  font-size: 12.5px;
  color: var(--muted);
  margin-bottom: 3px;
}
.crumbs a {
  color: var(--muted);
}
.crumbs a:hover {
  color: var(--green-d);
}
.crumbs span {
  margin: 0 6px;
  opacity: 0.6;
}

.toolbar {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 16px;
}
.toolbar .grow {
  flex: 1;
  min-width: 180px;
}
.search {
  position: relative;
  flex: 1;
  max-width: 320px;
}
.search .input {
  padding-left: 34px;
}
.search::before {
  content: '⌕';
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-52%);
  font-size: 16px;
  color: var(--muted);
  pointer-events: none;
}

.kv {
  display: grid;
  grid-template-columns: 96px 1fr;
  gap: 8px 14px;
  font-size: 13.5px;
}
.kv dt {
  color: var(--muted);
  font-weight: 600;
}
.kv dd {
  margin: 0;
}

.plist {
  max-height: 320px;
  overflow-y: auto;
  margin: -4px -6px;
  padding: 4px 6px;
}
.prow {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid var(--line);
  margin-bottom: 8px;
  background: #fff;
}
.prow:hover {
  border-color: var(--green-line);
  background: #fbfdfb;
}
.prow .av {
  width: 30px;
  height: 30px;
  border-radius: 9px;
  background: var(--green-l);
  color: var(--green-d);
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 12.5px;
  flex: 0 0 30px;
}
.prow .np {
  flex: 1;
  min-width: 0;
}
.prow .np b {
  display: block;
  font-size: 13.5px;
}
.prow .np span {
  font-size: 12px;
  color: var(--muted);
}
.prow.picked {
  border-color: var(--green);
  background: var(--green-soft);
}

.gcard {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  display: flex;
  flex-direction: column;
  min-height: 168px;
}
.gcard > .ghd {
  padding: 11px 13px;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  gap: 8px;
  background: #fbfdfb;
  border-radius: 12px 12px 0 0;
}
.gcard > .ghd b {
  font-size: 14px;
}
.gcard > .ghd .grow {
  flex: 1;
}
.gcard > .ghd .minput {
  width: 62px;
  height: 26px;
  border: 1px solid var(--line);
  border-radius: 7px;
  text-align: center;
  font-size: 12.5px;
  background: #fff;
  padding: 0 4px;
  outline: none;
}
.gcard > .ghd .minput:focus {
  border-color: var(--green);
}

/* 时间输入要同时容下「08:00」和原生取时按钮，62px 会把秒位数字挤掉，单独放宽 */
.gcard > .ghd .minput[type='time'] {
  width: 104px;
  height: 28px;
  padding: 0 2px 0 8px;
  text-align: left;
  font-variant-numeric: tabular-nums;
}
.gcard > .ghd .minput[type='time']::-webkit-datetime-edit {
  padding: 0;
}
.gcard > .ghd .minput[type='time']::-webkit-calendar-picker-indicator {
  margin: 0;
  padding: 0 2px;
  opacity: 0.45;
  cursor: pointer;
}
.gcard > .ghd .minput[type='time']::-webkit-calendar-picker-indicator:hover {
  opacity: 0.8;
}
.gcard > .ghd .minput[type='number'] {
  height: 28px;
  width: 50px;
}
.gcard > .gbd {
  padding: 10px;
  flex: 1;
  max-height: 220px;
  overflow-y: auto;
}
.gcard > .gft {
  padding: 8px 10px;
  border-top: 1px solid var(--line);
  font-size: 12px;
  color: var(--muted);
  display: flex;
  gap: 6px;
}

.mini-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  border-radius: 8px;
  font-size: 13px;
}
.mini-row:hover {
  background: #f6f9f6;
}
.mini-row .grow {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}
.mini-row .moves {
  display: flex;
  gap: 3px;
  opacity: 0;
  transition: 0.15s;
}
.mini-row:hover .moves {
  opacity: 1;
}
.mini-row .moves button {
  width: 22px;
  height: 22px;
  border-radius: 6px;
  background: #f0f4f0;
  font-size: 11px;
  color: var(--muted);
  display: grid;
  place-items: center;
}
.mini-row .moves button:hover {
  background: var(--green-l);
  color: var(--green-d);
}

/* 逐洞编辑器：每个「洞行」与表头共用同一套列模板（34px + 3 等分），
   因此表头与输入框必然对齐；洞数 > 9 时排成左右两列，每列各自带表头。 */
.holes-editor {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px 20px;
  align-items: start;
}
.holes-editor[data-cols='1'] {
  grid-template-columns: minmax(0, 1fr);
}
.holes-editor[data-cols='1'] .hole-col {
  max-width: 560px;
}
.hole-col {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
}
.hole-head {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1fr);
  gap: 8px;
  padding: 0 10px;
  font-size: 11px;
  color: var(--muted);
  text-align: center;
  letter-spacing: 0.2px;
}
.hole-head i {
  display: block;
}
.hole-cell {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1fr);
  gap: 8px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 7px 9px;
  background: #fff;
}
.hole-cell .hn {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: var(--green-l);
  color: var(--green-d);
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 12.5px;
}
.hole-cell input {
  width: 100%;
  min-width: 0;
  height: 30px;
  border: 1px solid var(--line);
  border-radius: 8px;
  text-align: center;
  font-size: 13px;
  outline: none;
  padding: 0 4px;
}
.hole-cell input:focus {
  border-color: var(--green);
}
.hole-cell .lbl {
  font-size: 10.5px;
  color: var(--muted);
  text-align: center;
  margin-top: -4px;
}

.bar-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px dashed #eef3ee;
}
.bar-row:last-child {
  border-bottom: 0;
}
.bar-row .bk {
  width: 74px;
  font-size: 12.5px;
  color: var(--ink-2);
  font-weight: 600;
  flex: 0 0 74px;
}
.bar-row .btrack {
  flex: 1;
  height: 10px;
  border-radius: 999px;
  background: #eef3ee;
  overflow: hidden;
}
.bar-row .bfill {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--green), #4ade80);
}
.bar-row .bv {
  width: 60px;
  text-align: right;
  font-size: 12.5px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.bar-row .bv.neg .bfill {
  background: linear-gradient(90deg, var(--red), #f98e92);
}

.dblist {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}
.dbitem {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px 14px;
  background: #fff;
}
.dbitem .k {
  font-size: 11.5px;
  color: var(--muted);
  font-weight: 700;
}
.dbitem .v {
  font-size: 21px;
  font-weight: 800;
  letter-spacing: -0.5px;
  margin-top: 2px;
}
.dbitem .s {
  font-size: 12px;
  color: var(--muted);
}

.linkbox {
  display: flex;
  gap: 8px;
  align-items: center;
  background: #f6f9f6;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 9px 12px;
  font-size: 12.5px;
  color: var(--ink-2);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  word-break: break-all;
}

.tabs-inline {
  display: flex;
  gap: 4px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 16px;
}
.tabs-inline button {
  padding: 8px 14px;
  font-size: 13.5px;
  font-weight: 700;
  color: var(--muted);
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
}
.tabs-inline button.on {
  color: var(--green-d);
  border-bottom-color: var(--green);
}

/* ---------------- 批量选择 / 操作日志 ---------------- */
.selbar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  background: var(--green-l);
  border: 1px solid var(--green-line);
  border-radius: 12px;
  padding: 10px 14px;
  margin-bottom: 14px;
  font-size: 13.5px;
}
.selbar .ico {
  font-size: 15px;
}
.selbar b {
  font-size: 15px;
  color: var(--green-d);
}
.tbl tr.row-on {
  background: #f6fbf7;
}
.tbl .js-rsel,
.tbl .js-rall {
  width: 15px;
  height: 15px;
  accent-color: var(--green);
  cursor: pointer;
}

.pager {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  padding: 12px 2px 2px;
}
.pager .btn[disabled] {
  opacity: 0.45;
  cursor: not-allowed;
}
.pgap {
  color: var(--muted);
  padding: 0 2px;
}

.jsonbox {
  margin: 0 0 8px;
  max-height: 260px;
  overflow: auto;
  background: #f6f9f6;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 12px;
  line-height: 1.6;
  white-space: pre-wrap;
  word-break: break-all;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  color: var(--ink-2);
}

/* ---------------- 响应式 ---------------- */
@media (max-width: 1080px) {
  .g4 {
    grid-template-columns: repeat(2, 1fr);
  }
  .dblist {
    grid-template-columns: repeat(2, 1fr);
  }
  .holes-editor,
  .holes-editor[data-cols='2'] {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 860px) {
  .side {
    transform: translateX(-100%);
    transition: transform 0.24s ease;
  }
  .side.open {
    transform: none;
    box-shadow: 0 0 0 100vw rgba(9, 24, 16, 0.4);
  }
  .main {
    margin-left: 0;
  }
  .burger {
    display: block;
  }
  .wrap {
    padding: 18px 16px 50px;
  }
  .topbar {
    padding: 12px 16px;
  }
  .g3,
  .g2 {
    grid-template-columns: 1fr;
  }
  .row2,
  .row3 {
    grid-template-columns: 1fr;
  }
  .toasts {
    right: 12px;
    left: 12px;
    align-items: stretch;
  }
}

/* ---------------- 多天赛程：轮次条 ---------------- */
.rdbar {
  padding: 12px 16px;
  margin-bottom: 16px;
}
.rdbar .hd {
  margin-bottom: 8px;
}
.rdchips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.rdchip {
  display: inline-flex;
  flex-direction: column;
  gap: 2px;
  cursor: pointer;
  padding: 7px 14px;
  border: 1.5px solid var(--line);
  border-radius: 10px;
  background: #fff;
  color: var(--ink-2);
  transition: all 0.16s ease;
}
.rdchip b {
  font-size: 13.5px;
  font-weight: 700;
}
.rdchip > span {
  font-size: 11.5px;
  color: var(--muted);
}
.rdchip > span.warn {
  color: #a56700;
}
.rdchip:hover {
  border-color: var(--green);
  background: var(--green-l);
}
.rdchip.on {
  border-color: var(--green);
  background: var(--green-l);
  color: var(--green-d);
  box-shadow: 0 0 0 3px rgba(16, 122, 62, 0.1);
}
.rdchip.on > span {
  color: var(--green-d);
  opacity: 0.8;
}

/* 按上一轮成绩编组：强调色按钮 */
.btn-score {
  background: var(--gold-l);
  border-color: #f0dfb4;
  color: #8a5a00;
  font-weight: 600;
}
.btn-score:hover {
  background: #f6e6bc;
  border-color: #e6cf95;
}

/* 晋级预览列表 */
.prevlist {
  max-height: 320px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 10px;
}
.prev-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border-bottom: 1px solid var(--line);
  font-size: 13px;
}
.prev-row:last-child {
  border-bottom: 0;
}
.prev-row .rk {
  width: 26px;
  text-align: center;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.prev-row .no {
  font-size: 12px;
  color: var(--muted);
  width: 34px;
}
.prev-row .nm {
  flex: 1;
  font-weight: 600;
}
.prev-row .sc {
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.prev-row .qf {
  width: 62px;
  text-align: right;
}
.prev-row.out {
  opacity: 0.5;
  background: #fafbfa;
}

/* ---------------- 分洞同时出发：可出发洞口选择 ---------------- */
.holepick {
  margin-top: 12px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fbfcfb;
}
.holepick .hp-hd {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}
.holepick .hp-hd b {
  font-size: 13.5px;
}
.holepick .hp-hd .tip {
  margin: 0;
}
.holepick .hp-hd .grow {
  flex: 1;
}
.hp-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.hchip {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 1px;
  min-width: 58px;
  padding: 6px 8px;
  cursor: pointer;
  font: inherit;
  border: 1.5px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink-2);
  transition: all 0.14s ease;
}
.hchip > span {
  font-size: 11px;
  color: var(--muted);
}
.hchip:hover {
  border-color: var(--green);
  background: var(--green-l);
}
.hchip.on {
  border-color: var(--green);
  background: var(--green-l);
  color: var(--green-d);
  font-weight: 600;
  box-shadow: 0 0 0 2px rgba(16, 122, 62, 0.1);
}
.hchip.on > span {
  color: var(--green-d);
  opacity: 0.8;
}
.hp-sum {
  margin-top: 10px;
  font-size: 12.5px;
  color: var(--muted);
  line-height: 1.6;
}
.hp-sum .warn {
  color: var(--red);
  font-weight: 600;
}

/* ---------------- 赛事状态：列表列快速切换 ---------------- */
.sts {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}
.sts-sel {
  height: 26px;
  padding: 0 22px 0 8px;
  font: inherit;
  font-size: 12.5px;
  color: var(--ink-2);
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  appearance: none;
  -webkit-appearance: none;
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M1 1l4 4 4-4' fill='none' stroke='%237b8f84' stroke-width='1.5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 7px center;
}
.sts-sel:hover {
  border-color: var(--green);
  color: var(--green-d);
}
.sts-sel.manual {
  border-color: var(--gold);
  background-color: var(--gold-l);
  color: #8a5a00;
  font-weight: 600;
}
.sts-lock {
  font-size: 11px;
  cursor: help;
}
.stbtns {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 6px;
  margin-bottom: 4px;
}

/* ---------------- 国籍 / 地区 可搜索下拉 ----------------
   250 个地区，列表在弹窗正文内滚动（.dialog .db 本身可滚），
   选中态用绿色系，与管理端其他选中反馈一致。 */
.natpick {
  position: relative;
}
/* 高度与上下方向由 JS 按弹窗可视区算（见 UI.bindCountryPick），避免被滚动容器裁切 */
.natpick-list {
  position: absolute;
  /* 国籍字段常是半宽，列表不能跟着半宽——否则「圣文森特和格林纳丁斯」要折行。
     右对齐展开，既够宽又不会把弹窗右边撑破。 */
  right: 0;
  left: auto;
  min-width: 100%;
  width: max-content;
  max-width: 360px;
  z-index: 30;
  max-height: 300px;
  overflow-y: auto;
  padding: 4px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: 0 10px 26px -14px rgba(16, 36, 26, 0.45);
}
.natpick-g {
  position: sticky;
  top: -4px;
  padding: 6px 8px 4px;
  font-size: 11.5px;
  color: var(--muted);
  background: var(--card);
  letter-spacing: 0;
}
.natpick-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: 38px;
  padding: 8px 10px;
  border-radius: 8px;
  font-size: 13px;
  color: var(--ink);
  cursor: pointer;
}
.natpick-item:hover {
  background: var(--bg);
}
.natpick-item.on {
  background: var(--green-l);
  color: var(--green-d);
}
.natpick-cur {
  flex: none;
  font-style: normal;
  font-size: 11px;
  color: var(--muted-2);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 1px 6px;
  letter-spacing: 0;
}
.natpick-item.on .natpick-cur {
  color: var(--green-d);
  border-color: var(--green-line);
}
.natpick-empty {
  padding: 14px 10px;
  font-size: 12.5px;
  color: var(--muted);
  text-align: center;
}
