:root {
  color-scheme: light dark;
  --bg: #eef3fb;
  --bg-elevated: #f8fbff;
  --panel: rgba(255, 255, 255, 0.78);
  --panel-strong: rgba(255, 255, 255, 0.92);
  --text: #111827;
  --muted: #5b6475;
  --line: rgba(90, 110, 145, 0.18);
  --soft: rgba(234, 241, 255, 0.8);
  --accent: #1664ff;
  --accent-2: #7c3aed;
  --accent-soft: rgba(22, 100, 255, 0.12);
  --danger: #c93838;
  --ok: #13795b;
  --glass-bg: rgba(255, 255, 255, 0.62);
  --glass-bg-strong: rgba(255, 255, 255, 0.82);
  --glass-border: rgba(255, 255, 255, 0.62);
  --glass-shadow: 0 22px 70px rgba(38, 57, 93, 0.14);
  --glass-shadow-soft: 0 12px 36px rgba(38, 57, 93, 0.1);
  --glass-highlight: inset 0 1px 0 rgba(255, 255, 255, 0.72);
  --glass-blur: 24px;
  --radius-xl: 30px;
  --radius-lg: 24px;
  --radius-md: 18px;
  --radius-sm: 14px;
  --field-bg: rgba(255, 255, 255, 0.86);
  --table-head: rgba(247, 250, 255, 0.9);
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #08111f;
    --bg-elevated: #0d1727;
    --panel: rgba(14, 24, 40, 0.76);
    --panel-strong: rgba(16, 27, 45, 0.94);
    --text: #f4f7fb;
    --muted: #a9b4c6;
    --line: rgba(203, 213, 225, 0.16);
    --soft: rgba(51, 65, 85, 0.72);
    --accent: #68a2ff;
    --accent-2: #b695ff;
    --accent-soft: rgba(104, 162, 255, 0.16);
    --danger: #ff8c8c;
    --ok: #61d5a8;
    --glass-bg: rgba(17, 28, 48, 0.64);
    --glass-bg-strong: rgba(17, 28, 48, 0.86);
    --glass-border: rgba(255, 255, 255, 0.14);
    --glass-shadow: 0 26px 80px rgba(0, 0, 0, 0.38);
    --glass-shadow-soft: 0 14px 44px rgba(0, 0, 0, 0.26);
    --glass-highlight: inset 0 1px 0 rgba(255, 255, 255, 0.16);
    --field-bg: rgba(15, 23, 42, 0.72);
    --table-head: rgba(15, 23, 42, 0.72);
  }
}

@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  :root {
    --panel: #ffffff;
    --panel-strong: #ffffff;
    --glass-bg: #ffffff;
    --glass-bg-strong: #ffffff;
  }

  @media (prefers-color-scheme: dark) {
    :root {
      --panel: #101b2d;
      --panel-strong: #101b2d;
      --glass-bg: #101b2d;
      --glass-bg-strong: #101b2d;
    }
  }
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--bg);
}

body {
  position: relative;
  isolation: isolate;
  min-height: 100vh;
  margin: 0;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.5), rgba(222, 232, 255, 0.35)),
    var(--bg);
  color: var(--text);
  font-family: Arial, "Microsoft YaHei", sans-serif;
  font-size: 14px;
  letter-spacing: 0;
}

body::before,
body::after {
  position: fixed;
  inset: 0;
  z-index: -2;
  pointer-events: none;
  content: "";
}

body::before {
  background:
    radial-gradient(circle at 12% 12%, rgba(73, 150, 255, 0.28), transparent 30%),
    radial-gradient(circle at 86% 8%, rgba(147, 99, 255, 0.2), transparent 28%),
    radial-gradient(circle at 68% 88%, rgba(26, 210, 187, 0.18), transparent 32%);
}

