/* Goldprice fixed pages — shared light theme */
:root {
  --bg: #F4F5F7;
  --surface: #FFFFFF;
  --text: #1A2332;
  --text-muted: #5C6570;
  --text-soft: #7A8490;
  --gold: #B8860B;
  --gold-deep: #8B6914;
  --gold-soft: rgba(184, 134, 11, 0.12);
  --gold-line: rgba(184, 134, 11, 0.35);
  --navy: #1A3A5C;
  --navy-hover: #14304C;
  --border: #E5E8ED;
  --radius: 12px;
  --radius-lg: 16px;
  --font: "PingFang SC", "Hiragino Sans GB", "Noto Sans SC",
    -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sans-serif;
  --font-display: "Songti SC", "Noto Serif SC", "STSong", "Source Han Serif SC",
    "PingFang SC", Georgia, serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  padding: 0;
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.7;
  color: var(--text);
  background: var(--bg);
  min-width: 320px;
}

a {
  color: var(--navy);
  text-decoration: none;
}

a:hover {
  color: var(--gold);
}

img {
  max-width: 100%;
  height: auto;
  border: 0;
  vertical-align: middle;
}

/* ---------- Legal documents (agreement / privacy) ---------- */
body:has(.doc) {
  background:
    radial-gradient(ellipse 70% 40% at 50% 0%, rgba(184, 134, 11, 0.1), transparent 55%),
    linear-gradient(180deg, #F7F5F0 0%, var(--bg) 28%, var(--bg) 100%);
}

.doc {
  max-width: 680px;
  margin: 0 auto;
  padding: 28px 20px 56px;
  background: var(--surface);
  min-height: 100vh;
  position: relative;
}

.doc::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--gold-deep), var(--gold), #D4A84B, var(--gold-deep));
}

.doc h1 {
  margin: 8px 0 0;
  padding: 0 0 16px;
  text-align: center;
  font-family: var(--font-display);
  font-size: clamp(22px, 5.5vw, 28px);
  font-weight: 700;
  line-height: 1.4;
  color: var(--text);
  letter-spacing: 0.08em;
  position: relative;
}

.doc h1::after {
  content: "";
  display: block;
  width: 40px;
  height: 2px;
  margin: 14px auto 0;
  background: var(--gold);
  border-radius: 1px;
  opacity: 0.85;
}

html:lang(en) .doc h1,
html:lang(th) .doc h1,
html:lang(vi) .doc h1 {
  font-family: var(--font);
  letter-spacing: 0.02em;
}

html:lang(en) .doc .main,
html:lang(en) .doc .title,
html:lang(th) .doc .main,
html:lang(th) .doc .title,
html:lang(vi) .doc .main,
html:lang(vi) .doc .title {
  font-family: var(--font);
  letter-spacing: 0.01em;
}

html:lang(en) .doc #payb,
html:lang(en) .doc .doc-body,
html:lang(th) .doc #payb,
html:lang(th) .doc .doc-body,
html:lang(vi) .doc #payb,
html:lang(vi) .doc .doc-body {
  text-align: left;
  text-justify: auto;
}

.doc .meta {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin: 4px 0 28px;
  text-align: center;
}

.doc .meta p {
  margin: 0;
  display: inline-flex;
  align-items: center;
  padding: 5px 12px;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.02em;
  color: var(--gold-deep);
  background: var(--gold-soft);
  border: 1px solid var(--gold-line);
  border-radius: 999px;
  line-height: 1.4;
}

.doc #payb,
.doc .doc-body {
  margin: 0;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  font-size: 15px;
  line-height: 1.85;
  color: var(--text);
  text-align: justify;
  text-justify: inter-ideograph;
}

.doc p {
  margin: 0 0 12px;
  line-height: 1.85;
}

/* Agreement lead / privacy intro */
.doc .doc-lead,
.doc-body > .sub:first-child,
.doc-body > .sub.doc-lead {
  margin: 0 0 28px;
  padding: 16px 16px 16px 18px;
  font-size: 14.5px;
  line-height: 1.8;
  color: var(--text);
  background: linear-gradient(135deg, rgba(184, 134, 11, 0.08), rgba(26, 58, 92, 0.04));
  border-left: 3px solid var(--gold);
  border-radius: 0 var(--radius) var(--radius) 0;
  text-align: left;
}

.doc .doc-lead b,
.doc-body > .sub:first-child b {
  font-weight: 600;
}

