:root {
  --bg: #f4f2ed;
  --surface: #faf9f6;
  --text: #171714;
  --text-dim: #67645d;
  --border: #d8d5ce;
  --accent: #d85f24;
  --font: "Noto Sans TC", "PingFang TC", "Microsoft JhengHei", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  margin: 0;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

body,
button,
input {
  font-family: var(--font);
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  color: inherit;
}

.container {
  width: min(100% - 48px, 1120px);
  margin-inline: auto;
}

/* Header */

.site-header {
  position: relative;
  z-index: 10;
  border-bottom: 1px solid var(--border);
}

.site-header .container {
  width: 100%;
  max-width: none;
  min-height: 80px;
  padding: 16px 28px;
  display: flex;
  align-items: center;
  gap: 32px;
}

.site-logo-link {
  position: relative;
  isolation: isolate;
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  padding: 9px 12px;
}

.site-logo-link::before {
  content: none;
}

.site-logo {
  display: block;
  width: 176px;
  height: auto;
}

.site-nav {
  min-width: 0;
  margin-left: auto;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 4px;
  flex-wrap: nowrap;
}

.nav-pill {
  position: relative;
  appearance: none;
  padding: 8px 11px;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--text-dim);
  font-size: 15px;
  font-weight: 600;
  line-height: 1.4;
  cursor: pointer;
  transition: color 160ms ease;
}

.nav-pill::after {
  position: absolute;
  right: 11px;
  bottom: 4px;
  left: 11px;
  height: 1px;
  background: currentColor;
  content: "";
  transform: scaleX(0);
  transform-origin: center;
  transition: transform 160ms ease;
}

.nav-pill:hover,
.nav-pill:focus-visible,
.nav-pill[aria-current="page"] {
  color: var(--text);
}

.nav-pill:hover::after,
.nav-pill:focus-visible::after,
.nav-pill[aria-current="page"]::after {
  transform: scaleX(1);
}

.language-switcher {
  position: relative;
  flex: 0 0 auto;
  margin-left: 6px;
}

.language-trigger {
  min-height: 36px;
  padding: 7px 11px;
  border: 1px solid rgba(44, 40, 35, 0.22);
  border-radius: 999px;
  background: rgba(250, 247, 239, 0.86);
  color: var(--text);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font: inherit;
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
  backdrop-filter: blur(8px);
}

.language-trigger:hover,
.language-trigger:focus-visible {
  border-color: rgba(44, 40, 35, 0.5);
  background: rgba(255, 253, 247, 0.96);
}

.language-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 100;
  min-width: 190px;
  padding: 6px;
  border: 1px solid rgba(44, 40, 35, 0.18);
  border-radius: 14px;
  background: rgba(255, 253, 247, 0.98);
  box-shadow: 0 16px 38px rgba(39, 34, 29, 0.18);
  backdrop-filter: blur(12px);
}

.language-menu[hidden] { display: none; }

.language-menu button {
  width: 100%;
  padding: 9px 11px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: 0.85rem;
  text-align: left;
  cursor: pointer;
}

.language-menu button:hover,
.language-menu button:focus-visible,
.language-menu button[aria-current="true"] {
  background: rgba(92, 129, 188, 0.14);
}

.nav-pill:focus-visible,
.footer-nav a:focus-visible,
.site-logo-link:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 4px;
}

/* Homepage */

main {
  position: relative;
  z-index: 1;
  flex: 1 0 auto;
  min-height: calc(100vh - 228px);
}

.geometry-hero {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  background: #f8f3e8;
}

.home-page .site-header {
  position: fixed;
  z-index: 10;
  width: 100%;
  border-bottom: 0;
}

.home-page main {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  pointer-events: none;
}

.home-page .site-logo-link {
  z-index: 1;
}

.geometry-canvas,
.shape {
  position: absolute;
}