body::after {
  z-index: -1;
  opacity: 0.42;
  background-image:
    linear-gradient(rgba(100, 116, 139, 0.1) 1px, transparent 1px),
    linear-gradient(90deg, rgba(100, 116, 139, 0.1) 1px, transparent 1px);
  background-size: 42px 42px;
  mask-image: radial-gradient(circle at 50% 0%, rgba(0, 0, 0, 0.72), transparent 72%);
}

.admin-app {
  padding-bottom: 26px;
}

.GlassNavbar,
.glass-navbar,
header {
  min-height: 70px;
  width: min(1240px, calc(100vw - 32px));
  margin: 14px auto 0;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 18px;
  padding: 10px 14px 10px 22px;
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-xl);
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.72), rgba(255, 255, 255, 0.38)),
    var(--glass-bg);
  box-shadow: var(--glass-shadow), var(--glass-highlight);
  position: sticky;
  top: 10px;
  z-index: 20;
  backdrop-filter: blur(var(--glass-blur)) saturate(1.45);
  -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(1.45);
}

header h1,
h1 {
  margin: 0;
  color: var(--text);
  font-size: 18px;
  font-weight: 800;
  letter-spacing: 0;
  white-space: nowrap;
}

.brand-lockup {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.brand-icon,
.login-brand-icon {
  display: block;
  width: 34px;
  height: 34px;
  border-radius: 12px;
  box-shadow: 0 10px 24px rgba(22, 100, 255, 0.22);
}

.login-brand-icon {
  width: 46px;
  height: 46px;
  margin-bottom: 14px;
  border-radius: 16px;
}

.nav-tabs {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  overflow-x: auto;
  scrollbar-width: none;
}

.nav-tabs::-webkit-scrollbar,
.sub-tabs::-webkit-scrollbar {
  display: none;
}

.nav-tabs button,
.sub-tabs button {
  min-width: 94px;
  border-color: transparent;
  background: transparent;
  box-shadow: none;
  color: var(--muted);
  font-weight: 700;
}

.nav-tabs button:hover,
.sub-tabs button:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.42);
}

.nav-tabs button.active,
.sub-tabs button.active {
  border-color: rgba(22, 100, 255, 0.3);
  background:
    linear-gradient(135deg, rgba(22, 100, 255, 0.18), rgba(124, 58, 237, 0.1)),
    var(--accent-soft);
  color: var(--accent);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.42);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.app-shell,
main {
  width: min(1760px, calc(100vw - 32px));
  margin: 18px auto 0;
}

.sub-tabs {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin: 0 0 14px;
  padding: 8px;
  border: 1px solid var(--glass-border);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.42);
  box-shadow: var(--glass-highlight);
  backdrop-filter: blur(16px) saturate(1.25);
  -webkit-backdrop-filter: blur(16px) saturate(1.25);
}

.page {
  display: none;
}

.page.active {
  display: block;
}

.HeroLiquidSection,
.hero-liquid-section {
  position: relative;
  overflow: hidden;
  margin: 0 0 16px;
  padding: 28px;
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(240px, 0.6fr);
  gap: 20px;
  align-items: end;
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-xl);
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.86), rgba(255, 255, 255, 0.42)),
    radial-gradient(circle at 84% 16%, rgba(22, 100, 255, 0.18), transparent 32%),
    var(--glass-bg);
  box-shadow: var(--glass-shadow), var(--glass-highlight);
  backdrop-filter: blur(var(--glass-blur)) saturate(1.35);
  -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(1.35);
}

.hero-liquid-section::before {
  position: absolute;
  inset: 0;
  pointer-events: none;
  content: "";
  background:
    linear-gradient(120deg, rgba(255, 255, 255, 0.7), transparent 34%),
    radial-gradient(circle at 10% 100%, rgba(26, 210, 187, 0.16), transparent 34%);
}

.hero-copy,
.hero-aside {
  position: relative;
  z-index: 1;
}

.hero-eyebrow {
  display: inline-flex;
  width: fit-content;
  align-items: center;
  min-height: 26px;
  padding: 0 10px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 12px;
  font-weight: 800;
}

