:root {
  --page-bg: #eef4fb;
  --surface: rgba(255, 255, 255, 0.9);
  --surface-strong: #ffffff;
  --surface-muted: #f5f8fc;
  --surface-border: #d7e2f0;
  --surface-border-strong: #c0d0e4;
  --surface-shadow: 0 14px 36px rgba(15, 42, 86, 0.08);
  --surface-shadow-soft: 0 8px 22px rgba(16, 42, 86, 0.05);
  --brand-900: #0f2a56;
  --brand-800: #15396e;
  --brand-700: #1a5fc0;
  --brand-600: #266fd8;
  --brand-500: #3b82f6;
  --brand-050: #edf5ff;
  --success-600: #1f8f57;
  --danger-600: #c33f36;
  --warning-600: #b57207;
  --text-900: #112237;
  --text-700: #35506f;
  --text-500: #5c7797;
  --text-inverse: #f7fbff;
  --focus-ring: 0 0 0 0.28rem rgba(38, 111, 216, 0.18);
  --radius-xl: 20px;
  --radius-lg: 16px;
  --radius-md: 12px;
  --radius-sm: 10px;
  --touch-target: 38px;
}

html[data-theme="light"] {
  color-scheme: light;
}

html[data-theme="dark"] {
  color-scheme: dark;
  --page-bg: #09121d;
  --surface: rgba(17, 27, 40, 0.96);
  --surface-strong: #142131;
  --surface-muted: #101c2b;
  --surface-border: rgba(138, 165, 197, 0.34);
  --surface-border-strong: rgba(168, 194, 226, 0.48);
  --surface-shadow: 0 18px 38px rgba(2, 10, 24, 0.46);
  --surface-shadow-soft: 0 10px 24px rgba(2, 10, 24, 0.34);
  --brand-900: #ebf4ff;
  --brand-800: #d8eaff;
  --brand-700: #b9dbff;
  --brand-600: #7bb8ff;
  --brand-500: #3b82f6;
  --brand-050: rgba(76, 145, 255, 0.18);
  --success-600: #8af0ba;
  --danger-600: #ffb0a9;
  --warning-600: #ffd975;
  --text-900: #f5f9ff;
  --text-700: #e1ecf9;
  --text-500: #bfd1e6;
  --text-inverse: #08111e;
  --focus-ring: 0 0 0 0.28rem rgba(96, 165, 250, 0.24);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  color: var(--text-900);
  font-family: "PingFang SC", "SF Pro Text", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  background: linear-gradient(180deg, #f7f9fd 0%, #eff4fb 100%);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0;
}

.skip-link {
  position: absolute;
  left: 12px;
  top: -48px;
  z-index: 1100;
  padding: 10px 14px;
  border-radius: 999px;
  background: var(--brand-900);
  color: var(--text-inverse);
  text-decoration: none;
}

.skip-link:focus {
  top: 12px;
}

.navbar {
  position: sticky;
  top: 0;
  z-index: 1040;
  backdrop-filter: blur(14px);
  background: linear-gradient(180deg, #f8fbff, #eef4fc) !important;
  border-bottom: 1px solid #d5e1f2;
  box-shadow: 0 4px 14px rgba(22, 52, 96, 0.08);
}

.navbar .container-fluid.app-shell {
  padding-block: 0.28rem;
}

.navbar-brand {
  color: #183354 !important;
  font-weight: 800;
  letter-spacing: 0.4px;
}

.navbar .nav-link {
  min-height: var(--touch-target);
  display: inline-flex;
  align-items: center;
  padding-inline: 14px;
  border-radius: 999px;
  color: #3a577a;
  transition: background-color 0.18s ease, color 0.18s ease, transform 0.18s ease;
}

.navbar .nav-link:hover,
.navbar .nav-link:focus-visible {
  background: rgba(59, 130, 246, 0.12);
  color: #24496f;
}

.navbar .nav-link.active {
  background: linear-gradient(180deg, #3f83f2, #2f67d8);
  color: #ffffff;
  font-weight: 700;
  box-shadow: 0 6px 14px rgba(46, 104, 210, 0.28);
}

.navbar .btn,
.navbar .btn-sm {
  min-height: var(--touch-target);
}

.theme-switch {
  display: inline-flex;
  align-items: center;
  padding: 3px;
  border-radius: 999px;
  border: 1px solid #c6d6ec;
  background: #eaf2ff;
  box-shadow: inset 0 1px 0 #ffffff;
}

.btn-theme-toggle {
  min-width: 72px;
  min-height: 36px !important;
  padding-inline: 12px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: #4b678a;
  font-weight: 700;
  box-shadow: none;
}

.btn-theme-toggle:hover,
.btn-theme-toggle:focus-visible {
  color: #2f4d73;
  background: rgba(63, 131, 242, 0.14);
}

.btn-theme-toggle.is-active {
  color: #ffffff;
  background: linear-gradient(180deg, #79a8f6, #4f89e8);
  box-shadow: 0 4px 10px rgba(60, 111, 196, 0.26);
}

.navbar-toolbar {
  color: #5f7898;
}

.navbar .btn-outline-light {
  color: #2b4f79;
  border-color: #9eb7d9;
  background: rgba(255, 255, 255, 0.72);
}

.navbar .btn-outline-light:hover {
  color: #173a63;
  border-color: #7d9fcf;
  background: #f4f8ff;
}

.app-main {
  position: relative;
  padding-top: 0.12rem;
  padding-bottom: 0.26rem;
}

.app-shell {
  max-width: 1500px;
}

.page-section + .page-section {
  margin-top: 0.38rem;
}

.page-hero--tight {
  margin-bottom: 0.22rem;
  padding: 0.42rem 0.62rem;
}

.min-vh-75 {
  min-height: 75vh;
}

.page-hero {
  position: relative;
  margin-bottom: 0.42rem;
  padding: 0.58rem 0.74rem;
  border: 1px solid rgba(215, 226, 240, 0.95);
  border-radius: var(--radius-xl);
  background:
    linear-gradient(140deg, rgba(255, 255, 255, 0.98), rgba(242, 248, 255, 0.92)),
    linear-gradient(90deg, rgba(26, 95, 192, 0.08), rgba(59, 130, 246, 0.04));
  box-shadow: var(--surface-shadow);
}

.page-hero::after {
  content: "";
  position: absolute;
  inset: 0 auto auto 0;
  width: 100%;
  height: 2px;
  background: linear-gradient(90deg, rgba(26, 95, 192, 0.95), rgba(59, 130, 246, 0.48), transparent 72%);
}

.page-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  margin-bottom: 0.28rem;
  color: var(--brand-700);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.page-title-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.58rem;
  flex-wrap: wrap;
}

.page-title {
  margin: 0;
  color: var(--text-900);
  font-size: clamp(1.18rem, 1.62vw, 1.62rem);
  font-weight: 800;
  line-height: 1.08;
}

.page-subtitle {
  max-width: 920px;
  margin: 0.22rem 0 0;
  color: var(--text-700);
  font-size: 0.9rem;
  line-height: 1.38;
}

.page-actions,
.section-actions,
.toolbar-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem;
}

.tool-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.48rem;
  flex-wrap: wrap;
}

.mobile-only {
  display: none !important;
}

.desktop-only {
  display: inline !important;
}

.hero-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.34rem;
  margin-top: 0.32rem;
}

