:root {
  --primary: #744acb;
  --primary-rgb: 116, 74, 203;
  --primary-deep: #5b32ae;
  --primary-soft: rgba(var(--primary-rgb), 0.12);
  --primary-faint: rgba(var(--primary-rgb), 0.06);
  --success: #3aa675;
  --success-soft: rgba(58, 166, 117, 0.12);
  --warning: #f5a524;
  --warning-soft: rgba(245, 165, 36, 0.14);
  --danger: #ef5b5b;
  --danger-soft: rgba(239, 91, 91, 0.11);
  --cyan: #23a9f2;
  --cyan-soft: rgba(35, 169, 242, 0.11);
  --bg: #f6f7fb;
  --panel: #ffffff;
  --panel-2: #fbfbfe;
  --text: #232a3c;
  --text-2: #525b70;
  --muted: #8a93a7;
  --line: #e9ebf2;
  --line-strong: #dde0ea;
  --sidebar: #ffffff;
  --topbar: rgba(255, 255, 255, 0.78);
  --shadow-sm: 0 1px 2px rgba(31, 35, 53, 0.05);
  --shadow-md: 0 10px 28px rgba(45, 37, 75, 0.08);
  --radius: 8px;
  --sidebar-width: 238px;
  color-scheme: light;
}

body.theme-dark {
  --primary-soft: rgba(var(--primary-rgb), 0.22);
  --primary-faint: rgba(var(--primary-rgb), 0.1);
  --success-soft: rgba(68, 190, 135, 0.16);
  --warning-soft: rgba(244, 176, 54, 0.15);
  --danger-soft: rgba(245, 108, 108, 0.14);
  --cyan-soft: rgba(55, 185, 244, 0.15);
  --bg: #151821;
  --panel: #1e222d;
  --panel-2: #232836;
  --text: #eef0f6;
  --text-2: #b7bdd0;
  --muted: #858ea5;
  --line: #2c3344;
  --line-strong: #384055;
  --sidebar: #1b1f2a;
  --topbar: rgba(27, 31, 42, 0.78);
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.22);
  --shadow-md: 0 12px 30px rgba(0, 0, 0, 0.25);
  color-scheme: dark;
}

* { box-sizing: border-box; }

html, body { height: 100%; }

body {
  margin: 0;
  font-family: MiSans, "HarmonyOS Sans SC", "Source Han Sans SC", "PingFang SC", "Microsoft YaHei", system-ui, -apple-system, sans-serif;
  font-size: 14px;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

body:has(.modal-root[data-open="true"]) { overflow: hidden; }

button, input {
  font: inherit;
}

button {
  border: 0;
  cursor: pointer;
}

a {
  color: inherit;
  text-decoration: none;
}

svg.lucide {
  width: 18px;
  height: 18px;
  stroke-width: 1.9;
}

[hidden] {
  display: none !important;
}

.view { display: none; }
.view.is-active { display: flex; }

.auth-view.is-active {
  display: grid;
}

.auth-view {
  min-height: 100vh;
  min-height: 100dvh;
  grid-template-columns: minmax(500px, 58%) minmax(420px, 42%);
  animation: viewIn 0.38s ease both;
}

.auth-art {
  position: relative;
  display: flex;
  flex-direction: column;
  padding: 30px 44px 42px;
  overflow: hidden;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.24), rgba(255, 255, 255, 0) 34%),
    linear-gradient(145deg, #f5f0fc 0%, #eee4fb 58%, #f6f2fd 100%);
  isolation: isolate;
}

.auth-art::before {
  content: "";
  position: absolute;
  width: 320px;
  height: 320px;
  left: -120px;
  top: 34%;
  border: 1px solid rgba(116, 74, 203, 0.2);
  transform: rotate(22deg);
  z-index: -1;
}

.auth-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  position: relative;
  z-index: 2;
}

.brand-mark {
  width: 42px;
  height: 42px;
  object-fit: contain;
  filter: drop-shadow(0 8px 16px rgba(91, 50, 174, 0.18));
}

.brand-name {
  font-size: 20px;
  font-weight: 700;
  color: #373250;
}

.auth-art-inner {
  flex: 1;
  min-height: 300px;
  display: grid;
  place-items: center;
  position: relative;
}

.showcase-window {
  width: min(680px, 92%);
  max-height: 76%;
  background: #fff;
  border: 1px solid rgba(97, 72, 163, 0.15);
  border-radius: 12px;
  box-shadow: 0 28px 70px rgba(75, 45, 135, 0.18), 0 4px 14px rgba(75, 45, 135, 0.06);
  overflow: hidden;
  transform: rotate(-1.2deg);
  animation: windowIn 0.7s 0.06s ease both;
}

.showcase-topbar {
  display: flex;
  align-items: center;
  gap: 12px;
  height: 38px;
  padding: 0 13px;
  border-bottom: 1px solid #efeaf8;
  background: #fbf9ff;
  color: #8179a1;
  font-size: 11px;
}

.showcase-dots {
  display: flex;
  gap: 5px;
}

.showcase-dots i {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #efb0b0;
}