.hero-liquid-section h2 {
  margin: 12px 0 8px;
  font-size: clamp(26px, 4vw, 42px);
  line-height: 1.08;
  letter-spacing: 0;
}

.hero-liquid-section p {
  max-width: 680px;
  margin: 0;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.75;
}

.hero-aside {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

.hero-chip {
  display: inline-flex;
  min-height: 32px;
  align-items: center;
  border-radius: 999px;
  padding: 0 12px;
  border: 1px solid var(--line);
  background: var(--glass-bg-strong);
  color: var(--muted);
  font-weight: 700;
}

.GlassCard,
.glass-card,
section {
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.76), rgba(255, 255, 255, 0.52)),
    var(--panel);
  box-shadow: var(--glass-shadow-soft), var(--glass-highlight);
}

.section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 54px;
  padding: 0 18px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.28);
  color: var(--text);
  font-weight: 800;
}

.section-title .meta {
  font-weight: 500;
}

.toolbar {
  display: flex;
  gap: 10px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
  align-items: center;
  background: rgba(255, 255, 255, 0.18);
}

.toolbar input {
  flex: 1;
}

.form-grid {
  padding: 16px;
  display: grid;
  gap: 12px;
}

.field-label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  margin-bottom: 6px;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  outline: none;
  background: var(--field-bg);
  color: var(--text);
  font-size: 14px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.36);
}

input,
select {
  height: 40px;
  padding: 0 12px;
}

textarea {
  min-height: 220px;
  padding: 10px 12px;
  resize: vertical;
  line-height: 1.6;
  font-family: Arial, "Microsoft YaHei", sans-serif;
}

input[type="checkbox"] {
  width: 16px;
  height: 16px;
  box-shadow: none;
}

input:focus,
select:focus,
textarea:focus {
  border-color: rgba(22, 100, 255, 0.58);
  box-shadow: 0 0 0 4px var(--accent-soft), inset 0 1px 0 rgba(255, 255, 255, 0.38);
}

.LiquidButton,
button {
  height: 36px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.86), rgba(255, 255, 255, 0.58)),
    var(--glass-bg-strong);
  color: var(--text);
  padding: 0 14px;
  cursor: pointer;
  white-space: nowrap;
  box-shadow: var(--glass-highlight), 0 8px 22px rgba(38, 57, 93, 0.08);
  transition: transform 160ms ease, border-color 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

button:hover {
  transform: translateY(-1px);
  border-color: rgba(22, 100, 255, 0.3);
  box-shadow: var(--glass-highlight), 0 12px 28px rgba(38, 57, 93, 0.13);
}

button.primary {
  height: 40px;
  border-color: rgba(22, 100, 255, 0.4);
  background:
    linear-gradient(135deg, rgba(22, 100, 255, 0.95), rgba(124, 58, 237, 0.82)),
    var(--accent);
  color: #fff;
  font-weight: 800;
}

button.danger {
  color: var(--danger);
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
  transform: none;
}

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

th,
td {
  height: 46px;
  padding: 0 12px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

th {
  color: var(--muted);
  font-weight: 800;
  background: var(--table-head);
}

tr.selected td {
  background: var(--accent-soft);
}

.actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

.check-row {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  line-height: 1.5;
}

.target-summary,
.chain-overview,
.metric-grid {
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.22);
}

.target-summary {
  padding: 14px 16px;
  display: grid;
  gap: 8px;
}

.target-name {
  font-weight: 800;
  font-size: 16px;
}

.badge {
  display: inline-flex;
  align-items: center;
  height: 24px;
  padding: 0 9px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--soft);
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  width: fit-content;
}

.badge.ok {
  background: rgba(19, 121, 91, 0.13);
  color: var(--ok);
}

.badge.off {
  background: rgba(201, 56, 56, 0.12);
  color: var(--danger);
}