/* Privacy label: 【引言】 / 【目录】 */
.doc-body > b {
  display: block;
  margin: 28px 0 12px;
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.12em;
  color: var(--gold-deep);
}

.doc-body > b:first-of-type {
  margin-top: 0;
}

/* Paragraph right after intro label */
.doc-body > b:first-of-type + p {
  margin: 0 0 24px;
  padding: 16px 16px 16px 18px;
  font-size: 14.5px;
  line-height: 1.8;
  background: linear-gradient(135deg, rgba(184, 134, 11, 0.08), rgba(26, 58, 92, 0.04));
  border-left: 3px solid var(--gold);
  border-radius: 0 var(--radius) var(--radius) 0;
  text-align: left;
}

/* TOC links block (privacy) */
.doc-toc {
  margin: 0 0 12px;
  padding: 4px 0 8px;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.doc-toc a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 6px;
  margin: 0;
  font-size: 14.5px;
  font-weight: 500;
  line-height: 1.45;
  color: var(--navy);
  border-bottom: 1px dashed var(--border);
  text-align: left;
  text-decoration: none;
  transition: color 0.15s ease, background 0.15s ease, padding-left 0.15s ease;
}

.doc-toc a:last-child {
  border-bottom: 0;
}

.doc-toc a::after {
  content: "";
  flex-shrink: 0;
  width: 6px;
  height: 6px;
  border-right: 1.5px solid var(--gold);
  border-bottom: 1.5px solid var(--gold);
  transform: rotate(-45deg);
  opacity: 0.7;
}

.doc-toc a:hover,
.doc-toc a:active {
  color: var(--gold-deep);
  padding-left: 10px;
  background: linear-gradient(90deg, var(--gold-soft), transparent);
  text-decoration: none;
}

/* Chapter headings — agreement .main / privacy .title */
.doc .main,
.doc .title {
  margin: 36px 0 14px;
  padding: 14px 0 12px 14px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 17px;
  line-height: 1.45;
  letter-spacing: 0.04em;
  color: var(--text);
  border-left: 3px solid var(--gold);
  border-bottom: 1px solid var(--border);
  background: linear-gradient(90deg, var(--gold-soft), transparent 72%);
  text-align: left;
  scroll-margin-top: 16px;
}

.doc .main:first-of-type,
.doc .title:first-of-type {
  margin-top: 28px;
}

/* Numbered clauses — keep natural flow */
.doc .sub {
  margin: 0 0 10px;
  padding-left: 0;
  color: var(--text);
  text-align: justify;
}

.doc .sub-title {
  margin: 22px 0 10px;
  padding: 0;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.03em;
  color: var(--navy);
  text-align: left;
}

.doc .sdk {
  margin: 18px 0 10px;
  font-weight: 600;
  font-size: 14.5px;
  color: var(--gold-deep);
}

.doc hr {
  border: 0;
  height: 1px;
  margin: 28px 0;
  background: linear-gradient(90deg, transparent, var(--gold-line), var(--border), var(--gold-line), transparent);
}

.doc table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  margin: 16px 0 24px;
  font-size: 12.5px;
  line-height: 1.55;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
}

.doc th,
.doc td {
  padding: 11px 10px;
  border-right: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  text-align: left;
  vertical-align: top;
  word-break: break-word;
}

.doc th:last-child,
.doc td:last-child {
  border-right: 0;
}

.doc tr:last-child td {
  border-bottom: 0;
}

.doc th {
  background: linear-gradient(180deg, #FBF6E8, var(--gold-soft));
  font-weight: 700;
  font-size: 12px;
  letter-spacing: 0.04em;
  text-align: center;
  color: var(--gold-deep);
  white-space: nowrap;
}

.doc td {
  text-align: center;
  color: var(--text);
}

.doc tr:nth-child(even) td {
  background: #FAFBFC;
}

.doc td > span {
  text-align: left;
  display: inline-block;
  margin-bottom: 5px;
  white-space: normal;
  word-break: break-all;
}

.doc td > span:last-child {
  margin-bottom: 0;
}

.doc a {
  color: var(--navy);
  text-decoration: underline;
  text-decoration-color: var(--gold-line);
  text-underline-offset: 3px;
}

.doc a:hover {
  color: var(--gold-deep);
}

/* ---------- Service page ---------- */
.service-page {
  min-height: 100vh;
  padding: 32px 20px 48px;
  background:
    radial-gradient(ellipse 80% 50% at 50% -10%, var(--gold-soft), transparent 60%),
    var(--bg);
}

.service-wrap {
  max-width: 480px;
  margin: 0 auto;
}

.service-header {
  text-align: center;
  margin-bottom: 28px;
}

.service-avatar {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  object-fit: cover;
  display: block;
  margin: 0 auto 16px;
  border: 3px solid var(--surface);
  box-shadow: 0 4px 16px rgba(26, 35, 50, 0.1);
}

.service-header h1 {
  margin: 0 0 6px;
  font-size: 22px;
  font-weight: 700;
  color: var(--text);
}

.service-header p {
  margin: 0;
  font-size: 14px;
  color: var(--text-muted);
}

.service-block {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 14px;
}

.service-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  letter-spacing: 0.04em;
  margin: 0 0 8px;
  text-transform: none;
}

