:root {
  --sport-green: #00ff88;
  --sport-cyan: #00d9ff;
  --sport-orange: #ff6b35;
  --bg-dark: #1a1a1a;
  --bg-card: #242424;
  --bg-card-hover: #2a2a2a;
  --text-primary: #ffffff;
  --text-secondary: #b0b0b0;
  --border: #333333;
}

* {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Microsoft YaHei', sans-serif;
  background-color: var(--bg-dark);
  color: var(--text-primary);
}

button,
input {
  font: inherit;
}

button {
  border: 0;
  padding: 0;
  background: none;
  color: inherit;
  cursor: pointer;
}

h1,
h2,
p,
ul {
  margin: 0;
}

ul {
  padding: 0;
  list-style: none;
}

table {
  border-collapse: collapse;
}

/* Local utility layer replacing the small Tailwind subset used by this page. */
.sticky { position: sticky; }
.top-0 { top: 0; }
.z-50 { z-index: 50; }
.block { display: block; }
.hidden { display: none; }
.flex { display: flex; }
.items-center { align-items: center; }
.items-baseline { align-items: baseline; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.gap-2 { gap: 0.5rem; }
.gap-3 { gap: 0.75rem; }
.gap-6 { gap: 1.5rem; }
.w-3 { width: 0.75rem; }
.h-3 { height: 0.75rem; }
.w-8 { width: 2rem; }
.h-8 { height: 2rem; }
.w-10 { width: 2.5rem; }
.h-10 { height: 2.5rem; }
.w-full { width: 100%; }
.max-w-3xl { max-width: 48rem; }
.max-w-7xl { max-width: 80rem; }
.mx-auto { margin-left: auto; margin-right: auto; }
.mt-2 { margin-top: 0.5rem; }
.mt-4 { margin-top: 1rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-3 { margin-bottom: 0.75rem; }
.mb-4 { margin-bottom: 1rem; }
.mb-6 { margin-bottom: 1.5rem; }
.p-4 { padding: 1rem; }
.p-5 { padding: 1.25rem; }
.p-6 { padding: 1.5rem; }
.p-8 { padding: 2rem; }
.px-2 { padding-left: 0.5rem; padding-right: 0.5rem; }
.px-4 { padding-left: 1rem; padding-right: 1rem; }
.px-5 { padding-left: 1.25rem; padding-right: 1.25rem; }
.px-6 { padding-left: 1.5rem; padding-right: 1.5rem; }
.py-1 { padding-top: 0.25rem; padding-bottom: 0.25rem; }
.py-2 { padding-top: 0.5rem; padding-bottom: 0.5rem; }
.py-3 { padding-top: 0.75rem; padding-bottom: 0.75rem; }
.py-4 { padding-top: 1rem; padding-bottom: 1rem; }
.py-5 { padding-top: 1.25rem; padding-bottom: 1.25rem; }
.py-8 { padding-top: 2rem; padding-bottom: 2rem; }
.py-12 { padding-top: 3rem; padding-bottom: 3rem; }
.pb-8 { padding-bottom: 2rem; }
.pt-2 { padding-top: 0.5rem; }
.space-y-2 > * + * { margin-top: 0.5rem; }
.space-y-4 > * + * { margin-top: 1rem; }
.space-y-6 > * + * { margin-top: 1.5rem; }
.space-y-8 > * + * { margin-top: 2rem; }
.overflow-hidden { overflow: hidden; }
.rounded { border-radius: 0.25rem; }
.rounded-lg { border-radius: 0.5rem; }
.rounded-xl { border-radius: 0.75rem; }
.rounded-2xl { border-radius: 1rem; }
.rounded-3xl { border-radius: 1.5rem; }
.rounded-full { border-radius: 9999px; }
.border-b { border-bottom: 1px solid currentColor; }
.border-2 { border: 2px solid currentColor; }
.border-l-4 { border-left: 4px solid currentColor; }
.border-gray-800 { border-color: #1f2937; }
.bg-black\/90 { background-color: rgba(0, 0, 0, 0.9); }
.bg-gradient-to-br {
  --tw-gradient-from: transparent;
  --tw-gradient-to: transparent;
  background-image: linear-gradient(to bottom right, var(--tw-gradient-from), var(--tw-gradient-to));
}
.from-green-400 { --tw-gradient-from: #4ade80; }
.to-emerald-400 { --tw-gradient-to: #34d399; }
.from-cyan-400 { --tw-gradient-from: #22d3ee; }
.to-blue-400 { --tw-gradient-to: #60a5fa; }
.from-yellow-400 { --tw-gradient-from: #facc15; }
.to-amber-400 { --tw-gradient-to: #fbbf24; }
.from-orange-400 { --tw-gradient-from: #fb923c; }
.to-orange-500 { --tw-gradient-to: #f97316; }
.from-orange-500 { --tw-gradient-from: #f97316; }
.to-red-500 { --tw-gradient-to: #ef4444; }
.from-red-500 { --tw-gradient-from: #ef4444; }
.to-red-600 { --tw-gradient-to: #dc2626; }
.text-left { text-align: left; }
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-xs { font-size: 0.75rem; line-height: 1rem; }
.text-sm { font-size: 0.875rem; line-height: 1.25rem; }
.text-base { font-size: 1rem; line-height: 1.5rem; }
.text-lg { font-size: 1.125rem; line-height: 1.75rem; }
.text-xl { font-size: 1.25rem; line-height: 1.75rem; }
.text-2xl { font-size: 1.5rem; line-height: 2rem; }
.text-4xl { font-size: 2.25rem; line-height: 2.5rem; }
.text-5xl { font-size: 3rem; line-height: 1; }
.font-mono { font-family: ui-monospace, SFMono-Regular, Consolas, 'Liberation Mono', monospace; }
.font-semibold { font-weight: 600; }
.font-bold { font-weight: 700; }
.font-extrabold { font-weight: 800; }
.uppercase { text-transform: uppercase; }
.tracking-tight,
.tracking-wider,
.tracking-widest { letter-spacing: 0; }
.leading-relaxed { line-height: 1.625; }
.text-white { color: #ffffff; }
.cursor-pointer { cursor: pointer; }
.transition { transition-property: color, background-color, border-color, box-shadow, transform, filter; transition-duration: 150ms; transition-timing-function: ease; }

@media (min-width: 640px) {
  .sm\:px-6 { padding-left: 1.5rem; padding-right: 1.5rem; }
  .sm\:p-8 { padding: 2rem; }
  .sm\:text-lg { font-size: 1.125rem; line-height: 1.75rem; }
  .sm\:text-5xl { font-size: 3rem; line-height: 1; }
}

@media (min-width: 768px) {
  .md\:block { display: block; }
  .md\:text-6xl { font-size: 3.75rem; line-height: 1; }
}

.gradient-bg {
  background: linear-gradient(180deg, #1a1a1a 0%, #0f0f0f 100%);
  min-height: 100vh;
}

.glass-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.glass-card:hover {
  border-color: var(--sport-green);
  box-shadow: 0 4px 24px rgba(0, 255, 136, 0.15);
}

.glow-sport {
  text-shadow: 0 0 20px rgba(0, 255, 136, 0.5);
}

.glow-subtle {
  text-shadow: 0 0 8px rgba(0, 255, 136, 0.3);
}

input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 6px;
  border-radius: 3px;
  background: linear-gradient(to right, var(--sport-green) 0%, var(--sport-cyan) 100%);
  outline: none;
  cursor: pointer;
}

input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #fff;
  border: 3px solid var(--sport-green);
  cursor: grab;
  box-shadow: 0 0 10px rgba(0, 255, 136, 0.6), 0 2px 8px rgba(0, 0, 0, 0.3);
  transition: all 150ms ease;
}

input[type="range"]::-webkit-slider-thumb:hover {
  transform: scale(1.15);
  box-shadow: 0 0 20px rgba(0, 255, 136, 0.8), 0 2px 12px rgba(0, 0, 0, 0.4);
}

input[type="range"]::-webkit-slider-thumb:active {
  cursor: grabbing;
  transform: scale(1.05);
}

input[type="range"]::-moz-range-thumb {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #fff;
  border: 3px solid var(--sport-green);
  cursor: grab;
  box-shadow: 0 0 10px rgba(0, 255, 136, 0.6);
  transition: all 150ms ease;
}

input[type="range"]::-moz-range-thumb:hover {
  transform: scale(1.15);
}

.zone-bar {
  display: flex;
  height: 64px;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.6);
}

.zone-segment {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 200ms ease;
  position: relative;
  border-right: 2px solid rgba(0, 0, 0, 0.4);
  font: inherit;
}

.zone-segment:last-child {
  border-right: none;
}

.zone-segment:hover {
  filter: brightness(1.15);
  transform: scaleY(1.08);
}

.zone-segment.active {
  filter: brightness(1.25);
  transform: scaleY(1.2);
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.8), 0 0 20px rgba(0, 255, 136, 0.4);
  z-index: 1;
}

.zone-segment:focus-visible,
.pace-item:focus-visible,
.interactive-button:focus-visible,
.interactive-summary:focus-visible {
  outline: 3px solid rgba(0, 217, 255, 0.9);
  outline-offset: 3px;
}

.zone-code {
  font-size: 17px;
  font-weight: 700;
  color: #fff;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.6);
}

.zone-bpm {
  font-size: 11px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.95);
  margin-top: 2px;
}

.zone-segment[data-zone="D"] { background: linear-gradient(135deg, #00ff88, #00d9a5); }
.zone-segment[data-zone="E"] { background: linear-gradient(135deg, #00d9ff, #00b4d8); }
.zone-segment[data-zone="M"] { background: linear-gradient(135deg, #ffd60a, #ffc300); }
.zone-segment[data-zone="T"] { background: linear-gradient(135deg, #ffba08, #ff9500); }
.zone-segment[data-zone="A"] { background: linear-gradient(135deg, #ff6b35, #ff4500); }
.zone-segment[data-zone="I"] { background: linear-gradient(135deg, #ff006e, #d00000); }

.pace-item {
  transition: all 200ms ease;
  cursor: pointer;
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: inherit;
  font: inherit;
  text-align: left;
}

.pace-item:hover {
  background: var(--bg-card-hover);
  border-color: var(--sport-green);
  box-shadow: 0 2px 12px rgba(0, 255, 136, 0.15);
}

.pace-item.active {
  background: rgba(0, 255, 136, 0.15);
  border-color: var(--sport-green);
  border-width: 2px;
  box-shadow: 0 4px 16px rgba(0, 255, 136, 0.25);
}

.energy-bar {
  display: flex;
  height: 40px;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.4);
}

.energy-segment {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 600;
  color: #fff;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
  transition: all 200ms ease;
}

.energy-segment.fat {
  background: linear-gradient(135deg, #00ff88, #00d9a5);
}

.energy-segment.carb {
  background: linear-gradient(135deg, #ff6b35, #ff9500);
}

.pace-input {
  background: var(--bg-card);
  border: 2px solid var(--border);
  color: var(--sport-green);
  font-weight: 700;
  transition: all 200ms ease;
}

.pace-input:focus {
  outline: none;
  border-color: var(--sport-green);
  box-shadow: 0 0 0 3px rgba(0, 255, 136, 0.2);
}

@keyframes pulse-glow {
  0%, 100% { opacity: 1; box-shadow: 0 0 8px var(--sport-green); }
  50% { opacity: 0.8; box-shadow: 0 0 16px var(--sport-green); }
}

.animate-pulse-glow {
  animation: pulse-glow 2s ease-in-out infinite;
}

details summary {
  cursor: pointer;
  user-select: none;
  list-style: none;
}

details summary::-webkit-details-marker {
  display: none;
}

details summary::before {
  content: '▸';
  display: inline-block;
  margin-right: 8px;
  transition: transform 200ms ease;
  color: var(--sport-green);
}

details[open] summary::before {
  transform: rotate(90deg);
}

.table-dark {
  background: var(--bg-card);
}

.table-dark th {
  background: rgba(0, 0, 0, 0.4);
  color: var(--text-secondary);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.table-dark tbody tr:hover {
  background: rgba(0, 255, 136, 0.08);
}

.table-dark td {
  border-bottom: 1px solid var(--border);
}

.interactive-button:hover {
  border-color: var(--sport-green) !important;
  background: rgba(0, 255, 136, 0.1) !important;
}

.interactive-link:hover {
  color: var(--sport-cyan) !important;
}

.interactive-summary:hover {
  background: var(--bg-card-hover);
}

@media (max-width: 768px) {
  .table-wrapper {
    border: none;
    border-radius: 0;
  }

  .table-dark {
    display: block;
    background: transparent;
  }

  .table-dark thead {
    display: none;
  }

  .table-dark tbody {
    display: block;
  }

  .table-dark tbody tr {
    display: block;
    margin-bottom: 12px;
    padding: 16px;
    border-radius: 12px;
    background: var(--bg-card);
    border: 1px solid var(--border);
  }

  .table-dark tbody tr:hover {
    background: var(--bg-card);
  }

  .table-dark td {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: none;
  }

  .table-dark td:not(:last-child) {
    border-bottom: 1px solid var(--border);
  }

  .table-dark td::before {
    content: attr(data-label);
    font-weight: 600;
    color: var(--text-secondary);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
  }

  .table-dark td[class*="text-right"] {
    justify-content: space-between;
  }
}