.stock-list,
.target-check-list,
.chain-segment-list,
.pool-list,
.dashboard-grid {
  padding: 12px;
  display: grid;
  gap: 10px;
}

.stock-list,
.pool-list {
  max-height: 560px;
  overflow: auto;
}

.chain-segment-list {
  max-height: 680px;
  overflow: auto;
}

.stock-row,
.target-check-row,
.chain-segment-card,
.metric-card,
.leaderboard-panel {
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--panel-strong);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.36), 0 8px 22px rgba(38, 57, 93, 0.06);
}

.stock-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  align-items: center;
  min-height: 56px;
  padding: 10px 12px;
}

.target-check-row,
.chain-segment-card,
.metric-card {
  display: grid;
  gap: 5px;
  min-height: 54px;
  padding: 12px;
}

.chain-overview {
  padding: 14px 16px;
  display: grid;
  gap: 8px;
  line-height: 1.6;
}

.chain-stat-row,
.chain-tags {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.chain-segment-card {
  cursor: pointer;
}

.chain-segment-card:hover,
.chain-segment-card.selected {
  border-color: rgba(22, 100, 255, 0.38);
  background:
    linear-gradient(135deg, rgba(22, 100, 255, 0.13), rgba(124, 58, 237, 0.08)),
    var(--panel-strong);
}

.chain-stock-table td,
.chain-stock-table th {
  height: 42px;
}

.metric-grid {
  padding: 14px 16px;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

button.metric-card {
  height: auto;
  color: inherit;
  font: inherit;
  text-align: left;
  white-space: normal;
}

button.metric-card:hover,
button.metric-card:focus-visible {
  border-color: rgba(22, 100, 255, 0.44);
  background:
    linear-gradient(135deg, rgba(22, 100, 255, 0.13), rgba(124, 58, 237, 0.08)),
    var(--panel-strong);
  outline: none;
}

.metric-value {
  font-size: 23px;
  font-weight: 900;
}

.frequency-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

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

.leaderboard-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  padding: 16px;
}

.leaderboard-panel {
  overflow: hidden;
  min-width: 0;
}

.leaderboard-panel-wide {
  grid-column: 1 / -1;
}

.leaderboard-panel-title {
  min-height: 46px;
  padding: 11px 12px;
  border-bottom: 1px solid var(--line);
  display: grid;
  gap: 3px;
  background: rgba(255, 255, 255, 0.22);
}

.leaderboard-panel table {
  table-layout: auto;
}

.leaderboard-panel th,
.leaderboard-panel td {
  height: 38px;
  padding: 0 8px;
  font-size: 13px;
}

.rank-cell {
  width: 38px;
  color: var(--muted);
  font-weight: 800;
}

.gain-cell {
  color: var(--danger);
  font-weight: 800;
}

.money-cell {
  font-weight: 800;
}

.loss-cell {
  color: var(--ok);
  font-weight: 800;
}

.event-date-cell {
  display: grid;
  gap: 2px;
  min-width: 84px;
}

.name {
  font-weight: 800;
}

.meta {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
  margin-top: 3px;
}

.status {
  color: var(--muted);
  font-size: 13px;
  padding: 12px 16px 0;
  min-height: 32px;
}

.status.global {
  padding: 10px 2px 0;
}

.empty {
  color: var(--muted);
  padding: 28px 16px;
  text-align: center;
}

.results {
  max-height: 560px;
  overflow: auto;
}

.dashboard-tracking-section {
  margin-top: 16px;
}

.overnight-history-table {
  min-width: 920px;
}

.message-preview {
  min-height: 420px;
  margin: 0;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--panel-strong);
  color: var(--text);
  white-space: pre-wrap;
  line-height: 1.65;
  font-family: Arial, "Microsoft YaHei", sans-serif;
}