.service-email {
  display: inline-block;
  font-size: 16px;
  font-weight: 600;
  color: var(--navy);
  word-break: break-all;
}

.service-email:hover {
  color: var(--gold);
}

.btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 52px;
  padding: 14px 20px;
  border: 0;
  border-radius: var(--radius);
  font-family: var(--font);
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.2s ease, transform 0.15s ease;
  -webkit-tap-highlight-color: transparent;
}

.btn:active {
  transform: scale(0.98);
}

.btn-primary {
  background: var(--navy);
  color: #fff;
}

.btn-primary:hover {
  background: var(--navy-hover);
  color: #fff;
}

.btn-store {
  background: var(--surface);
  color: var(--text);
  border: 1.5px solid var(--border);
  gap: 10px;
}

.btn-store:hover {
  border-color: var(--gold);
  color: var(--text);
}

.btn-store .store-icon {
  width: 28px;
  height: 28px;
  flex-shrink: 0;
}

.btn-store .store-text {
  text-align: left;
  line-height: 1.25;
}

.btn-store .store-text small {
  display: block;
  font-size: 11px;
  font-weight: 500;
  color: var(--text-muted);
}

.btn-store .store-text strong {
  display: block;
  font-size: 16px;
  font-weight: 700;
}

/* ---------- Share / download landing ---------- */
.share-page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 24px 48px;
  background:
    radial-gradient(ellipse 90% 55% at 50% 0%, rgba(184, 134, 11, 0.18), transparent 55%),
    linear-gradient(180deg, #F3F0E8 0%, var(--bg) 45%, #EEF1F5 100%);
  text-align: center;
}

.share-brand {
  margin-bottom: 12px;
}

.share-logo {
  width: min(300px, 78vw);
  height: auto;
  display: block;
  margin: 0 auto 16px;
}

.share-brand h1 {
  margin: 0;
  font-size: clamp(32px, 9vw, 44px);
  font-weight: 800;
  letter-spacing: 0.06em;
  color: var(--text);
  line-height: 1.2;
}

.share-brand h1 span {
  background: linear-gradient(135deg, #8B6914, var(--gold), #D4A84B);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.share-tagline {
  margin: 12px 0 0;
  font-size: 15px;
  color: var(--text-muted);
  max-width: 280px;
  margin-left: auto;
  margin-right: auto;
  line-height: 1.5;
}

.share-visual {
  width: min(280px, 72vw);
  margin: 28px auto 32px;
  display: block;
}

.share-actions {
  width: 100%;
  max-width: 300px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* WeChat overlay */
.weixin-mask {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 1000;
}

.weixin-mask.is-open {
  display: block;
}

.weixin-mask__bg {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.78);
}

.weixin-mask__content {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100%;
  padding: 24px;
  color: #fff;
  text-align: center;
  pointer-events: none;
}

.weixin-mask__content p {
  margin: 0;
  font-size: 18px;
  line-height: 1.6;
  font-weight: 500;
}

.weixin-mask__hint {
  margin-top: 12px !important;
  font-size: 14px !important;
  opacity: 0.75;
  font-weight: 400 !important;
}

@media (min-width: 768px) {
  .doc {
    padding: 40px 48px 72px;
    margin: 32px auto 48px;
    min-height: auto;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    box-shadow: 0 12px 40px rgba(26, 35, 50, 0.06);
  }

  .doc h1 {
    font-size: 30px;
    letter-spacing: 0.12em;
  }

  .doc #payb,
  .doc .doc-body {
    font-size: 15.5px;
  }

  .doc .main,
  .doc .title {
    font-size: 18px;
  }
}
