:root {
  color-scheme: light;
  --bg: #f8fcff;
  --ink: #143247;
  --ink-2: #527082;
  --muted: #7890a1;
  --line: rgba(142, 191, 220, 0.46);
  --glass: rgba(255, 255, 255, 0.58);
  --glass-strong: rgba(255, 255, 255, 0.78);
  --blue: #5ba8ff;
  --mint: #78d9c6;
  --alkali-metal: #ffd8b3;
  --alkaline-earth: #fee8a6;
  --transition-metal: #cde7ff;
  --post-transition-metal: #d9e7f0;
  --metalloid: #d6f3d6;
  --nonmetal: #d4f7ef;
  --halogen: #ffd6e3;
  --noble-gas: #e4ddff;
  --lanthanide: #f2d8ff;
  --actinide: #ffd2cc;
  font-family: "Noto Sans SC", "Microsoft YaHei", Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-width: 320px;
  color: var(--ink);
  background:
    radial-gradient(circle at 8% 0%, rgba(185, 238, 255, 0.72), transparent 34%),
    radial-gradient(circle at 88% 22%, rgba(255, 220, 238, 0.52), transparent 30%),
    linear-gradient(120deg, #f9fdff 0%, #eff9ff 48%, #fff9fb 100%);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0.34;
  background-image:
    linear-gradient(115deg, transparent 8%, rgba(137, 220, 242, 0.14) 24%, rgba(182, 168, 255, 0.14) 44%, rgba(247, 183, 209, 0.11) 63%, transparent 82%),
    repeating-radial-gradient(circle at 10% 20%, rgba(20, 50, 71, 0.09) 0 0.7px, transparent 0.8px 5px);
  mix-blend-mode: multiply;
}

.page-shell {
  position: relative;
  z-index: 1;
  width: min(1440px, 100%);
  margin: 0 auto;
  padding: 42px 40px 24px;
}

.hero {
  display: grid;
  grid-template-columns: minmax(360px, 1fr) 668px;
  gap: 28px;
  align-items: start;
  margin-bottom: 18px;
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--blue);
  font-size: 12px;
  line-height: 1.2;
  font-weight: 600;
  text-transform: uppercase;
}

.eyebrow.small {
  font-size: 11px;
  margin-bottom: 20px;
}

h1 {
  margin: 0;
  font-size: 56px;
  line-height: 1.05;
  letter-spacing: 0;
  font-weight: 800;
}

.subtitle {
  margin: 8px 0 0;
  color: var(--ink-2);
  font-size: 26px;
  line-height: 1.2;
  font-weight: 700;
}

.summary {
  width: min(560px, 100%);
  margin: 4px 0 0;
  color: var(--ink-2);
  font-size: 14px;
  line-height: 1.45;
}

.glass-panel {
  background: var(--glass);
  border: 1px solid var(--line);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.92),
    0 24px 60px rgba(92, 138, 170, 0.14);
  backdrop-filter: blur(24px) saturate(1.15);
  -webkit-backdrop-filter: blur(24px) saturate(1.15);
}

.toolbar {
  min-height: 86px;
  border-radius: 22px;
  padding: 19px 20px;
  display: flex;
  align-items: center;
  gap: 24px;
}

.search-box {
  width: 238px;
  height: 46px;
  border-radius: 16px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 16px;
  background: rgba(255, 255, 255, 0.56);
  border: 1px solid rgba(142, 191, 220, 0.46);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.86);
}

.search-icon {
  color: var(--muted);
  font-size: 22px;
  line-height: 1;
}

.search-box input {
  width: 100%;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-size: 14px;
}

.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 22px;
}

.filter-chip {
  height: 34px;
  min-width: 52px;
  border: 1px solid rgba(142, 191, 220, 0.5);
  border-radius: 999px;
  padding: 0 15px;
  color: var(--ink-2);
  background: rgba(255, 255, 255, 0.58);
  box-shadow: 0 8px 18px rgba(92, 138, 170, 0.10);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}

.filter-chip.active {
  color: var(--ink);
  background: rgba(91, 168, 255, 0.24);
  border-color: rgba(91, 168, 255, 0.7);
}

.content-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 218px;
  gap: 24px;
  align-items: start;
}

.table-panel {
  position: relative;
  min-height: 820px;
  overflow: auto hidden;
  border-radius: 28px;
  padding: 18px 18px 22px;
}

.periodic-grid {
  position: relative;
  width: 1082px;
  height: 626px;
  margin-top: 28px;
}

.group-label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}

.grid-index {
  position: absolute;
  color: var(--muted);
  font-size: 9px;
  line-height: 14px;
  text-align: center;
}

.series-label {
  position: absolute;
  width: 28px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  text-align: center;
}

.element,
.series-placeholder {
  position: absolute;
  width: 53px;
  height: 61px;
  border-radius: 8px;
  border: 1px solid rgba(142, 191, 220, 0.54);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.48), rgba(255, 255, 255, 0.10)),
    var(--category-color);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.88),
    0 9px 18px rgba(92, 138, 170, 0.13);
  color: var(--ink);
  cursor: pointer;
  transition: transform 160ms ease, box-shadow 160ms ease, border-color 160ms ease, opacity 160ms ease;
}

