:root {
  --bg: #8fd8e3;
  --panel: rgba(223, 242, 246, 0.74);
  --panel-2: rgba(239, 249, 251, 0.82);
  --border: rgba(230, 247, 251, 0.95);
  --border-soft: rgba(122, 181, 201, 0.34);
  --text: #2f7fa1;
  --text-strong: #1f6f92;
  --muted: #5d95ac;
  --shadow: 0 16px 36px rgba(39, 109, 140, 0.12);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  font-size: 16px;
  line-height: 1.5;
  -webkit-text-size-adjust: 100%;
  background:
    radial-gradient(
      circle at 20% 16%,
      rgba(214, 252, 255, 0.3) 0%,
      rgba(214, 252, 255, 0) 24%
    ),
    radial-gradient(
      circle at 82% 78%,
      rgba(157, 224, 255, 0.22) 0%,
      rgba(157, 224, 255, 0) 26%
    ),
    linear-gradient(135deg, #a8e2e5 0%, #86d9e4 36%, #6fcfe4 68%, #61c6e0 100%);
  color: var(--text);
  font-family:
    -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans TC",
    "PingFang TC", "Microsoft JhengHei", sans-serif;
}

body {
  min-height: 100vh;
}

.page {
  min-height: 100vh;
  background:
    linear-gradient(rgba(255, 255, 255, 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.045) 1px, transparent 1px),
    radial-gradient(
      circle at 26% 18%,
      rgba(232, 255, 255, 0.18) 0%,
      rgba(232, 255, 255, 0) 18%
    ),
    radial-gradient(
      circle at 76% 72%,
      rgba(189, 236, 255, 0.16) 0%,
      rgba(189, 236, 255, 0) 20%
    ),
    linear-gradient(135deg, #a7e3e2 0%, #8ddbe5 34%, #74d0e5 68%, #63c7e2 100%);
  background-size:
    28px 28px,
    28px 28px,
    auto,
    auto,
    auto;
}

.container {
  max-width: 1680px;
  margin: 0 auto;
  padding: 32px 24px 48px;
}

.hero {
  display: flex;
  gap: 24px;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 24px;
}

.hero-title {
  flex: 1 1 auto;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--muted);
  font-size: 15px;
}

h1 {
  margin: 0;
  color: var(--text-strong);
  font-size: 34px;
  line-height: 1.15;
  letter-spacing: -0.02em;
}

.hero-desc {
  margin: 12px 0 0;
  max-width: 900px;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.7;
}

.stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(140px, 1fr));
  gap: 12px;
  min-width: 560px;
}

.stat-card,
.filter-card,
.mobile-card,
.mobile-empty {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 22px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(8px);
}

.stat-card {
  padding: 16px;
}

.stat-label {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.stat-value {
  margin-top: 8px;
  color: var(--text-strong);
  font-size: 30px;
  font-weight: 700;
  letter-spacing: -0.03em;
  text-align: center;
}

.filters {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(220px, 0.8fr);
  gap: 12px;
  margin-bottom: 10px;
}

.filter-card {
  padding: 12px;
}

.filter-card label {
  display: block;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.mobile-hint {
  margin: 0 0 16px;
  color: #437f98;
  font-size: 14px;
}

input,
select {
  width: 100%;
  height: 46px;
  border-radius: 14px;
  border: 1px solid rgba(188, 231, 242, 0.95);
  background: var(--panel-2);
  color: var(--text-strong);
  padding: 0 14px;
  font-size: 15px;
  outline: none;
}

input::placeholder {
  color: rgba(95, 152, 174, 0.72);
}

input:focus,
select:focus {
  border-color: rgba(112, 183, 206, 0.9);
  box-shadow: 0 0 0 3px rgba(163, 224, 240, 0.3);
}

.table-shell {
  overflow: hidden;
  border-radius: 28px;
  border: 1px solid var(--border);
  background: rgba(221, 243, 247, 0.7);
  box-shadow: var(--shadow);
  backdrop-filter: blur(10px);
}

.table-wrap {
  overflow-x: auto;
}

table {
  width: 100%;
  min-width: 1220px;
  border-collapse: collapse;
  font-size: 15px;
}

thead {
  background: rgba(212, 238, 245, 0.88);
}

th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: rgba(212, 238, 245, 0.94);
  color: #5a94ac;
  text-align: center;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.02em;
  padding: 16px;
  border-bottom: 1px solid rgba(184, 224, 236, 0.9);
  white-space: nowrap;
}

td {
  padding: 16px;
  color: var(--text);
  border-bottom: 1px solid rgba(179, 221, 232, 0.8);
  vertical-align: middle;
  text-align: center;
}

tbody tr:hover {
  background: rgba(255, 255, 255, 0.18);
}

.name-cell {
  font-weight: 700;
  color: var(--text-strong);
  white-space: nowrap;
}

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
}

