:root {
  color: #142033;
  background: #eef3f8;
  font-family:
    "Aptos",
    "Segoe UI",
    "Noto Sans TC",
    "Noto Sans SC",
    "PingFang TC",
    "Microsoft JhengHei",
    Arial,
    sans-serif;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
  --navy-950: #07162c;
  --navy-900: #0a1d38;
  --navy-800: #0f2a50;
  --navy-700: #163d70;
  --blue-500: #2f7ed8;
  --cyan-300: #8fd7ff;
  --gold-400: #d6ae55;
  --ink-900: #142033;
  --ink-600: #607089;
  --line: #d9e2ee;
  --surface: #ffffff;
  --surface-blue: #f5f8fc;
  --radius: 10px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-width: 320px;
  overflow-x: hidden;
}

button,
input,
select {
  font: inherit;
}

.app-shell {
  min-height: 100vh;
  overflow-x: hidden;
  padding: 22px clamp(14px, 2vw, 28px);
  background:
    linear-gradient(180deg, rgba(7, 22, 44, 0.06), transparent 340px),
    #eef3f8;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: #fff;
  font-size: 22px;
  font-weight: 900;
  text-decoration: none;
}

.brand img {
  width: 58px;
  height: 58px;
  object-fit: contain;
}

.hero-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 12px;
}

.language-switch {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  padding: 4px;
  background: rgba(255, 255, 255, 0.09);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 999px;
}

.language-switch button {
  min-width: 38px;
  min-height: 32px;
  color: #c9d8ec;
  background: transparent;
  border: 0;
  border-radius: 999px;
  cursor: pointer;
  font-weight: 900;
}

.language-switch button.active {
  color: var(--navy-950);
  background: #fff;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 22px;
  align-items: stretch;
  max-width: 1680px;
  margin: 0 auto 18px;
  padding: 26px;
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius);
  background:
    linear-gradient(135deg, rgba(7, 22, 44, 0.98), rgba(13, 42, 80, 0.96)),
    radial-gradient(circle at 84% 8%, rgba(47, 126, 216, 0.28), transparent 30%);
  box-shadow: 0 22px 60px rgba(7, 22, 44, 0.2);
}

.hero-copy {
  position: relative;
  overflow: hidden;
  min-height: 280px;
  padding: 0;
}

.report-panel,
.toolbar,
.table-section {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: 0 18px 40px rgba(13, 38, 73, 0.08);
}

.hero-copy::after {
  content: "";
  position: absolute;
  inset: auto -60px -120px auto;
  width: 360px;
  height: 360px;
  border: 1px solid rgba(143, 215, 255, 0.22);
  border-radius: 50%;
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  position: relative;
  z-index: 1;
  max-width: min(100%, 860px);
  overflow-wrap: anywhere;
  font-size: clamp(34px, 4.8vw, 68px);
  line-height: 1.08;
  letter-spacing: 0;
}

.hero-note {
  position: relative;
  z-index: 1;
  max-width: min(100%, 760px);
  margin-top: 14px;
  color: rgba(255, 255, 255, 0.78);
  font-size: 16px;
  font-weight: 700;
  line-height: 1.6;
}

.report-panel {
  display: grid;
  align-content: start;
  gap: 14px;
  padding: 22px;
  border-color: rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.96);
}

.report-panel label {
  color: var(--ink-600);
  font-size: 13px;
  font-weight: 900;
}

.report-panel select {
  width: 100%;
  min-height: 48px;
  padding: 0 12px;
  color: var(--ink-900);
  background: #fff;
  border: 1px solid #cbd7e6;
  border-radius: 8px;
  outline: 0;
}

.report-panel select:focus,
.search-box:focus-within,
.cash-value-filter:focus-within {
  border-color: var(--blue-500);
  box-shadow: 0 0 0 4px rgba(47, 126, 216, 0.14);
}

.report-meta {
  display: grid;
  gap: 4px;
  padding: 14px 0 0;
  border-top: 1px solid var(--line);
}

.meta-key {
  color: var(--ink-600);
  font-size: 12px;
  font-weight: 900;
}

.report-meta span:last-child {
  color: var(--navy-900);
  font-size: 20px;
  font-weight: 900;
}

.toolbar {
  display: flex;
  gap: 14px;
  align-items: center;
  justify-content: flex-start;
  max-width: 1680px;
  margin: 0 auto 18px;
  padding: 14px;
}

.search-box {
  display: flex;
  align-items: center;
  gap: 10px;
  width: min(100%, 520px);
  min-height: 46px;
  padding: 0 14px;
  background: #fff;
  border: 1px solid #cbd7e6;
  border-radius: 8px;
}

.search-icon {
  width: 14px;
  height: 14px;
  border: 2px solid var(--ink-600);
  border-radius: 50%;
  box-shadow: 7px 7px 0 -5px var(--ink-600);
  flex: 0 0 auto;
}

.search-box input {
  width: 100%;
  min-width: 0;
  color: var(--ink-900);
  border: 0;
  outline: 0;
}

.search-box input::placeholder {
  color: #8b98aa;
}

.cash-value-filter {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  min-height: 46px;
  padding: 0 14px;
  color: var(--ink-900);
  background: #fff;
  border: 1px solid #cbd7e6;
  border-radius: 8px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 900;
  white-space: nowrap;
}

.cash-value-filter input {
  width: 17px;
  height: 17px;
  margin: 0;
  accent-color: var(--blue-500);
}

.table-section {
  width: min(100%, 1680px);
  max-width: none;
  margin: 0 auto;
  overflow: hidden;
}