.hero-tag {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0.16rem 0.5rem;
  border: 1px solid rgba(164, 189, 222, 0.6);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.68);
  color: var(--text-700);
  font-size: 0.76rem;
  font-weight: 700;
}

.split-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
}

.workbench-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.28fr) minmax(320px, 0.94fr);
  gap: 0.75rem;
}

.dashboard-main-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(330px, 0.92fr);
  gap: 0.75rem;
}

.dashboard-hero-grid {
  display: grid;
  grid-template-columns: minmax(340px, 1.1fr) minmax(0, 1.35fr);
  gap: 0.75rem;
}

.summary-strip {
  display: flex;
  flex-wrap: nowrap;
  gap: 0.55rem;
  align-items: stretch;
  overflow-x: auto;
  scrollbar-width: thin;
}

.summary-strip__item {
  min-width: 150px;
  flex: 1 0 150px;
  padding: 0.7rem 0.82rem;
  border: 1px solid var(--surface-border);
  border-radius: 15px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(245, 249, 255, 0.92)),
    linear-gradient(120deg, rgba(59, 130, 246, 0.08), transparent 66%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.55);
}

.summary-strip__item--asset {
  min-width: 260px;
  flex-basis: 260px;
  flex-grow: 1.45;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(241, 247, 255, 0.95)),
    linear-gradient(120deg, rgba(59, 130, 246, 0.12), transparent 72%);
}

.summary-strip__label {
  color: var(--text-500);
  font-size: 0.78rem;
  font-weight: 700;
  line-height: 1.2;
}

.summary-strip__value {
  margin-top: 0.18rem;
  color: var(--text-900);
  font-size: clamp(1.08rem, 1.4vw, 1.42rem);
  font-weight: 400;
  line-height: 1.06;
  white-space: nowrap;
}

.summary-strip__item--asset .summary-strip__value {
  font-size: clamp(1.2rem, 1.7vw, 1.58rem);
  letter-spacing: -0.04em;
}

.positions-account-strip {
  display: grid;
  grid-template-columns: repeat(8, minmax(104px, 1fr));
  overflow-x: auto;
  border: 1px solid var(--surface-border);
  border-radius: 10px;
  background: var(--surface-strong);
  scrollbar-width: thin;
}

.positions-account-item {
  min-width: 104px;
  padding: 0.48rem 0.58rem;
  border-right: 1px solid var(--surface-border);
  white-space: nowrap;
}

.positions-account-item:last-child {
  border-right: 0;
}

.positions-account-label {
  color: var(--text-500);
  font-size: 0.7rem;
  font-weight: 700;
  line-height: 1.2;
}

.positions-account-value {
  margin-top: 0.16rem;
  color: var(--text-900);
  font-family: var(--mono-font);
  font-size: clamp(0.88rem, 0.92vw, 1.02rem);
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  line-height: 1.15;
  letter-spacing: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.positions-account-sub {
  margin-top: 0.12rem;
  color: var(--text-500);
  font-size: 0.68rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  line-height: 1.15;
}