.showcase-dots i:nth-child(2) { background: #e9cf93; }
.showcase-dots i:nth-child(3) { background: #a7d6bd; }

.showcase-badge {
  margin-left: auto;
  color: #744acb;
  font-weight: 700;
  letter-spacing: 0.06em;
}

.showcase-body {
  display: grid;
  grid-template-columns: 78px 1fr;
  min-height: 250px;
  background: #fff;
}

.showcase-nav {
  display: grid;
  align-content: start;
  gap: 12px;
  padding: 18px 13px;
  background: #fbf9ff;
  border-right: 1px solid #f2edfa;
}

.showcase-nav span {
  height: 7px;
  border-radius: 4px;
  background: linear-gradient(90deg, #dfd2f4, #efeaf8);
}

.showcase-nav span:first-child { background: linear-gradient(90deg, #a07de4, #d3c0f3); width: 76%; }
.showcase-nav span:nth-child(3) { width: 55%; }
.showcase-nav span:nth-child(4) { width: 74%; }
.showcase-nav span:nth-child(5) { width: 46%; }

.showcase-content {
  padding: 15px 16px 14px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.showcase-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.showcase-cards div {
  height: 36px;
  border-radius: 6px;
  background: #f8f5fe;
  border: 1px solid #eee8f8;
}

.showcase-cards div:first-child { background: #f0e8fc; }

.showcase-chart {
  height: 102px;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 10px 8px;
  border: 1px solid #f0ecf8;
  border-radius: 7px;
  background:
    linear-gradient(180deg, rgba(116, 74, 203, 0.07), rgba(116, 74, 203, 0.01)),
    #fff;
  position: relative;
  overflow: hidden;
}

.chart-track {
  position: absolute;
  inset: 12px 22px 8px;
  display: flex;
  align-items: flex-end;
  gap: 8px;
}

.chart-track i {
  flex: 1;
  min-width: 6px;
  border-radius: 4px 4px 1px 1px;
  background: linear-gradient(180deg, #a884ec, rgba(116, 74, 203, 0.35));
}

.chart-line {
  position: absolute;
  left: 12%;
  right: 5%;
  top: 48%;
  height: 1px;
  background: #d9c9f5;
}

.showcase-table {
  display: grid;
  gap: 6px;
}

.showcase-table div {
  height: 5px;
  width: 100%;
  border-radius: 4px;
  background: #f4f1f9;
}

.showcase-table div:nth-child(2) { width: 94%; background: #eae3f6; }
.showcase-table div:nth-child(3) { width: 85%; background: #eae3f6; }
.showcase-table div:nth-child(4) { width: 72%; background: #f0eaf8; }

.showcase-glow {
  position: absolute;
  right: 7%;
  top: 22%;
  width: 110px;
  height: 110px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.5);
  filter: blur(2px);
}

.auth-art-copy {
  position: relative;
  z-index: 2;
  padding-top: 12px;
}

.auth-art-copy h1 {
  margin: 0 0 10px;
  max-width: 660px;
  color: #32294a;
  font-size: clamp(24px, 2.6vw, 34px);
  line-height: 1.35;
  font-weight: 800;
}

.auth-art-copy p {
  margin: 0;
  color: #726a91;
  font-size: 15px;
}

.shape-shape {
  position: absolute;
  right: 62px;
  bottom: 96px;
  width: 18px;
  height: 18px;
  border-radius: 4px;
  border: 2px solid rgba(84, 179, 139, 0.55);
  transform: rotate(24deg);
  z-index: 1;
}

.auth-main {
  position: relative;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 72px clamp(38px, 5vw, 74px) 48px;
  background: #fff;
}

body.theme-dark .auth-main {
  background: #1c202a;
}

.auth-tools {
  position: absolute;
  top: 16px;
  right: 20px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.theme-picker {
  display: flex;
  align-items: center;
  gap: 8px;
}

.theme-picker.compact {
  position: relative;
}

.palette-swatch {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  cursor: pointer;
  border: 2px solid rgba(255, 255, 255, 0.9);
  box-shadow: 0 0 0 1px rgba(43, 37, 67, 0.09);
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.palette-swatch.active,
.palette-swatch:hover {
  transform: scale(1.18);
  box-shadow: 0 0 0 2px var(--panel), 0 0 0 3.5px var(--primary);
}

.theme-picker.compact .palette-swatch:not(.active) { display: none; }
.theme-picker.compact .palette-swatch.active { display: inline-block; cursor: default; }

.palette-btn svg { color: var(--text-2); }

.palette-menu {
  position: absolute;
  top: 42px;
  right: -10px;
  width: 92px;
  display: none;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  padding: 10px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 9px;
  box-shadow: var(--shadow-md);
  z-index: 30;
}

.theme-picker.compact.open .palette-menu {
  display: flex;
}

.palette-menu .palette-swatch:not(.active) { display: inline-block; }

.icon-btn,
.input-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: transparent;
  color: var(--text-2);
  transition: background 0.18s ease, color 0.18s ease;
}

.icon-btn:hover {
  background: var(--primary-soft);
  color: var(--primary);
}

.auth-form-wrap {
  width: min(440px, 100%);
}

.auth-form-title h3 {
  margin: 0 0 8px;
  font-size: 28px;
  font-weight: 800;
  color: var(--text);
}

.auth-form-title p {
  margin: 0 0 32px;
  color: var(--muted);
}

.form-field {
  margin-bottom: 18px;
}

.input-shell {
  position: relative;
  display: flex;
  align-items: center;
  height: 46px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: var(--panel-2);
  transition: border-color 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

.input-shell:focus-within {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-soft);
  background: var(--panel);
}

.input-shell > svg.lucide {
  flex: 0 0 auto;
  width: 18px;
  height: 18px;
  margin-left: 15px;
  color: var(--muted);
}

.input-shell input {
  flex: 1;
  min-width: 0;
  height: 100%;
  padding: 0 14px;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
  font-size: 14px;
}

.input-shell input::placeholder {
  color: #a7adbb;
}

.input-shell.has-error {
  border-color: var(--danger);
}

.input-action {
  width: 42px;
  height: 100%;
  border-radius: 0 8px 8px 0;
}

.input-action:hover {
  background: transparent;
  color: var(--primary);
}

.field-error {
  min-height: 16px;
  margin: 5px 2px 0;
  color: var(--danger);
  font-size: 12px;
  opacity: 0;
}

.field-error.show {
  opacity: 1;
}

.captcha-field {
  margin: 8px 0 4px;
}

.slider-shell {
  position: relative;
  height: 46px;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid var(--line-strong);
  background: var(--panel-2);
}

.slider-filled {
  position: absolute;
  inset: 0 auto 0 0;
  width: 0%;
  background: var(--primary-soft);
  transition: width 0.18s ease;
}

.slider-track {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}

.slider-tip {
  color: #8a93a7;
  font-size: 13px;
  user-select: none;
}

.slider-thumb {
  position: absolute;
  left: 3px;
  top: 3px;
  bottom: 3px;
  width: 46px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  background: linear-gradient(135deg, #9a70e8, var(--primary));
  border-radius: 7px;
  box-shadow: 0 4px 10px rgba(93, 50, 174, 0.24);
  cursor: grab;
  transition: left 0.18s ease, background 0.18s ease;
  z-index: 2;
  pointer-events: auto;
}

.slider-shell.dragging .slider-thumb,
.slider-thumb:active {
  cursor: grabbing;
}

.slider-shell.done .slider-thumb {
  left: calc(100% - 49px);
  background: linear-gradient(135deg, #58c59a, #2f9c70);
}

.slider-shell.done .slider-track {
  background: rgba(61, 178, 126, 0.09);
}

.slider-shell.done .slider-tip {
  color: var(--success);
  font-weight: 600;
}

.slider-shell.shake {
  animation: shake 0.34s ease;
}

.captcha-error {
  color: var(--danger);
}

.login-options {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 2px 0 24px;
}

.login-links {
  display: flex;
  align-items: center;
  gap: 14px;
}

.check-line {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  color: var(--text-2);
  user-select: none;
}

.check-line input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.custom-check {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 17px;
  height: 17px;
  border: 1px solid var(--line-strong);
  border-radius: 5px;
  background: var(--panel);
  transition: all 0.16s ease;
}

.custom-check svg {
  width: 11px;
  height: 11px;
  color: #fff;
  opacity: 0;
}

.check-line input:checked + .custom-check {
  border-color: var(--primary);
  background: var(--primary);
}

.check-line input:checked + .custom-check svg {
  opacity: 1;
}

.text-link {
  color: var(--primary);
  font-weight: 600;
}

.primary-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  width: 100%;
  height: 44px;
  border-radius: 8px;
  color: #fff;
  font-size: 15px;
  font-weight: 600;
  background: linear-gradient(135deg, #8b5ce0, var(--primary));
  box-shadow: 0 10px 22px rgba(var(--primary-rgb), 0.24);
  transition: transform 0.16s ease, box-shadow 0.16s ease, opacity 0.16s ease;
}

.primary-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 12px 26px rgba(var(--primary-rgb), 0.3);
}

.primary-btn:active {
  transform: translateY(0);
}

.auth-footnote {
  margin: 22px 0 0;
  text-align: center;
  color: #a0a6b4;
  font-size: 12px;
}

/* App */
.app-view {
  min-height: 100vh;
  min-height: 100dvh;
  background: var(--bg);
  animation: viewIn 0.3s ease both;
}

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: var(--sidebar-width);
  display: flex;
  flex-direction: column;
  background: var(--sidebar);
  border-right: 1px solid var(--line);
  z-index: 50;
  transition: transform 0.24s ease, width 0.24s ease;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 66px;
  padding: 0 18px;
  border-bottom: 1px solid var(--line);
}

.sidebar-brand .brand-mark {
  width: 36px;
  height: 36px;
}

.brand-copy {
  display: flex;
  flex-direction: column;
  line-height: 1.25;
}

.brand-copy strong {
  font-size: 15px;
}

.brand-copy span {
  margin-top: 2px;
  color: var(--muted);
  font-size: 11px;
}

.side-nav {
  flex: 1;
  overflow-y: auto;
  padding: 10px 10px 16px;
  scrollbar-width: thin;
}

.nav-group {
  margin-top: 12px;
}

.nav-group:first-child { margin-top: 4px; }

.nav-group-title {
  display: block;
  padding: 8px 12px 7px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.nav-item {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  height: 40px;
  margin: 2px 0;
  padding: 0 11px;
  border-radius: 7px;
  color: var(--text-2);
  font-weight: 500;
  cursor: pointer;
  transition: background 0.16s ease, color 0.16s ease;
}

.nav-item svg {
  flex: 0 0 auto;
  color: var(--muted);
  transition: color 0.16s ease;
}

.nav-item:hover {
  background: var(--primary-faint);
  color: var(--text);
}

.nav-item.active {
  background: var(--primary-soft);
  color: var(--primary);
  font-weight: 650;
}

.nav-item.active svg {
  color: var(--primary);
}

.nav-item.active::before {
  content: "";
  position: absolute;
  left: -10px;
  top: 8px;
  bottom: 8px;
  width: 3px;
  border-radius: 0 4px 4px 0;
  background: var(--primary);
}

.nav-parent {
  margin: 2px 0;
}

.nav-toggle {
  width: 100%;
  justify-content: flex-start;
}

.nav-toggle.parent-active {
  color: var(--primary);
  background: var(--primary-faint);
}

.nav-toggle.parent-active svg {
  color: var(--primary);
}

.nav-arrow {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-left: auto;
  transition: transform 0.18s ease;
}

.nav-arrow svg {
  width: 14px;
  height: 14px;
}

.nav-parent.expanded .nav-arrow {
  transform: rotate(180deg);
}

.nav-submenu {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  align-items: stretch;
  gap: 4px;
  margin: 3px 0 7px;
}

.nav-subitem {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  width: 100%;
  min-height: 60px;
  height: auto;
  padding: 7px 3px;
  border-radius: 7px;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.2;
  text-align: center;
  transition: background 0.16s ease, color 0.16s ease;
}

.nav-subitem > span {
  writing-mode: horizontal-tb;
  text-orientation: mixed;
  letter-spacing: 0;
  line-height: 1.2;
  white-space: nowrap;
}

.nav-subitem svg {
  width: 14px;
  height: 14px;
  flex: 0 0 auto;
}

.nav-subitem:hover {
  color: var(--text);
  background: var(--primary-faint);
}

.nav-subitem.active {
  color: var(--primary);
  background: var(--primary-soft);
  font-weight: 650;
}

.nav-subitem.active svg {
  color: var(--primary);
}

.sidebar-foot {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 64px;
  padding: 10px 14px;
  border-top: 1px solid var(--line);
}

.mini-avatar,
.top-avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 9px;
  color: #fff;
  font-weight: 700;
  background: linear-gradient(135deg, #a47cec, var(--primary));
}

.mini-user {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.mini-user strong {
  font-size: 13px;
}

.mini-user span {
  color: var(--muted);
  font-size: 11px;
}

.sidebar-foot .icon-btn {
  width: 32px;
  height: 32px;
}

.app-shell {
  min-width: 0;
  min-height: 100vh;
  min-height: 100dvh;
  margin-left: var(--sidebar-width);
  display: flex;
  flex-direction: column;
  transition: margin-left 0.24s ease;
}

body.sidebar-collapsed {
  --sidebar-width: 74px;
}

body.sidebar-collapsed .sidebar-brand {
  justify-content: center;
  padding: 0;
}

body.sidebar-collapsed .brand-copy,
body.sidebar-collapsed .nav-group-title,
body.sidebar-collapsed .nav-item span,
body.sidebar-collapsed .nav-arrow,
body.sidebar-collapsed .nav-submenu,
body.sidebar-collapsed .mini-user,
body.sidebar-collapsed .sidebar-foot .icon-btn {
  display: none;
}

body.sidebar-collapsed .nav-item {
  justify-content: center;
  padding: 0;
}

body.sidebar-collapsed .nav-item.active::before {
  left: 0;
}

body.sidebar-collapsed .sidebar-foot {
  justify-content: center;
  padding: 10px 0;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  height: 62px;
  padding: 0 22px;
  background: var(--topbar);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}

.topbar-left,
.topbar-right {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.page-crumb {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  white-space: nowrap;
}

.page-crumb svg {
  width: 14px;
  height: 14px;
}

.page-crumb strong {
  color: var(--text);
  font-weight: 700;
}

.top-avatar {
  position: relative;
  width: 36px;
  height: 36px;
}

.online-dot {
  position: absolute;
  right: -2px;
  bottom: -2px;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  border: 2px solid var(--panel);
  background: var(--success);
}

.has-dot {
  position: relative;
}

.has-dot::after {
  content: "";
  position: absolute;
  top: 7px;
  right: 8px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--danger);
  border: 2px solid var(--panel);
}

.worktabs {
  display: flex;
  align-items: center;
  gap: 4px;
  height: 42px;
  padding: 0 18px;
  overflow-x: auto;
  border-bottom: 1px solid var(--line);
  background: var(--panel);
  scrollbar-width: none;
}

.worktabs::-webkit-scrollbar { display: none; }

.work-tab {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 29px;
  padding: 0 9px;
  border-radius: 7px;
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
  cursor: pointer;
}

.work-tab.active {
  color: var(--primary);
  background: var(--primary-soft);
  font-weight: 650;
}

.work-tab button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  padding: 0;
  background: transparent;
  color: inherit;
  border-radius: 50%;
}

.work-tab button:hover {
  background: var(--primary-soft);
}

.work-tab button svg {
  width: 12px;
  height: 12px;
}

.page-container {
  flex: 1;
  width: 100%;
  padding: 22px;
  outline: 0;
}

.season-frame-panel .panel-body {
  padding: 0;
  overflow: hidden;
}

.season-sports-frame {
  display: block;
  width: 100%;
  height: calc(100vh - 208px);
  min-height: 680px;
  border: 0;
  background: #f4f6f8;
}

.pig-cow-frame-panel .season-sports-frame {
  height: calc(100vh - 282px);
  min-height: 620px;
}

.pig-cow-topbar {
  padding-bottom: 12px;
}

.pig-cow-order-toolbar {
  align-items: center;
  padding-top: 0;
}

.personal-tracker-frame {
  min-height: calc(100vh - 282px);
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #f4f6f8;
}

.personal-tracker-frame iframe {
  display: block;
  width: 100%;
  min-height: calc(100vh - 282px);
  border: 0;
  background: #f4f6f8;
}

.season-student-result {
  min-height: 42px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--bg);
  color: var(--text-2);
  line-height: 1.6;
}

.page-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.eyebrow {
  margin: 0 0 5px;
  color: var(--primary);
  font-size: 11px;
  font-weight: 750;
}

.page-title {
  margin: 0;
  font-size: 22px;
  line-height: 1.3;
  font-weight: 800;
}

.page-desc {
  margin: 5px 0 0;
  color: var(--muted);
}

.head-actions,
.action-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.plain-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  height: 36px;
  padding: 0 13px;
  border-radius: 7px;
  border: 1px solid var(--line-strong);
  background: var(--panel);
  color: var(--text-2);
  font-weight: 600;
  transition: all 0.16s ease;
}

.plain-btn:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: var(--primary-faint);
}

.plain-btn.full {
  width: 100%;
  margin-top: 8px;
}

.plain-btn svg {
  width: 16px;
  height: 16px;
}

.primary-soft-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 36px;
  padding: 0 14px;
  border-radius: 7px;
  color: #fff;
  font-weight: 650;
  background: linear-gradient(135deg, #8d5fe1, var(--primary));
  box-shadow: 0 8px 18px rgba(var(--primary-rgb), 0.18);
}

.primary-soft-btn svg {
  width: 16px;
  height: 16px;
}

.danger-soft-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 36px;
  padding: 0 14px;
  border-radius: 7px;
  color: #fff;
  font-weight: 650;
  background: var(--danger);
  box-shadow: 0 8px 18px var(--danger-soft);
}

.danger-soft-btn svg {
  width: 16px;
  height: 16px;
}

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 15px 16px 0;
}

.panel-title {
  margin: 0;
  font-size: 15px;
  font-weight: 750;
}

.panel-sub {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.panel-body {
  padding: 14px 16px 16px;
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 16px;
}

.stat-card {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  padding: 15px;
  min-height: 116px;
  overflow: hidden;
  position: relative;
}

.stat-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  flex: 0 0 auto;
  border-radius: 9px;
  background: var(--primary-soft);
  color: var(--primary);
}

.stat-icon.green { background: var(--success-soft); color: var(--success); }
.stat-icon.cyan { background: var(--cyan-soft); color: var(--cyan); }
.stat-icon.orange { background: var(--warning-soft); color: var(--warning); }

.stat-copy {
  flex: 1;
  min-width: 0;
}

.stat-label {
  margin: 0 0 4px;
  color: var(--muted);
  font-size: 12px;
}

.stat-value {
  display: block;
  font-size: 23px;
  line-height: 1.15;
  font-weight: 800;
  letter-spacing: 0;
}

.stat-trend {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-top: 8px;
  color: var(--success);
  font-size: 12px;
}

.stat-trend.down {
  color: var(--danger);
}

.stat-trend svg {
  width: 13px;
  height: 13px;
}

.stat-spark {
  align-self: flex-end;
  width: 56px;
  height: 42px;
  flex: 0 0 auto;
}

.stat-spark svg {
  width: 100%;
  height: 100%;
  overflow: visible;
}

.chart-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.85fr) minmax(270px, 0.8fr);
  gap: 14px;
  margin-bottom: 14px;
}

.chart-panel {
  min-width: 0;
}

.chart-wrap {
  width: 100%;
  margin-top: 12px;
}

.chart-wrap svg {
  display: block;
  width: 100%;
  height: auto;
}

.legend {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--muted);
  font-size: 12px;
}

.legend-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  margin-right: 5px;
  border-radius: 3px;
  background: var(--primary);
  vertical-align: 0;
}

.legend-dot.green { background: #53c49b; }
.legend-dot.cyan { background: #4bb7ef; }

.segmented {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 3px;
  border-radius: 8px;
  background: var(--panel-2);
  border: 1px solid var(--line);
}

.segmented button {
  height: 28px;
  padding: 0 12px;
  border-radius: 6px;
  color: var(--muted);
  background: transparent;
  font-size: 12px;
}

.segmented button.active {
  color: var(--text);
  font-weight: 650;
  background: var(--panel);
  box-shadow: 0 1px 4px rgba(28, 31, 48, 0.08);
}

.quick-list,
.timeline-list,
.todo-list,
.activity-list {
  display: grid;
  gap: 2px;
}

.quick-row,
.activity-row,
.notice-row {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 9px 0;
  border-bottom: 1px dashed var(--line);
}

.quick-row:last-child,
.activity-row:last-child,
.notice-row:last-child {
  border-bottom: 0;
}

.quick-badge,
.activity-dot {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  flex: 0 0 auto;
  border-radius: 8px;
  background: var(--primary-faint);
  color: var(--primary);
}

.quick-badge svg,
.activity-dot svg {
  width: 15px;
  height: 15px;
}

.quick-copy,
.activity-copy,
.notice-copy {
  flex: 1;
  min-width: 0;
}

.quick-copy strong,
.activity-copy strong {
  display: block;
  font-size: 13px;
  font-weight: 650;
}

.quick-copy span,
.activity-copy span {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 22px;
  padding: 0 8px;
  border-radius: 6px;
  color: var(--success);
  background: var(--success-soft);
  font-size: 11px;
  font-weight: 650;
  white-space: nowrap;
}

.status-pill.warning { color: #d99516; background: var(--warning-soft); }
.status-pill.danger { color: var(--danger); background: var(--danger-soft); }
.status-pill.neutral { color: var(--text-2); background: var(--primary-faint); }
.status-pill.cyan { color: var(--cyan); background: var(--cyan-soft); }

.metric-ring {
  display: grid;
  place-items: center;
  margin: 8px auto 4px;
  width: 150px;
  height: 150px;
  position: relative;
}

.metric-ring svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}

.metric-ring strong {
  font-size: 26px;
  font-weight: 800;
}

.metric-ring span {
  position: absolute;
  margin-top: 42px;
  color: var(--muted);
  font-size: 11px;
}

.metric-row {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding-top: 8px;
}

.metric-item span {
  color: var(--muted);
  font-size: 11px;
}

.metric-item strong {
  display: block;
  margin-top: 2px;
  font-size: 14px;
}

.activity-time {
  color: var(--muted);
  font-size: 11px;
  white-space: nowrap;
}

.table-panel .panel-body {
  padding: 10px 0 0;
}

.table-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 2px 16px 12px;
  border-bottom: 1px solid var(--line);
}

.yc-toolbar {
  gap: 12px;
  flex-wrap: wrap;
}

/*
 * 云运动 / 猪牛运动订单表（.sports-order-table）列宽修正。
 * 「状态」列会写「等待执行（2026-10-10 17:00 开跑）」这种整句，原来 11~12 列平均分（每列约 116px），
 * 状态 pill 是 white-space:nowrap 会顶到隔壁列上、看不全。
 * 处理：每列给固定合理宽度（状态列 196px）、状态与计划列允许换行整句显示，
 *       并给表格底部一条看得见的横向滚动条（想看哪列拖过去）。
 */
.sports-order-table {
  min-width: 1798px;
}

.sports-order-table th:nth-child(1) { width: 148px; }   /* 订单ID */
.sports-order-table th:nth-child(2) { width: 88px; }    /* 平台 */
.sports-order-table th:nth-child(3) { width: 128px; }   /* 账号 */
.sports-order-table th:nth-child(4) { width: 156px; }   /* 学校 / 校区 */
.sports-order-table th:nth-child(5) { width: 130px; }   /* 公里 / 次数 */
.sports-order-table th:nth-child(6) { width: 190px; }   /* 计划 */
.sports-order-table th:nth-child(7) { width: 126px; }   /* 配速（5:00-8:00 /km 要放得下） */
.sports-order-table th:nth-child(8) { width: 130px; }   /* 扣费（总价 + 0.01/次 × 次数） */
.sports-order-table th:nth-child(9) { width: 196px; }   /* 状态 */
.sports-order-table th:nth-child(10) { width: 162px; }  /* 下单时间（2026-10-09 22:32:16 要放得下） */
.sports-order-table th:nth-child(11) { width: 184px; }  /* 下单人（「欧阳娜娜 @17364434820」也要放得下） */

/* 再窄的表也保证这两列整行显示，不给省略号 */
.sports-order-table td:nth-child(10),
.sports-order-table td:nth-child(11) {
  white-space: nowrap;
  overflow: visible;
  text-overflow: clip;
}

.sports-order-table th:nth-child(7),
.sports-order-table td:nth-child(7) {
  white-space: nowrap;
  overflow: visible;
  text-overflow: clip;
}

/* 最后一列「项目操作」常驻右侧（横向滚动时按钮一直看得见），也给足宽度别把按钮挤掉 */
.sports-order-table th:last-child,
.sports-order-table td:last-child {
  position: sticky;
  right: 0;
  z-index: 2;
  width: 160px;
  min-width: 160px;
  white-space: nowrap;
  background: var(--panel);
  box-shadow: -10px 0 14px -12px rgba(25, 22, 48, 0.5);
}

.sports-order-table th:last-child {
  z-index: 3;
  background: var(--panel-2);
}

/* 状态 / 计划：整句换行显示，别把字顶到隔壁列 */
.sports-order-table td:nth-child(6),
.sports-order-table td:nth-child(9) {
  white-space: normal;
  word-break: break-word;
}

.sports-order-table td:nth-child(9) .status-pill {
  height: auto;
  min-height: 22px;
  padding: 4px 8px;
  line-height: 15px;
  text-align: left;
  justify-content: flex-start;
  white-space: normal;
}

/*
 * 红蜻蜓订单表：字段比通用猪牛运动表少一列，单独固定列宽，避免状态文案
 * 「等待执行（2026-10-14 08:00 开跑）」在窄列里挤到下一列。
 */
.hqt-order-table {
  min-width: 1360px;
}

.hqt-order-table th:nth-child(1) { width: 138px; }
.hqt-order-table th:nth-child(2) { width: 122px; }
.hqt-order-table th:nth-child(3) { width: 112px; }
.hqt-order-table th:nth-child(4) { width: 132px; }
.hqt-order-table th:nth-child(5) { width: 184px; }
.hqt-order-table th:nth-child(6) { width: 132px; }
.hqt-order-table th:nth-child(7) { width: 204px; }
.hqt-order-table th:nth-child(8) { width: 164px; }

.hqt-order-table td:nth-child(7) {
  white-space: normal;
  word-break: break-word;
}

.hqt-order-table td:nth-child(7) .status-pill {
  height: auto;
  min-height: 22px;
  padding: 4px 8px;
  line-height: 15px;
  white-space: normal;
}

/*
 * 隐藏运动订单表（.yc-order-table）列宽修正。
 * 原来 12 列被平均分成 110px，「项目操作」里的 5~6 个按钮（28px/个）需要约 188px，
 * 结果按钮溢出单元格：申请退款被顶到表格右外侧（实测按钮右边界 1628 > 表格右边界 1577）。
 * 处理：给每列固定合理宽度 + 操作列常驻右侧（横向滚动时也可见），按钮强制一行。
 */
.yc-order-table {
  min-width: 1316px;
}

.yc-order-table th:nth-child(1) { width: 64px; }
.yc-order-table th:nth-child(2) { width: 172px; }
.yc-order-table th:nth-child(3) { width: 76px; }
.yc-order-table th:nth-child(4) { width: 130px; }
.yc-order-table th:nth-child(5) { width: 82px; }
.yc-order-table th:nth-child(6) { width: 76px; }
.yc-order-table th:nth-child(7) { width: 76px; }
.yc-order-table th:nth-child(8) { width: 76px; }
.yc-order-table th:nth-child(9) { width: 70px; }
.yc-order-table th:nth-child(10) { width: 132px; }
.yc-order-table th:nth-child(11) { width: 150px; }

.yc-order-table th:nth-child(12) { width: 140px; }   /* 下单人（仅管理员显示） */

.yc-order-table th:last-child,
.yc-order-table td:last-child {
  position: sticky;
  right: 0;
  z-index: 2;
  width: 212px;
  min-width: 212px;
  white-space: nowrap;
  background: var(--panel);
  box-shadow: -10px 0 14px -12px rgba(25, 22, 48, 0.5);
}

.yc-order-table th:last-child {
  z-index: 3;
  background: var(--panel-2);
}

.yc-order-table .table-actions {
  flex-wrap: nowrap;
  justify-content: flex-end;
}

.yc-order-table th:nth-child(10),
.yc-order-table td:nth-child(10),
.yc-order-table th:nth-child(11),
.yc-order-table td:nth-child(11) {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.table-scroll {
  width: 100%;
  overflow-x: auto;
}

/* 底部横向滚动条：做得看得见、好拖（订单表列多，状态/操作列要拖过去看） */
.table-scroll {
  scrollbar-width: thin;
  scrollbar-color: #c3c7d8 var(--primary-faint);
  padding-bottom: 2px;
}

.table-scroll::-webkit-scrollbar {
  height: 12px;
}

.table-scroll::-webkit-scrollbar-track {
  background: var(--primary-faint);
  border-radius: 999px;
}

.table-scroll::-webkit-scrollbar-thumb {
  background: #c3c7d8;
  border-radius: 999px;
  border: 2px solid var(--primary-faint);
}

.table-scroll::-webkit-scrollbar-thumb:hover {
  background: #a8adc4;
}

.filter-group {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.filter-input {
  position: relative;
  display: flex;
  align-items: center;
}

.filter-input svg {
  position: absolute;
  left: 11px;
  width: 15px;
  height: 15px;
  color: var(--muted);
}

.filter-input input,
.field-input,
.select-shell select {
  height: 34px;
  border: 1px solid var(--line-strong);
  border-radius: 7px;
  outline: 0;
  background: var(--panel);
  color: var(--text);
}

.filter-input input {
  width: 190px;
  padding: 0 10px 0 33px;
}

.select-shell select {
  min-width: 122px;
  padding: 0 28px 0 10px;
  appearance: none;
}

.select-shell {
  position: relative;
}

.select-shell::after {
  content: "";
  position: absolute;
  right: 11px;
  top: 14px;
  width: 7px;
  height: 7px;
  border-right: 1.6px solid var(--muted);
  border-bottom: 1.6px solid var(--muted);
  transform: rotate(45deg);
  pointer-events: none;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
}

.data-table th {
  height: 42px;
  padding: 0 10px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 650;
  text-align: left;
  background: var(--panel-2);
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}

.data-table td {
  height: 56px;
  padding: 8px 10px;
  border-bottom: 1px solid var(--line);
  color: var(--text-2);
  font-size: 13px;
  vertical-align: middle;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.data-table tbody tr {
  transition: background 0.14s ease;
}

.data-table tbody tr:hover {
  background: var(--primary-faint);
}

.data-table .check-cell {
  width: 40px;
  text-align: center;
}

.table-avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 8px;
  color: #fff;
  background: linear-gradient(135deg, #a06bea, var(--primary));
  font-size: 12px;
  font-weight: 700;
}

.table-avatar.tone2 { background: linear-gradient(135deg, #58b8d8, #2988be); }
.table-avatar.tone3 { background: linear-gradient(135deg, #f1b061, #e78525); }
.table-avatar.tone4 { background: linear-gradient(135deg, #72cf9b, #3ca476); }
.table-avatar.tone5 { background: linear-gradient(135deg, #f08b8b, #dd5050); }

.user-cell {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
}

.user-cell-copy {
  min-width: 0;
}

.user-cell-copy strong {
  display: block;
  color: var(--text);
  font-size: 13px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-cell-copy span {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 11px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.table-actions {
  display: flex;
  align-items: center;
  gap: 4px;
}

.table-actions button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 7px;
  color: var(--muted);
  background: transparent;
}

.table-actions button:hover {
  background: var(--primary-soft);
  color: var(--primary);
}

.table-actions button.danger:hover {
  background: var(--danger-soft);
  color: var(--danger);
}

.table-actions svg {
  width: 15px;
  height: 15px;
}

.logs-table .log-reason-cell {
  height: auto;
  min-height: 56px;
  padding-top: 11px;
  padding-bottom: 11px;
  white-space: normal;
  overflow: visible;
  text-overflow: clip;
  word-break: break-word;
  line-height: 1.55;
  vertical-align: top;
}

.pagination {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  padding: 12px 16px;
  color: var(--muted);
  font-size: 12px;
}

.season-order-pagination {
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
}

.season-order-page-summary {
  display: inline-flex;
  align-items: center;
  min-height: 38px;
  padding: 6px 12px;
  border: 2px solid #1677ff;
  border-radius: 8px;
  background: #eef6ff;
  color: #0958d9;
  font-size: 16px;
  font-weight: 750;
  line-height: 1.4;
  box-shadow: 0 0 0 1px rgba(22, 119, 255, 0.08);
}

.season-page-controls {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.season-page-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 32px;
  height: 32px;
  padding: 0 8px;
  border-radius: 7px;
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--text-2);
  font-size: 13px;
  font-weight: 650;
}

.season-page-btn svg {
  width: 16px;
  height: 16px;
}

.season-page-btn.active {
  color: #fff;
  background: #1677ff;
  border-color: #1677ff;
}

.season-page-btn:disabled {
  opacity: 0.4;
}

.page-number,
.page-arrow {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 28px;
  height: 28px;
  border-radius: 7px;
  color: var(--text-2);
  background: var(--panel);
  border: 1px solid var(--line);
  font-size: 12px;
}

.page-number.active {
  color: #fff;
  background: var(--primary);
  border-color: var(--primary);
}

.page-arrow svg {
  width: 20px;
  height: 20px;
}

.page-arrow {
  min-width: 44px;
  height: 44px;
  border-radius: 10px;
  color: #fff;
  background: var(--primary);
  border-color: var(--primary);
}

.page-arrow:disabled {
  opacity: 0.4;
}

.page-arrow:not(:disabled):hover {
  color: #fff;
  background: var(--primary-strong, var(--primary));
}

.bottom-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(290px, 0.75fr);
  gap: 14px;
}

.todo-list .todo-row {
  display: grid;
  grid-template-columns: 16px 1fr auto;
  align-items: center;
  gap: 10px;
  min-height: 42px;
}

.todo-row .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--warning);
}

.todo-row .dot.done { background: var(--success); }
.todo-row .dot.primary { background: var(--primary); }

.todo-row span {
  color: var(--text-2);
}

.todo-row.done span {
  color: var(--muted);
  text-decoration: line-through;
}

/* Analysis page */
.analytics-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 14px;
}

.mini-stat {
  padding: 12px 14px;
}

.mini-stat .stat-label {
  margin-bottom: 6px;
}

.mini-stat .stat-value {
  font-size: 19px;
}

.donut-list {
  display: grid;
  gap: 12px;
  margin-top: 10px;
}

.donut-item {
  display: grid;
  grid-template-columns: 26px 1fr auto;
  align-items: center;
  gap: 10px;
  font-size: 12px;
}

.donut-dot {
  width: 10px;
  height: 10px;
  border-radius: 3px;
  background: var(--primary);
}

.donut-item:nth-child(2) .donut-dot { background: #4bb7ef; }
.donut-item:nth-child(3) .donut-dot { background: #53c49b; }
.donut-item:nth-child(4) .donut-dot { background: #f2a33c; }

.donut-item strong {
  color: var(--text);
}

.rank-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.rank-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 0;
}

.rank-number {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 7px;
  color: var(--text-2);
  background: var(--primary-faint);
  font-size: 11px;
  font-weight: 700;
}

.rank-item:nth-child(-n + 3) .rank-number {
  color: #fff;
  background: var(--primary);
}

.rank-copy {
  flex: 1;
  min-width: 0;
}

.rank-copy strong {
  display: block;
  font-size: 12px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.rank-copy span {
  color: var(--muted);
  font-size: 11px;
}

.rank-value {
  font-size: 12px;
  font-weight: 700;
}

/* Settings page */
.settings-layout {
  display: grid;
  grid-template-columns: 210px minmax(0, 1fr);
  gap: 14px;
  align-items: start;
}

.settings-nav {
  display: grid;
  gap: 3px;
  padding: 9px;
}

.settings-nav button {
  display: flex;
  align-items: center;
  gap: 9px;
  height: 38px;
  padding: 0 11px;
  border-radius: 7px;
  color: var(--text-2);
  background: transparent;
  text-align: left;
}

.settings-nav button.active {
  color: var(--primary);
  background: var(--primary-soft);
  font-weight: 650;
}

.settings-nav svg {
  width: 16px;
  height: 16px;
}

.settings-main {
  min-width: 0;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

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

.form-row label {
  color: var(--text-2);
  font-size: 12px;
  font-weight: 600;
}

.form-row .field-input,
.form-row select {
  width: 100%;
  height: 38px;
  padding: 0 12px;
}

.form-row textarea.field-input {
  height: auto;
  min-height: 88px;
  padding: 10px 12px;
  resize: vertical;
  font: inherit;
}

.batch-account-box {
  min-height: 150px;
  line-height: 1.6;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
}

.form-row.wide {
  grid-column: 1 / -1;
}

.weekday-picker {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.weekday-check {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 34px;
  padding: 0 10px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: var(--panel-2);
  color: var(--text);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  user-select: none;
}

.weekday-check input {
  width: 14px;
  height: 14px;
  margin: 0;
  accent-color: var(--primary);
}

.form-row .weekday-check:has(input:checked) {
  border-color: var(--primary);
  background: var(--primary-faint);
  color: var(--primary);
}

.setting-line {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}

.setting-copy {
  flex: 1;
  min-width: 0;
}

.setting-copy strong {
  display: block;
  font-size: 13px;
}

.setting-copy span {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}

.switch {
  position: relative;
  display: inline-flex;
  align-items: center;
  width: 40px;
  height: 22px;
  flex: 0 0 auto;
  border-radius: 20px;
  background: var(--line-strong);
  transition: background 0.18s ease;
}

.switch::after {
  content: "";
  position: absolute;
  left: 3px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.18);
  transition: left 0.18s ease;
}

.switch.on {
  background: var(--primary);
}

.switch.on::after {
  left: 21px;
}

/* Modal */
.modal-root {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: none;
  place-items: center;
  padding: 20px;
  background: rgba(25, 24, 42, 0.46);
  backdrop-filter: blur(3px);
  animation: fadeIn 0.2s ease both;
}

.modal-root[data-open="true"] { display: grid; }

.modal-box {
  width: min(480px, 100%);
  max-height: min(720px, 90vh);
  overflow: auto;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 11px;
  box-shadow: 0 24px 60px rgba(23, 20, 45, 0.22);
  animation: popIn 0.22s ease both;
}

.modal-box.modal-wide {
  width: min(1120px, 100%);
  max-height: min(850px, 94vh);
}

.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 15px 18px;
  border-bottom: 1px solid var(--line);
}

.modal-head strong {
  font-size: 16px;
}

.modal-body {
  padding: 18px;
  display: grid;
  gap: 14px;
}

.modal-foot {
  display: flex;
  justify-content: flex-end;
  gap: 9px;
  padding: 13px 18px;
  border-top: 1px solid var(--line);
}

.docking-note {
  display: grid;
  gap: 4px;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-2);
}

.docking-note strong {
  font-size: 13px;
}

.docking-note span {
  color: var(--primary);
  font-family: "Cascadia Code", Consolas, monospace;
  font-size: 12px;
}

.docking-note p {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
}

.code-input {
  min-height: 132px !important;
  font-family: "Cascadia Code", Consolas, monospace;
  font-size: 12px;
}

.code-panel {
  max-height: 220px;
  margin: 0;
  padding: 12px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-2);
  color: var(--text-2);
  font-family: "Cascadia Code", Consolas, monospace;
  font-size: 12px;
  line-height: 1.55;
  white-space: pre-wrap;
  word-break: break-word;
}

.role-preview {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  max-height: 210px;
  overflow: auto;
}

.role-preview label {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 34px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
  color: var(--text-2);
  cursor: pointer;
}

/* Dropdown */
.dropdown-panel {
  position: fixed;
  right: 20px;
  top: 58px;
  width: 320px;
  max-width: calc(100vw - 28px);
  padding: 10px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: var(--shadow-md);
  z-index: 90;
}

.dropdown-panel header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 8px 10px;
}

.notice-count {
  color: var(--primary);
  font-size: 11px;
  background: var(--primary-soft);
  border-radius: 6px;
  padding: 3px 7px;
}

.notice-item {
  display: flex;
  gap: 10px;
  padding: 9px 8px;
  border-radius: 8px;
}

.notice-item.unread {
  background: var(--primary-faint);
}

.notice-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 8px;
  background: var(--primary-soft);
  color: var(--primary);
}

.notice-icon.warning { background: var(--warning-soft); color: var(--warning); }
.notice-icon.success { background: var(--success-soft); color: var(--success); }

.notice-icon svg { width: 15px; height: 15px; }

.notice-item strong { display: block; font-size: 12px; }
.notice-item p { margin: 2px 0; color: var(--text-2); font-size: 12px; }
.notice-item small { color: var(--muted); }

/* Toast */
.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  z-index: 200;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  max-width: min(420px, calc(100vw - 30px));
  padding: 10px 15px;
  border-radius: 8px;
  color: #fff;
  background: #292c3d;
  box-shadow: 0 12px 28px rgba(21, 22, 35, 0.26);
  font-size: 13px;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 12px);
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}

.toast.success {
  background: linear-gradient(135deg, #2f9c70, #28b17c);
}

.toast svg {
  width: 16px;
  height: 16px;
}

/* Empty state */
.empty-state {
  display: grid;
  place-items: center;
  gap: 9px;
  padding: 28px 16px;
  color: var(--muted);
  text-align: center;
}

.empty-state svg {
  width: 30px;
  height: 30px;
  color: var(--primary);
}

@keyframes viewIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes windowIn {
  from { opacity: 0; transform: translateY(12px) rotate(-1.2deg); }
  to { opacity: 1; transform: translateY(0) rotate(-1.2deg); }
}

@keyframes popIn {
  from { opacity: 0; transform: translateY(8px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-7px); }
  50% { transform: translateX(6px); }
  75% { transform: translateX(-3px); }
}

@media (max-width: 1180px) {
  .auth-view {
    grid-template-columns: minmax(440px, 52%) minmax(420px, 48%);
  }

  .auth-art {
    padding-left: 34px;
    padding-right: 30px;
  }

  .stat-grid,
  .analytics-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

}

@media (max-width: 980px) {
  .auth-view,
  .auth-view.is-active {
    display: block;
  }

  .auth-art {
    display: none;
  }

  .auth-main {
    min-height: 100vh;
    min-height: 100dvh;
    padding: 62px 30px 40px;
  }

  .auth-main::before {
    content: "";
    position: absolute;
    top: 17px;
    left: 30px;
    width: 34px;
    height: 34px;
    border-radius: 9px;
    background: url("assets/logo.svg") center/contain no-repeat;
    opacity: 0.9;
  }

  .chart-grid,
  .bottom-grid,
  .rank-grid,
  .settings-layout {
    grid-template-columns: 1fr;
  }

  .settings-nav {
    grid-template-columns: repeat(4, 1fr);
  }

  .settings-nav button {
    justify-content: center;
    padding: 0;
  }

  .settings-nav button span {
    display: none;
  }
}

@media (max-width: 760px) {
  .sidebar {
    transform: translateX(-100%);
    box-shadow: 18px 0 46px rgba(25, 22, 48, 0.2);
  }

  body.sidebar-collapsed {
    --sidebar-width: 238px;
  }

  body.sidebar-open .sidebar {
    transform: translateX(0);
  }

  body.sidebar-collapsed .brand-copy,
  body.sidebar-collapsed .nav-group-title,
  body.sidebar-collapsed .nav-item span,
  body.sidebar-collapsed .mini-user,
  body.sidebar-collapsed .sidebar-foot .icon-btn {
    display: flex;
  }

  body.sidebar-collapsed .sidebar-brand,
  body.sidebar-collapsed .sidebar-foot {
    justify-content: flex-start;
    padding: 0 14px;
  }

  body.sidebar-collapsed .nav-item {
    justify-content: flex-start;
    padding: 0 11px;
  }

  body.sidebar-collapsed .nav-item.active::before {
    left: -10px;
  }

  .app-shell {
    margin-left: 0;
  }

  .page-crumb {
    display: none;
  }

  .topbar {
    padding: 0 14px;
  }

  .page-container {
    padding: 15px 14px 20px;
  }

  .page-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .season-sports-frame {
    height: calc(100vh - 250px);
    min-height: 620px;
  }

  .head-actions {
    width: 100%;
  }

  .panel-body {
    padding-left: 12px;
    padding-right: 12px;
  }

  .table-panel {
    overflow-x: visible;
  }

  .data-table {
    min-width: 760px;
  }

  .sports-order-table th:last-child,
  .sports-order-table td:last-child {
    position: sticky;
    right: 0;
    z-index: 2;
    width: 116px;
    min-width: 116px;
    background: var(--panel);
    box-shadow: -10px 0 14px -12px rgba(25, 22, 48, 0.5);
  }

  .sports-order-table th:last-child {
    z-index: 3;
    background: var(--panel-2);
  }

  .sports-order-table .table-actions {
    justify-content: flex-end;
  }

  /* 窄屏恢复「操作列窄 + 按钮换行」，避免 212px 的固定宽度挤掉其他列 */
  .yc-order-table th:last-child,
  .yc-order-table td:last-child {
    width: 116px;
    min-width: 116px;
    white-space: normal;
  }

  .yc-order-table .table-actions {
    flex-wrap: wrap;
  }

  .filter-input input {
    width: 150px;
  }

  .form-grid {
    grid-template-columns: 1fr;
  }

  .form-row.wide {
    grid-column: auto;
  }

  .page-number {
    display: none;
  }

  .page-number.active {
    display: inline-flex;
  }
}

@media (max-width: 540px) {
  .theme-picker:not(.compact) {
    display: none;
  }

  .stat-grid,
  .analytics-grid {
    grid-template-columns: 1fr;
  }

  .auth-tools {
    right: 12px;
  }

  .auth-main {
    padding: 64px 22px 34px;
  }

  .auth-form-title h3 {
    font-size: 25px;
  }

  .topbar-right > .icon-btn:nth-of-type(2),
  .topbar-right > .icon-btn:nth-of-type(3) {
    display: none;
  }

  .dropdown-panel {
    right: 10px;
    left: 10px;
    width: auto;
  }

  .pagination {
    justify-content: center;
  }
}

/*
 * 自画路线（猪牛运动 · 云运动下单弹窗）：画板 + 范围/清空 + 说明。
 * canvas 用 touch-action:none，否则手机上拖动画线会被页面滚动吃掉。
 */
.face-photo-upload {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 100%;
}

.face-photo-head {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.face-photo-pick {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
}

.face-photo-name {
  min-width: 0;
  color: var(--muted);
  font-size: 12px;
  overflow-wrap: anywhere;
}

.face-photo-preview {
  width: 116px;
  height: 116px;
  object-fit: cover;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: var(--panel-2);
}

.route-draw {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 100%;
}

.route-draw canvas {
  width: 100%;
  max-width: 660px;
  height: auto;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  background: var(--panel);
  touch-action: none;
  cursor: crosshair;
}

.route-draw-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  font-size: 12px;
  color: var(--muted);
}

.route-draw-actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.route-draw-size {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}

.route-draw-size select {
  height: 30px;
  padding: 0 8px;
  border: 1px solid var(--line-strong);
  border-radius: 7px;
  background: var(--panel);
  color: var(--text);
}

.route-draw-hint {
  font-size: 12px;
  line-height: 1.6;
  color: var(--muted);
}

.route-draw-anchor {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: var(--panel-2);
  color: var(--text);
  font-size: 12px;
  font-weight: 600;
  align-self: flex-start;
}

.route-draw-anchor.verified {
  border-color: var(--primary);
  color: var(--primary);
  background: var(--primary-faint);
}

/*
 * 画板 / 学校地图画布：底图是一张服务器取回来的静态地图图片（同源），
 * canvas 透明地叠在上面负责画线和拖动，因此画布像素可以直接换算经纬度。
 * drawing 状态下光标变十字，方便判断当前是「画线」还是「移动地图」。
 */
.route-draw-mapwrap {
  position: relative;
  width: 100%;
  max-width: 660px;
  aspect-ratio: 660 / 360;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  overflow: hidden;
  background: var(--panel);
}

.route-draw-mapwrap img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: fill;
  user-select: none;
  -webkit-user-drag: none;
}

.route-draw-mapwrap canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  background: transparent;
  touch-action: none;
}

.route-draw-mapwrap.drawing,
.route-draw-mapwrap.drawing canvas {
  cursor: crosshair;
}
