:root {
  color-scheme: dark;
  --bg: #07090d;
  --surface: #10151d;
  --line: rgba(255, 255, 255, 0.1);
  --text: #f6f3ed;
  --muted: #9aa4b2;
  --gold: #d9b56a;
  --gold-bright: #f4d48a;
  --teal: #4bd5c0;
  --green: #06c755;
  --danger: #ffb0a7;
  --shadow: 0 26px 70px rgba(0, 0, 0, 0.48);
  font-family:
    -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans TC",
    "PingFang TC", "Microsoft JhengHei", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  min-height: 100vh;
  margin: 0;
  display: grid;
  place-items: center;
  background:
    radial-gradient(circle at 50% 0%, rgba(75, 213, 192, 0.16), transparent 34%),
    radial-gradient(circle at 16% 18%, rgba(217, 181, 106, 0.16), transparent 28%),
    linear-gradient(145deg, #050609, #111722 58%, #06080c);
  color: var(--text);
}

button,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

.phone-shell {
  width: 390px;
  height: 844px;
  padding: 10px;
  border-radius: 34px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.16), rgba(255, 255, 255, 0.03)),
    #05070b;
  box-shadow: var(--shadow);
}

.app-screen {
  width: 100%;
  height: 100%;
  overflow-y: auto;
  padding: 22px 18px 18px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 28px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.05), transparent 26%),
    var(--bg);
  scrollbar-width: none;
}

.app-screen::-webkit-scrollbar {
  display: none;
}

.app-header,
.vip-card-top,
.member-line,
.section-title-row,
.info-strip,
.metric-head,
.transaction-list li,
.debt-panel-head,
.debt-list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.app-header {
  gap: 12px;
  margin-bottom: 16px;
}

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

h1 {
  margin-top: 3px;
  font-size: 24px;
  line-height: 1.15;
  font-weight: 800;
}

h2 {
  margin-top: 18px;
  font-size: 27px;
  line-height: 1;
}

h3 {
  margin-top: 3px;
  font-size: 16px;
}

.eyebrow,
.section-kicker {
  margin: 0;
  color: var(--gold);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

.privacy-switch {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
  color: var(--muted);
  font-size: 12px;
}

.privacy-switch input {
  position: absolute;
  opacity: 0;
}

.switch-track {
  position: relative;
  width: 46px;
  height: 26px;
  border-radius: 999px;
  background: #38414d;
  border: 1px solid rgba(255, 255, 255, 0.12);
  transition: 0.2s ease;
}

.switch-track::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff;
  transition: 0.2s ease;
}

.privacy-switch input:checked + .switch-track {
  background: linear-gradient(135deg, var(--gold), var(--gold-bright));
}

.privacy-switch input:checked + .switch-track::after {
  transform: translateX(20px);
  background: #17110a;
}

.connection-panel,
.metric-card,
.info-strip,
.qr-card,
.service-panel,
.api-placeholder-panel,
.transactions-card {
  border: 1px solid var(--line);
  border-radius: 16px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.07), rgba(255, 255, 255, 0.03));
}

.connection-panel {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 12px;
  padding: 12px;
}

.connection-panel strong {
  display: block;
  margin-top: 5px;
  color: var(--text);
  font-size: 13px;
  line-height: 1.25;
}

.vip-card {
  position: relative;
  overflow: hidden;
  min-height: 168px;
  padding: 18px;
  border: 1px solid rgba(244, 212, 138, 0.28);
  border-radius: 18px;
  background:
    linear-gradient(135deg, rgba(244, 212, 138, 0.18), transparent 42%),
    linear-gradient(150deg, #1c232d, #0b0f15 64%, #211a11);
  box-shadow: 0 22px 42px rgba(0, 0, 0, 0.35);
}

.vip-card::after {
  content: "";
  position: absolute;
  left: 18px;
  right: 18px;
  bottom: 54px;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(244, 212, 138, 0.38), transparent);
}

.card-glow {
  position: absolute;
  inset: auto -20px -70px 46px;
  height: 150px;
  background: radial-gradient(circle, rgba(217, 181, 106, 0.2), transparent 62%);
}

.vip-card-top,
.member-line {
  position: relative;
  z-index: 1;
}