.geometry-canvas {
  width: max(100vw, 177.7778vh);
  height: max(100vh, 56.25vw);
  top: 50%;
  left: 50%;
  z-index: 0;
  transform: translate(-50%, -50%);
}

.logo-backdrop {
  position: fixed;
  z-index: 1;
  width: 560px;
  height: 150px;
  top: 0;
  left: 0;
  overflow: hidden;
}

.shape {
  display: block;
  border-radius: 50%;
}

.shape-ring {
  width: 720px;
  aspect-ratio: 1;
  top: -666px;
  left: -230px;
  background: #315c8c;
}

.shape-logo-intersection {
  z-index: 1;
  width: 360px;
  height: 190px;
  top: -112px;
  left: 94px;
  border-radius: 46% 54% 61% 39% / 58% 44% 56% 42%;
  background: #e98a4a;
  transform: rotate(-8deg);
}

.shape-solid {
  width: 19%;
  aspect-ratio: 1;
  right: -4%;
  bottom: 8%;
  background: #e98a4a;
}

.shape-outline {
  width: 18%;
  aspect-ratio: 1;
  top: 24%;
  left: 12%;
  border: clamp(14px, 2vw, 28px) solid #a9c9df;
}

.shape-dot {
  width: 2.8%;
  aspect-ratio: 1;
  top: 20%;
  right: 18%;
  background: #e98a4a;
}

.shape-arc {
  width: 26%;
  aspect-ratio: 1;
  left: -10%;
  bottom: -16%;
  border: clamp(24px, 3.5vw, 48px) solid #315c8c;
  border-right-color: transparent;
  transform: rotate(28deg);
}

.shape-polygon {
  width: 14%;
  aspect-ratio: 1;
  top: 42%;
  right: 28%;
  border-radius: 0;
  background: #315c8c;
  clip-path: polygon(50% 0, 93% 23%, 100% 70%, 63% 100%, 14% 84%, 0 35%);
  transform: rotate(12deg);
}

.shape-blob {
  width: 21%;
  aspect-ratio: 1.18;
  left: 31%;
  bottom: 4%;
  border-radius: 58% 42% 68% 32% / 35% 61% 39% 65%;
  background: #a9c9df;
  transform: rotate(-14deg);
}

.shape-curve {
  width: 25%;
  height: 14%;
  top: 14%;
  right: 30%;
  border: 3px solid #315c8c;
  border-radius: 50%;
  background: transparent;
  transform: rotate(-18deg);
}

.homepage-content-space {
  width: min(100% - 48px, 1120px);
  min-height: calc(100vh - 104px);
  margin-inline: auto;
}

.homepage-scroll-layer {
  position: relative;
  z-index: 2;
  min-height: calc(100vh - 104px);
  padding-top: 96px;
  pointer-events: auto;
}

/* Page content */

.legal-hero {
  padding-top: 88px;
  padding-bottom: 36px;
  border-bottom: 1px solid var(--border);
}

.support-page .legal-hero {
  border-bottom: 0;
}