.table-heading {
  display: flex;
  gap: 18px;
  align-items: center;
  justify-content: space-between;
  padding: 20px 22px;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, #fff, #f9fbfe);
}

.table-heading h2 {
  color: var(--navy-900);
  font-size: 23px;
  line-height: 1.25;
  letter-spacing: 0;
}

.table-heading p {
  margin-top: 7px;
  color: var(--ink-600);
  font-size: 14px;
}

.table-wrap {
  position: relative;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-gutter: stable;
}

.table-wrap::after {
  content: "";
  position: sticky;
  right: 0;
  display: block;
  float: right;
  width: 28px;
  height: 1px;
  margin-top: -1px;
  pointer-events: none;
  box-shadow: -24px 0 24px rgba(255, 255, 255, 0.92);
}

table {
  width: 100%;
  min-width: 100%;
  table-layout: fixed;
  border-collapse: separate;
  border-spacing: 0;
}

th,
td {
  height: 46px;
  padding: 9px 8px;
  border-right: 1px solid #dde6f1;
  border-bottom: 1px solid #dde6f1;
  text-align: center;
  vertical-align: middle;
  font-size: 14px;
}

th {
  position: sticky;
  top: 0;
  z-index: 1;
  color: #fff;
  background: var(--navy-800);
  font-weight: 900;
}

.sticky-table-header {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 40;
  display: none;
  overflow: hidden;
  pointer-events: none;
  border-bottom: 1px solid #dde6f1;
  box-shadow: 0 10px 22px rgba(7, 22, 44, 0.18);
}

.sticky-table-header.is-visible {
  display: block;
}

.sticky-table-header table {
  min-width: 0;
}

.sticky-table-header th {
  position: static;
}

tbody tr:nth-child(odd) {
  background: #f3f8fc;
}

tbody tr:nth-child(even) {
  background: #fff;
}

tbody tr:hover {
  background: #e8f3ff;
}

.product-col {
  width: 240px;
  min-width: 240px;
  text-align: left;
  font-weight: 900;
}

td.product-col[rowspan] {
  vertical-align: middle;
}

th.product-col {
  z-index: 3;
  background: var(--navy-900);
}

td.product-col {
  color: var(--navy-900);
  background: inherit;
}

.category-col {
  width: 190px;
  min-width: 190px;
  color: #243653;
  font-weight: 800;
}

th.category-col {
  color: #fff;
}

.currency-col {
  width: 56px;
  min-width: 56px;
  color: #243653;
  font-weight: 800;
}

th.currency-col {
  color: #fff;
}

.payment-col {
  width: 72px;
  min-width: 72px;
  color: #243653;
  font-weight: 800;
}

th.payment-col {
  color: #fff;
}

.type-col {
  width: 100px;
  min-width: 100px;
  color: #243653;
  font-weight: 800;
}

th.type-col {
  color: #fff;
}

.year-col {
  width: 74px;
  min-width: 74px;
}

.cell {
  color: var(--ink-900);
}

.cell-muted {
  color: #9aa7b8;
  font-size: 14px;
  font-weight: 400;
}

.cell-implicit-muted {
  color: #9aa7b8;
  font-size: 14px;
  font-weight: 400;
}

.cell-note {
  color: #9aa7b8;
  font-size: 14px;
  font-weight: 400;
}

.cell-perfect,
.cell-high {
  color: #0b63ce;
  font-weight: 900;
}

.cell-low {
  color: #b52b38;
  font-weight: 900;
}

.cell-empty {
  color: transparent;
}

.rate-with-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
}

.site-footer {
  max-width: 1400px;
  margin: 18px auto 0;
  padding: 18px 4px 6px;
  color: var(--ink-600);
  font-size: 14px;
  font-weight: 800;
  text-align: center;
}

@media (max-width: 1120px) {
  .hero {
    grid-template-columns: 1fr;
  }

  .hero-copy {
    min-height: 190px;
  }

  .report-panel {
    max-width: 520px;
  }
}

@media (max-width: 860px) {
  .app-shell {
    padding: 14px;
  }

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

  .language-switch {
    width: 88px;
  }

  .hero {
    grid-template-columns: 1fr;
    padding: 20px;
  }

  .hero-copy {
    width: 100%;
    min-height: auto;
    overflow: visible;
  }

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

  .search-box {
    width: 100%;
  }

  .cash-value-filter {
    justify-content: flex-start;
    width: 100%;
    white-space: normal;
  }

  h1 {
    max-width: 100%;
    font-size: 34px;
    line-height: 1.14;
  }

  .hero-note {
    max-width: 100%;
    font-size: 14px;
    line-height: 1.55;
  }

  .product-col {
    position: static;
    width: 180px;
    min-width: 180px;
    max-width: 180px;
    white-space: normal;
  }

  th.product-col,
  td.product-col {
    background: inherit;
  }

  th.product-col {
    background: var(--navy-900);
  }

  .category-col {
    width: 150px;
    min-width: 150px;
  }

  .payment-col {
    width: 76px;
    min-width: 76px;
  }

  .type-col {
    width: 104px;
    min-width: 104px;
  }

  .currency-col {
    width: 64px;
    min-width: 64px;
  }

  .year-col {
    width: 78px;
    min-width: 78px;
  }

  th,
  td {
    padding: 9px 8px;
    font-size: 13px;
  }
}

@media (max-width: 540px) {
  .brand {
    font-size: 18px;
  }

  .brand img {
    width: 48px;
    height: 48px;
  }

  .brand span {
    white-space: normal;
  }

  h1 {
    font-size: 30px;
    line-height: 1.16;
  }
}