.vip-label {
  display: inline-flex;
  padding: 6px 10px;
  border: 1px solid rgba(244, 212, 138, 0.34);
  border-radius: 999px;
  color: #1d1407;
  background: linear-gradient(135deg, var(--gold-bright), var(--gold));
  font-size: 12px;
  font-weight: 800;
}

.dolphin-mark {
  display: grid;
  place-items: center;
  width: 54px;
  height: 54px;
  border-radius: 16px;
  color: var(--gold-bright);
  border: 1px solid rgba(244, 212, 138, 0.28);
  background: rgba(255, 255, 255, 0.06);
  font-size: 14px;
  font-weight: 900;
}

.member-line {
  margin-top: 44px;
  color: var(--muted);
  font-size: 12px;
}

.member-line strong {
  color: var(--text);
  font-size: 13px;
}

.balance-panel,
.service-action-grid,
.action-grid,
.exit-summary {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.balance-panel {
  grid-template-columns: 1.18fr 0.82fr;
  margin-top: 12px;
}

.metric-card {
  min-height: 102px;
  padding: 14px;
}

.balance-card {
  background:
    radial-gradient(circle at 85% 20%, rgba(75, 213, 192, 0.18), transparent 34%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.03));
}

.metric-head {
  color: var(--muted);
  font-size: 12px;
}

.icon {
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 8px;
  color: var(--gold-bright);
  background: rgba(217, 181, 106, 0.12);
}

.metric-card strong {
  display: block;
  margin-top: 16px;
  font-size: 24px;
  line-height: 1;
}

.metric-card:not(.balance-card) strong {
  font-size: 20px;
}

.info-strip {
  margin-top: 10px;
  padding: 14px;
}

.info-strip strong {
  display: block;
  margin-top: 4px;
  font-size: 20px;
}

.ghost-button,
.text-button {
  border: 0;
  color: var(--gold-bright);
  background: transparent;
}

.ghost-button {
  min-width: 58px;
  height: 34px;
  border: 1px solid rgba(244, 212, 138, 0.24);
  border-radius: 999px;
}

.qr-card,
.service-panel,
.transactions-card {
  margin-top: 10px;
  padding: 14px;
}

.refresh-badge,
.status-pill {
  padding: 5px 9px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
}

.refresh-badge {
  color: var(--teal);
  background: rgba(75, 213, 192, 0.11);
}

.status-pill {
  max-width: 128px;
  color: var(--danger);
  background: rgba(255, 176, 167, 0.12);
  text-align: center;
}

.status-pill.is-clear {
  color: var(--teal);
  background: rgba(75, 213, 192, 0.12);
}

.qr-area {
  display: grid;
  place-items: center;
  margin-top: 14px;
  padding: 14px;
  border-radius: 14px;
  background: #f8f5ef;
  color: #111721;
}