.tag,
.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.2;
  white-space: nowrap;
}

.tag {
  border: 1px solid rgba(255, 255, 255, 0.34);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.28);
}

.badge {
  border: 1px solid transparent;
}

.badge-yes {
  background: rgba(108, 184, 118, 0.92);
  color: #f4fff4;
  border-color: rgba(79, 154, 89, 0.26);
}

.badge-no {
  background: rgba(209, 109, 119, 0.88);
  color: #fff7f7;
  border-color: rgba(190, 88, 98, 0.26);
}

.type-一般 {
  background: #b4ada5;
  color: #ffffff;
}
.type-草 {
  background: #63bc5a;
  color: #ffffff;
}
.type-火 {
  background: #f6a14b;
  color: #ffffff;
}
.type-水 {
  background: #5a9edc;
  color: #ffffff;
}
.type-電 {
  background: #f2cf44;
  color: #4c3900;
}
.type-蟲 {
  background: #a8bd2f;
  color: #ffffff;
}
.type-飛行 {
  background: #a6b7f5;
  color: #24345e;
}
.type-岩石 {
  background: #c9b67c;
  color: #4f3d12;
}
.type-毒 {
  background: #b763cf;
  color: #ffffff;
}
.type-地面 {
  background: #d7905b;
  color: #fff8ef;
}
.type-冰 {
  background: #97d9d7;
  color: #184041;
}
.type-格鬥 {
  background: #d84a64;
  color: #ffffff;
}
.type-超能力 {
  background: #ec8d88;
  color: #ffffff;
}
.type-幽靈 {
  background: #6d6ac9;
  color: #ffffff;
}
.type-龍 {
  background: #0c73bf;
  color: #ffffff;
}
.type-惡 {
  background: #5b5865;
  color: #ffffff;
}
.type-鋼 {
  background: #6f9dad;
  color: #ffffff;
}
.type-妖精 {
  background: #e99ae9;
  color: #ffffff;
}

.center-col,
.num-cell,
.supermax-cell {
  text-align: center;
}

.count-cell {
  min-width: 220px;
}

.energy-cell {
  min-width: 220px;
}

.desktop-energy-panel {
  width: min(100%, 220px);
  margin: 0 auto;
  padding: 14px 16px;
  border-radius: 18px;
  background: rgba(244, 252, 255, 0.74);
  border: 1px solid rgba(194, 228, 237, 0.9);
  text-align: center;
}