.GlassFooter,
.glass-footer {
  width: min(1180px, calc(100vw - 32px));
  margin: 18px auto 0;
  padding: 12px 18px;
  border: 1px solid var(--glass-border);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.36);
  color: var(--muted);
  font-size: 12px;
  text-align: center;
  box-shadow: var(--glass-highlight);
  backdrop-filter: blur(16px) saturate(1.2);
  -webkit-backdrop-filter: blur(16px) saturate(1.2);
}

.login-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.login-card,
.login-page main {
  width: min(430px, calc(100vw - 32px));
  padding: 30px;
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-xl);
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.82), rgba(255, 255, 255, 0.5)),
    var(--glass-bg);
  box-shadow: var(--glass-shadow), var(--glass-highlight);
  backdrop-filter: blur(var(--glass-blur)) saturate(1.35);
  -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(1.35);
}

.login-page h1 {
  margin: 0 0 6px;
  font-size: 24px;
}

.login-page .meta {
  margin: 0 0 22px;
  color: var(--muted);
  line-height: 1.6;
}

.login-page label {
  display: grid;
  gap: 6px;
  margin-top: 14px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.login-page input {
  height: 44px;
  font-size: 15px;
}

.login-page button {
  width: 100%;
  height: 44px;
  margin-top: 20px;
}

.login-page .error {
  min-height: 20px;
  margin-top: 12px;
  color: var(--danger);
  line-height: 1.4;
}

@media (prefers-color-scheme: dark) {
  body {
    background:
      linear-gradient(135deg, rgba(15, 23, 42, 0.9), rgba(8, 17, 31, 0.92)),
      var(--bg);
  }

  .GlassNavbar,
  .glass-navbar,
  header,
  .HeroLiquidSection,
  .hero-liquid-section,
  .GlassCard,
  .glass-card,
  section,
  .login-card,
  .login-page main {
    background:
      linear-gradient(135deg, rgba(28, 42, 67, 0.78), rgba(15, 23, 42, 0.52)),
      var(--glass-bg);
  }

  .nav-tabs button:hover,
  .sub-tabs button:hover {
    background: rgba(255, 255, 255, 0.08);
  }

  .LiquidButton,
  button {
    background:
      linear-gradient(180deg, rgba(51, 65, 85, 0.72), rgba(30, 41, 59, 0.62)),
      var(--glass-bg-strong);
  }
}

@media (max-width: 900px) {
  :root {
    --glass-blur: 16px;
    --radius-xl: 24px;
    --radius-lg: 20px;
  }

  .GlassNavbar,
  .glass-navbar,
  header {
    width: calc(100vw - 20px);
    grid-template-columns: 1fr;
    gap: 10px;
    padding: 14px;
    top: 8px;
  }

  .header-actions {
    justify-content: stretch;
  }

  .header-actions button,
  button.primary {
    width: 100%;
  }

  .nav-tabs,
  .sub-tabs {
    flex-wrap: nowrap;
    overflow-x: auto;
    padding-bottom: 2px;
  }

  .sub-tabs {
    border-radius: var(--radius-lg);
    padding: 8px;
  }

  .app-shell,
  main {
    width: calc(100vw - 20px);
    margin: 12px auto 0;
  }

  .hero-liquid-section {
    grid-template-columns: 1fr;
    padding: 22px;
  }

  .hero-aside {
    justify-content: flex-start;
  }

  .target-layout,
  .stocks-layout,
  .chain-layout,
  .push-layout,
  .schedule-layout,
  .strategy-layout,
  .overnight-layout,
  .kronos-layout,
  .dashboard-layout,
  .pool-layout,
  .system-layout {
    grid-template-columns: 1fr;
  }

  .frequency-grid,
  .strategy-grid,
  .leaderboard-grid,
  .metric-grid {
    grid-template-columns: 1fr;
  }

  .toolbar {
    flex-direction: column;
    align-items: stretch;
  }

  th,
  td {
    padding: 0 8px;
  }

  body::after {
    opacity: 0.22;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}