.legal-hero .eyebrow {
  margin: 0 0 12px;
  color: var(--accent);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.legal-hero h1 {
  margin: 0;
  font-size: clamp(32px, 5vw, 52px);
  font-weight: 700;
  letter-spacing: -0.035em;
  line-height: 1.15;
}

.legal-updated {
  margin: 16px 0 0;
  color: var(--text-dim);
  font-size: 14px;
}

.legal-body {
  max-width: 760px;
  padding-top: 56px;
  padding-bottom: 104px;
}

.legal-body h2 {
  margin: 44px 0 12px;
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.legal-body h2:first-child {
  margin-top: 0;
}

.legal-body p,
.legal-body li {
  color: var(--text-dim);
  font-size: 15px;
}

.legal-body p {
  margin: 0 0 18px;
}

.legal-body ul {
  margin: 0 0 22px;
  padding-left: 22px;
}

.legal-body li + li {
  margin-top: 8px;
}

.legal-body a {
  color: var(--text);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.empty-state {
  padding: 32px 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.empty-state h2 {
  margin: 0 0 8px;
}

.empty-state p {
  max-width: 560px;
  margin: 0;
}

/* Footer */

.site-footer {
  position: relative;
  z-index: 5;
  flex-shrink: 0;
  margin-top: auto;
  border-top: 1px solid var(--border);
  padding: 30px 0 34px;
  background: var(--bg);
}

.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.footer-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
}

.footer-nav a,
.footer-copy {
  color: var(--text-dim);
  font-size: 13px;
}

.footer-nav a:hover {
  color: var(--text);
}

.footer-nav a[aria-current="page"] {
  color: var(--text);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 4px;
}

.footer-copy {
  margin: 0;
  text-align: right;
}

/* Login modal */

.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(23, 23, 20, 0.52);
}

.modal-overlay[hidden] {
  display: none;
}

.modal {
  position: relative;
  width: min(100%, 380px);
  padding: 36px;
  border: 1px solid var(--border);
  background: var(--surface);
  box-shadow: 0 24px 70px rgba(23, 23, 20, 0.16);
}

.modal-close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 34px;
  height: 34px;
  border: 0;
  background: transparent;
  color: var(--text-dim);
  font-size: 22px;
  cursor: pointer;
}

.modal-close:hover {
  color: var(--text);
}

.modal h2 {
  margin: 0 0 24px;
  font-size: 24px;
}

.account-modal {
  width: min(100%, 520px);
  max-height: min(760px, calc(100vh - 48px));
  overflow-y: auto;
  border-radius: 22px;
}

.account-summary {
  display: flex;
  flex-direction: column;
  gap: 5px;
  margin: -8px 0 24px;
  padding: 18px 20px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.7);
}

.account-summary span { font-size: 20px; font-weight: 700; }
.account-summary small { color: var(--text-dim); }

.account-section {
  border-top: 1px solid var(--border);
  padding: 16px 0;
}

.account-section summary {
  font-weight: 700;
  cursor: pointer;
}

.account-form {
  display: grid;
  gap: 14px;
  padding-top: 18px;
}

.account-form label { display: grid; gap: 7px; font-size: 13px; font-weight: 600; }
.account-form input {
  width: 100%;
  padding: 11px 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #fff;
  color: var(--text);
}

.account-hint, .account-status, .account-info p {
  margin: 0;
  color: var(--text-dim);
  font-size: 13px;
}

.account-info h3 { margin: 0 0 7px; font-size: 15px; }
.account-logout {
  width: 100%;
  margin-top: 8px;
  padding: 12px 18px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: #171714;
  color: #fff;
  font-weight: 700;
  cursor: pointer;
}

.auth-required-state {
  display: grid;
  justify-items: start;
  gap: 12px;
  padding: 34px 0;
}

.auth-required-state h2, .auth-required-state p { margin: 0; }