.desktop-energy-kicker {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.desktop-energy-total {
  margin-top: 6px;
  color: var(--text-strong);
  font-size: 32px;
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.04em;
}

.desktop-energy-note {
  margin-top: 8px;
  color: #3b7392;
  font-size: 13px;
  line-height: 1.5;
}

.energy-cell .row-extra {
  display: grid;
  gap: 12px;
  justify-items: center;
}

.energy-cell .control-block {
  margin-top: 0;
}

.count-wrap {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.count-input {
  width: 84px;
  text-align: center;
  font-weight: 700;
}

.count-max {
  color: var(--muted);
  font-size: 13px;
  white-space: nowrap;
}

.empty-row td,
.mobile-empty {
  text-align: center;
  color: var(--muted);
  padding: 40px 16px;
}

.mobile-only {
  display: none;
}

.mobile-list {
  display: none;
  gap: 14px;
}

.mobile-card {
  padding: 16px;
}

.mobile-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.mobile-title-wrap {
  min-width: 0;
  flex: 1 1 auto;
}

.mobile-title-row {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.mobile-name {
  margin: 0;
  color: var(--text-strong);
  font-size: 20px;
  font-weight: 800;
  line-height: 1.2;
  min-width: 0;
}

.mobile-priority-inline {
  flex-shrink: 0;
}

.mobile-tags {
  margin-top: 10px;
}

.mobile-tags-top {
  margin-top: 0;
  justify-content: flex-end;
  flex: 0 0 auto;
  flex-wrap: nowrap;
  max-width: none;
  white-space: nowrap;
  gap: 6px;
}

.energy-hero {
  margin-top: 14px;
  padding: 14px;
  border-radius: 20px;
  background: rgba(244, 252, 255, 0.72);
  border: 1px solid rgba(197, 230, 239, 0.9);
  text-align: center;
}

.energy-kicker {
  color: var(--text-strong);
  font-size: 15px;
  font-weight: 800;
}

.energy-value {
  margin-top: 8px;
  color: var(--text-strong);
  font-size: 48px;
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.04em;
}

.energy-note {
  margin-top: 10px;
  color: #3b7392;
  font-size: 13px;
  line-height: 1.5;
}

.energy-note.is-done {
  color: #107267;
  font-weight: 700;
}

.energy-note.is-warning {
  color: #8a4b16;
  font-weight: 700;
}

.mobile-meta {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 14px;
}

.mobile-meta-item {
  padding: 12px;
  border-radius: 16px;
  background: rgba(245, 252, 255, 0.58);
  border: 1px solid rgba(194, 228, 237, 0.82);
  text-align: center;
}

.mobile-meta-label {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  line-height: 1.45;
}

.mobile-meta-value {
  margin-top: 6px;
  color: var(--text-strong);
  font-size: 18px;
  font-weight: 800;
}

.mobile-controls {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px dashed rgba(95, 159, 182, 0.35);
}

.control-block + .control-block {
  margin-top: 12px;
}

.control-label {
  display: block;
  margin-bottom: 8px;
  color: #487e98;
  font-size: 13px;
  font-weight: 800;
  text-align: center;
}

.super-top-control {
  margin: 0 auto;
}

.super-top-control .control-label {
  width: 100%;
}

.super-top-control .super-top-select {
  width: 100%;
  margin: 0 auto;
  display: block;
  text-align: center;
  text-align-last: center;
}

.row-extra .super-top-control {
  width: min(100%, 220px);
}

.mobile-controls .super-top-control {
  width: 100%;
}

.control-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: min(100%, 280px);
  margin: 0 auto;
}

.control-row .count-input {
  width: 100%;
  max-width: 120px;
  height: 46px;
  font-size: 16px;
}

.desktop-note {
  display: block;
}

.mobile-note {
  display: none;
}

@media (max-width: 1100px) {
  .hero {
    flex-direction: column;
    align-items: stretch;
  }

  .stats {
    min-width: 0;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 900px) {
  .desktop-only {
    display: none;
  }

  .mobile-only {
    display: grid;
  }

  .mobile-list {
    display: grid;
  }

  .mobile-hint {
    display: block;
  }
}

@media (max-width: 720px) {
  .container {
    padding: 20px 14px 28px;
  }

  h1 {
    font-size: 28px;
  }

  .hero-desc {
    font-size: 14px;
  }

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

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

  .tag,
  .badge {
    font-size: 12px;
  }

  .mobile-card-head {
    gap: 8px;
  }

  .mobile-title-row {
    gap: 8px;
    align-items: flex-start;
  }

  .mobile-name {
    font-size: 18px;
  }

  .mobile-tags-top {
    max-width: none;
    gap: 4px;
  }

  .mobile-tags-top .tag {
    padding: 4px 8px;
  }

  .energy-value {
    font-size: 40px;
  }

  .mobile-meta {
    grid-template-columns: 1fr;
  }

  .control-row {
    align-items: center;
    width: min(100%, 280px);
  }

  .control-row .count-input {
    flex: 1 1 auto;
    max-width: none;
  }

  .mobile-controls .super-top-control {
    width: 100%;
  }
}