.qr-code {
  display: grid;
  grid-template-columns: repeat(4, 24px);
  grid-auto-rows: 24px;
  gap: 8px;
  padding: 16px;
  border: 8px solid #111721;
  background:
    linear-gradient(90deg, transparent 46%, #111721 46% 54%, transparent 54%),
    linear-gradient(transparent 46%, #111721 46% 54%, transparent 54%),
    #f8f5ef;
}

.qr-code span {
  background: #111721;
}

.qr-code span:nth-child(2),
.qr-code span:nth-child(5),
.qr-code span:nth-child(8),
.qr-code span:nth-child(10),
.qr-code span:nth-child(13),
.qr-code span:nth-child(15) {
  background: transparent;
}

.qr-area p {
  margin-top: 10px;
  font-size: 12px;
  font-weight: 800;
}

.service-action-grid,
.action-grid {
  margin-top: 10px;
}

.service-action-grid {
  margin-top: 12px;
}

.primary-button,
.line-button,
.exit-button,
.pay-button,
.ecpay-placeholder-button {
  min-height: 48px;
  border: 0;
  border-radius: 14px;
  font-weight: 900;
}

.primary-button,
.pay-button,
.ecpay-placeholder-button {
  color: #17110a;
  background: linear-gradient(135deg, var(--gold-bright), var(--gold));
}

.exit-button {
  color: #06110f;
  background: linear-gradient(135deg, #79f1df, var(--teal));
}

.exit-button.is-active,
.pay-button.is-active {
  outline: 2px solid rgba(255, 255, 255, 0.42);
  outline-offset: 2px;
}

.line-button {
  color: #fff;
  background: linear-gradient(135deg, #08d35b, var(--green));
}

.service-panel[hidden],
[hidden] {
  display: none;
}

.exit-summary {
  margin-top: 12px;
}

.exit-summary div,
.payment-priority,
.topup-entry {
  min-height: 64px;
  padding: 12px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.04);
}

.exit-summary span,
.payment-priority span,
.topup-entry span,
.flow-note {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.exit-summary strong,
.payment-priority strong,
.topup-entry strong {
  display: block;
  margin-top: 5px;
  color: var(--text);
  font-size: 15px;
}

.debt-panel {
  margin-top: 12px;
  padding: 12px;
  border-radius: 12px;
  background: rgba(255, 176, 167, 0.08);
}

.debt-panel-head {
  gap: 10px;
}

.debt-panel-head span {
  color: var(--danger);
  font-weight: 900;
}

.debt-list,
.transaction-list {
  margin: 10px 0 0;
  padding: 0;
  list-style: none;
}

.debt-list li,
.transaction-list li {
  gap: 10px;
  padding: 10px 0;
  border-top: 1px solid rgba(255, 255, 255, 0.07);
}

.debt-list li {
  color: var(--muted);
  font-size: 13px;
}

.debt-list em,
.transaction-list em {
  flex: 0 0 auto;
  font-style: normal;
  font-weight: 900;
}

.payment-priority,
.topup-entry {
  margin-top: 12px;
}

.ecpay-placeholder-button {
  width: 100%;
  margin-top: 12px;
}

.flow-note {
  margin-top: 10px;
}

.api-placeholder-panel {
  display: grid;
  gap: 6px;
  margin-top: 10px;
  padding: 10px 12px;
}

.api-placeholder-panel span {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.35;
}

.transaction-list {
  display: none;
}

.transaction-list strong,
.transaction-list span {
  display: block;
}

.transaction-list strong {
  font-size: 14px;
}

.transaction-list span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}

.transaction-list em {
  font-size: 14px;
}

.credit {
  color: var(--teal);
}

.debit {
  color: var(--danger);
}

.privacy-placeholder {
  margin-top: 12px;
  padding: 16px;
  border: 1px dashed rgba(244, 212, 138, 0.28);
  border-radius: 14px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.035);
  text-align: center;
}

.privacy-placeholder strong,
.privacy-placeholder span {
  display: block;
}

.privacy-placeholder strong {
  color: var(--text);
  font-size: 14px;
}

.privacy-placeholder span {
  margin-top: 4px;
  font-size: 12px;
}

body:has(#privacyToggle:not(:checked)) .transaction-list {
  display: block;
}

body:has(#privacyToggle:not(:checked)) .privacy-placeholder {
  display: none;
}

body:has(#privacyToggle:checked) .mask-name {
  font-size: 0;
}

body:has(#privacyToggle:checked) .mask-name::after {
  content: "王 O O";
  font-size: 27px;
}

body:has(#privacyToggle:checked) .mask-balance,
body:has(#privacyToggle:checked) .mask-points,
body:has(#privacyToggle:checked) .mask-plate,
body:has(#privacyToggle:checked) .mask-code {
  color: transparent;
  position: relative;
}

body:has(#privacyToggle:checked) .mask-balance::after,
body:has(#privacyToggle:checked) .mask-points::after,
body:has(#privacyToggle:checked) .mask-plate::after,
body:has(#privacyToggle:checked) .mask-code::after {
  position: absolute;
  inset: 0;
  color: var(--text);
}

body:has(#privacyToggle:checked) .mask-balance::after {
  content: "NT$ ****";
}

body:has(#privacyToggle:checked) .mask-points::after {
  content: "**** pts";
}

body:has(#privacyToggle:checked) .mask-plate::after {
  content: "ABC-****";
}

body:has(#privacyToggle:checked) .mask-code::after {
  content: "D-********001";
}

@media (max-width: 430px) {
  body {
    display: block;
    background: var(--bg);
  }

  .phone-shell {
    width: 100vw;
    height: 100vh;
    padding: 0;
    border-radius: 0;
  }

  .app-screen {
    border: 0;
    border-radius: 0;
  }
}