.finance-body { max-width: 1040px; }
.finance-panel {
  padding: clamp(22px, 4vw, 42px);
  border: 1px solid rgba(44, 40, 35, 0.16);
  border-radius: 26px;
  background: rgba(255, 253, 247, 0.92);
  box-shadow: 0 20px 60px rgba(44, 40, 35, 0.1);
  backdrop-filter: blur(14px);
}
.finance-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 28px; }
.finance-heading h2 { margin: 0 0 10px; font-size: clamp(26px, 4vw, 38px); }
.finance-heading p { margin: 0; }
.currency-control { display: grid; gap: 7px; min-width: 130px; font-size: 12px; font-weight: 700; }
.currency-control select {
  appearance: none;
  padding: 10px 46px 10px 13px;
  border: 1px solid var(--border);
  border-radius: 11px;
  background-color: #fff;
  background-image:
    linear-gradient(45deg, transparent 50%, rgba(44, 40, 35, 0.72) 50%),
    linear-gradient(135deg, rgba(44, 40, 35, 0.72) 50%, transparent 50%);
  background-position:
    calc(100% - 25px) 50%,
    calc(100% - 19px) 50%;
  background-size: 6px 6px, 6px 6px;
  background-repeat: no-repeat;
  color: var(--text);
  font: inherit;
}
.finance-status { margin-top: 30px; padding: clamp(24px, 5vw, 42px); border-radius: 18px; background: #edf2f5; }
.finance-status span { display: block; color: var(--text-dim); font-size: 14px; font-weight: 700; }
.finance-status strong { display: block; margin-top: 18px; font-size: clamp(36px, 7vw, 68px); letter-spacing: -0.045em; line-height: 1; }
.finance-status.is-negative strong { color: #a33a31; }
.finance-status.is-positive strong { color: #315c8c; }
.finance-status.is-neutral strong { color: var(--text); }
.finance-meta { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 10px 24px; margin-top: 20px; color: var(--text-dim); font-size: 12px; }
.finance-note { margin-top: 18px; padding: 16px 18px; border-left: 4px solid #315c8c; background: rgba(49, 92, 140, 0.06); }
.finance-note p { margin: 6px 0 0; }
.support-coming-soon { margin-top: 26px; padding: 14px 18px; border: 1px dashed var(--border); border-radius: 999px; text-align: center; font-weight: 700; }
.finance-loading { color: var(--text-dim); }

@media (max-width: 700px) {
  .finance-heading { align-items: stretch; flex-direction: column; }
  .currency-control { width: 150px; }
  .finance-status { padding: 24px 20px; }
}

.finance-admin-page { min-height: 100vh; padding: 40px 20px; }
.finance-admin-shell { width: min(100%, 760px); margin: 0 auto; }
.finance-admin-logo img { width: 150px; height: auto; }
.finance-admin-card { margin-top: 28px; padding: clamp(24px, 5vw, 48px); border-radius: 26px; background: rgba(255, 253, 247, 0.94); box-shadow: 0 20px 70px rgba(44, 40, 35, 0.14); }
.finance-admin-card h1 { margin: 0 0 10px; }
.finance-admin-form { display: grid; gap: 18px; margin-top: 30px; }
.finance-admin-form label { display: grid; gap: 7px; font-size: 13px; font-weight: 700; }
.finance-admin-form input, .finance-admin-form textarea { width: 100%; padding: 11px 12px; border: 1px solid var(--border); border-radius: 10px; background: #fff; color: var(--text); font: inherit; font-weight: 400; }
.finance-admin-form fieldset { margin: 0; padding: 18px; border: 1px solid var(--border); border-radius: 14px; }
.finance-admin-form legend { padding: 0 8px; font-size: 13px; font-weight: 700; }
.finance-admin-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
@media (max-width: 560px) { .finance-admin-grid { grid-template-columns: 1fr; } }

.login-form {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.login-form label {
  margin-top: 12px;
  font-size: 14px;
  font-weight: 600;
}

.login-form label:first-child {
  margin-top: 0;
}

.login-form input {
  width: 100%;
  padding: 11px 12px;
  border: 1px solid var(--border);
  border-radius: 0;
  background: #fff;
  color: var(--text);
  font-size: 15px;
}

.login-form input:focus {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}

.login-status {
  min-height: 1.4em;
  margin: 4px 0 0;
  color: #8a2f22;
  font-size: 0.9rem;
}

.btn-primary {
  margin-top: 20px;
  padding: 12px 20px;
  border: 1px solid var(--text);
  border-radius: 0;
  background: var(--text);
  color: #fff;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  transition: background 150ms ease, color 150ms ease;
}

.btn-primary:hover {
  background: transparent;
  color: var(--text);
}

.support-body {
  max-width: 760px;
  margin-bottom: 56px;
  padding: 28px;
  border: 1px solid rgba(44, 40, 35, 0.16);
  border-radius: 22px;
  background: rgba(255, 253, 247, 0.92);
  box-shadow: 0 18px 50px rgba(44, 40, 35, 0.1);
  backdrop-filter: blur(12px);
}

.support-intro { margin-bottom: 22px; }

.support-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.support-form label {
  display: grid;
  gap: 7px;
  color: var(--text);
  font-size: 0.9rem;
  font-weight: 700;
}

.support-form label:nth-of-type(1),
.support-form label:nth-of-type(4),
.support-form label:nth-of-type(5) { grid-column: 1 / -1; }

.support-form input,
.support-form select,
.support-form textarea {
  width: 100%;
  padding: 11px 12px;
  border: 1px solid rgba(44, 40, 35, 0.22);
  border-radius: 11px;
  background: rgba(255, 255, 255, 0.8);
  color: var(--text);
  font: inherit;
  font-weight: 400;
}

.support-form textarea { resize: vertical; }

.support-form select {
  appearance: none;
  padding-right: 48px;
  background-image:
    linear-gradient(45deg, transparent 50%, rgba(44, 40, 35, 0.7) 50%),
    linear-gradient(135deg, rgba(44, 40, 35, 0.7) 50%, transparent 50%);
  background-position:
    calc(100% - 25px) 50%,
    calc(100% - 19px) 50%;
  background-size: 6px 6px, 6px 6px;
  background-repeat: no-repeat;
}

.support-form input:focus,
.support-form select:focus,
.support-form textarea:focus {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.support-form .btn-primary {
  grid-column: 1 / -1;
  justify-self: start;
  min-width: 112px;
  border: 1px solid #171614;
  border-radius: 999px;
  background: #171614;
  color: #fff;
  box-shadow: 0 8px 22px rgba(44, 40, 35, 0.08);
}

.support-form .btn-primary:hover {
  background: #34312d;
  border-color: #34312d;
}

.support-form .btn-primary:disabled {
  cursor: wait;
  opacity: 0.62;
}

.contact-honey { display: none !important; }

.support-form .support-status {
  grid-column: 1 / -1;
  min-height: 1.35em;
  margin: -4px 0 0;
  color: var(--text-dim);
  font-size: 0.84rem;
}

.support-body .support-note {
  margin: 38px 0 0;
  color: rgba(44, 40, 35, 0.72);
  font-size: 0.84rem;
}

@media (max-width: 760px) {
  .support-body { padding: 20px; }
  .support-form { grid-template-columns: 1fr; }
  .support-form label { grid-column: 1 / -1; }
  .language-switcher { margin-left: 0; }

  .language-menu {
    right: auto;
    left: 0;
  }
  .container {
    width: min(100% - 32px, 1120px);
  }

  .site-header .container {
    min-height: auto;
    padding: 14px 16px 16px;
    align-items: flex-start;
    flex-direction: column;
    gap: 12px;
  }

  .site-logo {
    width: 148px;
  }

  .site-nav {
    width: 100%;
    margin-left: 0;
    justify-content: flex-start;
    gap: 2px 10px;
    flex-wrap: wrap;
  }

  .nav-pill {
    padding: 6px 0;
    font-size: 14px;
  }

  .nav-pill::after {
    right: 0;
    bottom: 2px;
    left: 0;
  }

  .geometry-hero {
    min-height: 0;
  }

  .logo-backdrop {
    width: 430px;
    height: 96px;
  }

  .logo-backdrop .shape-ring {
    width: 660px;
    top: -627px;
    left: -265px;
  }

  .logo-backdrop .shape-logo-intersection {
    width: 250px;
    height: 130px;
    top: -82px;
    left: 76px;
  }

  .homepage-scroll-layer {
    padding-top: 136px;
  }

  .legal-hero {
    padding-top: 56px;
    padding-bottom: 28px;
  }

  .legal-body {
    padding-top: 40px;
    padding-bottom: 72px;
  }

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

  .footer-copy {
    text-align: left;
  }

  .modal {
    padding: 32px 24px 24px;
  }
}