.element:hover,
.element.selected {
  transform: translateY(-2px);
  border-color: rgba(91, 168, 255, 0.92);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.95),
    0 18px 34px rgba(91, 168, 255, 0.24);
}

.element.dimmed {
  opacity: 0.28;
}

.atomic-number,
.atomic-mass,
.symbol,
.name-cn,
.name-en,
.series-main,
.series-sub {
  position: absolute;
  overflow: hidden;
  white-space: nowrap;
}

.atomic-number {
  left: 5px;
  top: 4px;
  width: 18px;
  color: var(--muted);
  font-size: 9px;
}

.atomic-mass {
  right: 5px;
  top: 4px;
  width: 25px;
  color: var(--muted);
  font-size: 5.4px;
  text-align: right;
}

.symbol {
  left: 4px;
  top: 16px;
  width: 45px;
  font-size: 23px;
  line-height: 27px;
  font-weight: 800;
  text-align: center;
}

.name-cn {
  left: 4px;
  top: 40px;
  width: 45px;
  font-size: 7.2px;
  line-height: 8px;
  font-weight: 700;
  text-align: center;
}

.name-en {
  left: 4px;
  top: 50px;
  width: 45px;
  color: var(--ink-2);
  font-size: 5.4px;
  line-height: 6.5px;
  text-align: center;
  text-overflow: ellipsis;
}

.series-placeholder {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.38), rgba(255, 255, 255, 0.10)),
    var(--category-color);
  cursor: default;
}

.series-main {
  top: 18px;
  left: 4px;
  width: 45px;
  font-size: 12px;
  font-weight: 700;
  text-align: center;
}

.series-sub {
  top: 39px;
  left: 4px;
  width: 45px;
  color: var(--ink-2);
  font-size: 8px;
  text-align: center;
}

.detail-panel {
  min-height: 820px;
  border-radius: 28px;
  padding: 22px 18px;
}

.detail-card {
  min-height: 300px;
  border-radius: 22px;
  border: 1px solid rgba(142, 191, 220, 0.48);
  padding: 24px 22px;
  background: rgba(255, 255, 255, 0.60);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.92),
    0 18px 44px rgba(92, 138, 170, 0.12);
}

.detail-top {
  display: grid;
  grid-template-columns: 60px 1fr;
  gap: 12px;
  align-items: center;
}

.detail-symbol {
  font-size: 64px;
  line-height: 0.95;
  font-weight: 800;
}

.detail-number {
  color: var(--muted);
  font-size: 12px;
  line-height: 1;
}

.detail-cn {
  margin-top: 8px;
  font-size: 28px;
  line-height: 1.1;
  font-weight: 800;
}

.detail-en,
.detail-mass,
.detail-category,
.detail-desc {
  font-size: 14px;
  line-height: 1.45;
}

.detail-en,
.detail-desc {
  color: var(--ink-2);
}

.detail-category {
  color: var(--blue);
  font-weight: 700;
}

.atom-visual {
  position: relative;
  height: 168px;
  margin-top: 30px;
}

.orbit,
.nucleus,
.electron {
  position: absolute;
  display: block;
  border-radius: 999px;
}

.orbit {
  left: 17px;
  top: 58px;
  width: 138px;
  height: 54px;
  border: 1px solid rgba(91, 168, 255, 0.66);
}

.orbit-b {
  transform: rotate(60deg);
  border-color: rgba(120, 217, 198, 0.68);
}

.orbit-c {
  transform: rotate(-60deg);
  border-color: rgba(91, 168, 255, 0.42);
}

.nucleus {
  left: 75px;
  top: 74px;
  width: 22px;
  height: 22px;
  background: var(--blue);
  box-shadow: 0 0 22px rgba(91, 168, 255, 0.45);
}

.electron {
  left: 136px;
  top: 79px;
  width: 8px;
  height: 8px;
  background: var(--mint);
}

.side-copy {
  margin: 16px 4px 0;
  color: var(--ink-2);
  font-size: 13px;
  line-height: 1.55;
}

.count-block {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-top: 58px;
}

.count-block strong {
  font-size: 54px;
  line-height: 1;
}

.count-block span {
  color: var(--ink-2);
  font-size: 12px;
  line-height: 1.35;
  font-weight: 700;
}

.legend-panel {
  margin-top: 14px;
  border-radius: 18px;
  padding: 10px 18px;
  overflow-x: auto;
}

.legend {
  min-width: 1080px;
  display: grid;
  grid-template-columns: repeat(10, max-content);
  gap: 34px;
  align-items: center;
}

.legend-item {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--ink-2);
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}

.legend-swatch {
  width: 14px;
  height: 14px;
  border-radius: 999px;
  border: 1px solid rgba(142, 191, 220, 0.58);
  background: var(--category-color);
}

@media (max-width: 1180px) {
  .page-shell {
    padding: 28px 18px 20px;
  }

  .hero,
  .content-grid {
    grid-template-columns: 1fr;
  }

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

  .search-box {
    width: 100%;
  }

  .filter-bar {
    gap: 10px;
  }

  .detail-panel {
    min-height: 0;
  }
}

@media (max-width: 720px) {
  h1 {
    font-size: 42px;
  }

  .subtitle {
    font-size: 20px;
  }

  .table-panel {
    padding: 14px;
  }
}
