/* UITG Name Card — modern, minimal, elegant */
:root {
  --navy: #1a2b3c;
  --teal: #007a87;
  --teal-light: #e8f4f6;
  --teal-mid: #2a9d8f;
  --grey: #5a6570;
  --grey-light: #8b95a0;
  --line: #dde4e8;
  --bg: #f7f9fa;
  --card: #ffffff;
  --shadow: 0 8px 32px rgba(26, 43, 60, 0.08);
  --radius: 16px;
  --font: "PingFang SC", "Helvetica Neue", "Segoe UI", system-ui, sans-serif;
}

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

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

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--navy);
  min-height: 100dvh;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* ── Language toggle ── */
.lang-bar {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  display: flex;
  justify-content: flex-end;
  padding: 12px 16px;
  pointer-events: none;
}
.lang-toggle {
  pointer-events: auto;
  display: flex;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 999px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0,0,0,.06);
}
.lang-toggle button {
  border: none;
  background: transparent;
  padding: 6px 14px;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--grey);
  cursor: pointer;
  transition: all .2s;
}
.lang-toggle button.active {
  background: var(--navy);
  color: #fff;
}

/* ── Page shell ── */
.page {
  max-width: 420px;
  margin: 0 auto;
  padding: 56px 16px 32px;
}

/* ── Main card ── */
.card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  position: relative;
}
.card::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--teal), var(--navy));
}

.card-inner { padding: 28px 24px 24px; }

/* Brand header */
.brand-row {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 20px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--line);
}
.brand-logo {
  width: auto;
  height: 40px;
  max-width: 160px;
  object-fit: contain;
  flex-shrink: 0;
}
.brand-logo-fallback {
  width: 48px;
  height: 48px;
  flex-shrink: 0;
}
.brand-text .brand-name {
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: var(--navy);
}
.brand-text .brand-name span {
  color: var(--teal);
  font-weight: 600;
}
.brand-text .brand-url {
  font-size: 0.78rem;
  color: var(--grey-light);
  margin-top: 2px;
}
.brand-text .brand-slogan {
  font-size: 0.72rem;
  color: var(--teal);
  margin-top: 4px;
  letter-spacing: 0.12em;
}

/* Person block */
.person-block { margin-bottom: 24px; }
.person-name {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--navy);
  letter-spacing: 0.04em;
  line-height: 1.2;
}
.person-title {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--teal);
  margin-top: 6px;
}
.person-company {
  font-size: 0.78rem;
  color: var(--grey);
  margin-top: 8px;
  line-height: 1.6;
}

/* Contact list */
.contact-list { list-style: none; }
.contact-list li {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
  font-size: 0.85rem;
}
.contact-list li:last-child { border-bottom: none; }
.contact-icon {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  color: var(--teal);
  margin-top: 1px;
}
.contact-label {
  font-size: 0.68rem;
  color: var(--grey-light);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 2px;
}
.contact-value {
  color: var(--navy);
  word-break: break-all;
}
.contact-value a {
  color: var(--navy);
  text-decoration: none;
}
.contact-value a:hover { color: var(--teal); }

/* QR section */
.qr-section {
  text-align: center;
  padding: 20px 0 4px;
  border-top: 1px solid var(--line);
  margin-top: 8px;
}
.qr-wrap {
  display: inline-block;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
}
.qr-wrap img {
  width: 140px;
  height: 140px;
  object-fit: contain;
  display: block;
}
.qr-hint {
  font-size: 0.72rem;
  color: var(--grey-light);
  margin-top: 10px;
  letter-spacing: 0.06em;
}

/* Action buttons */
.actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 20px;
}
.btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 13px 20px;
  border-radius: 10px;
  font-size: 0.85rem;
  font-weight: 600;
  text-decoration: none;
  transition: all .2s;
  cursor: pointer;
  border: none;
  font-family: inherit;
}
.btn-primary {
  background: var(--navy);
  color: #fff;
}
.btn-primary:hover { background: #243a50; }
.btn-outline {
  background: transparent;
  color: var(--navy);
  border: 1.5px solid var(--line);
}
.btn-outline:hover {
  border-color: var(--teal);
  color: var(--teal);
}
.btn-teal {
  background: linear-gradient(135deg, var(--teal), var(--teal-mid));
  color: #fff;
}
.btn-teal:hover { opacity: .92; }

.btn svg { width: 16px; height: 16px; flex-shrink: 0; }

/* More link */
.more-link {
  display: block;
  text-align: center;
  margin-top: 20px;
  padding: 16px;
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  text-decoration: none;
  color: var(--navy);
  transition: all .2s;
}
.more-link:hover { box-shadow: 0 12px 40px rgba(26,43,60,.12); }
.more-link .more-title {
  font-size: 0.9rem;
  font-weight: 600;
}
.more-link .more-sub {
  font-size: 0.75rem;
  color: var(--grey-light);
  margin-top: 4px;
}
.more-link .more-arrow {
  display: inline-block;
  margin-top: 8px;
  color: var(--teal);
  font-size: 1.1rem;
}

.footer-note {
  text-align: center;
  font-size: 0.68rem;
  color: var(--grey-light);
  margin-top: 24px;
  letter-spacing: 0.04em;
}

/* ── More page ── */
.page-header {
  margin-bottom: 24px;
}
.page-header .back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.8rem;
  color: var(--grey);
  text-decoration: none;
  margin-bottom: 16px;
}
.page-header .back:hover { color: var(--teal); }
.page-header h1 {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--navy);
}
.page-header .subtitle {
  font-size: 0.82rem;
  color: var(--grey);
  margin-top: 6px;
  line-height: 1.6;
}

.avatar-row {
  display: flex;
  align-items: center;
  gap: 16px;
  background: var(--card);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
  margin-bottom: 16px;
}
.avatar {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--teal-light);
  background: var(--teal-light);
  flex-shrink: 0;
}
.avatar-placeholder {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--teal-light), #d4ecef);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--teal);
  flex-shrink: 0;
}
.avatar-info .name { font-size: 1.1rem; font-weight: 700; }
.avatar-info .tagline {
  font-size: 0.78rem;
  color: var(--grey);
  margin-top: 4px;
  line-height: 1.5;
}

/* Interest cards */
.interest-card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  margin-bottom: 12px;
  overflow: hidden;
}
.interest-head {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 18px 20px;
  cursor: pointer;
  user-select: none;
}
.interest-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  flex-shrink: 0;
}
.interest-icon.ec { background: #e8f5ef; }
.interest-icon.xy { background: #fff3e6; }
.interest-icon.lj { background: #eef2ff; }
.interest-icon.wx { background: var(--teal-light); }
.interest-meta { flex: 1; min-width: 0; }
.interest-meta h3 {
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--navy);
}
.interest-meta p {
  font-size: 0.75rem;
  color: var(--grey);
  margin-top: 3px;
  line-height: 1.4;
}
.interest-chevron {
  color: var(--grey-light);
  transition: transform .25s;
  flex-shrink: 0;
}
.interest-card.open .interest-chevron { transform: rotate(180deg); }

.interest-body {
  max-height: 0;
  overflow: hidden;
  transition: max-height .35s ease;
}
.interest-card.open .interest-body { max-height: 600px; }
.interest-body-inner {
  padding: 0 16px 20px;
  border-top: 1px solid var(--line);
  padding-top: 16px;
}

/* Showcase panels (logo + intro + QR composites) */
.showcase-panel {
  border-radius: 12px;
  overflow: hidden;
  background: #fafbfc;
  border: 1px solid var(--line);
}
.showcase-panel img {
  width: 100%;
  height: auto;
  display: block;
  vertical-align: middle;
}
.showcase-caption {
  font-size: 0.72rem;
  color: var(--grey-light);
  text-align: center;
  margin-top: 10px;
  letter-spacing: 0.04em;
}
.interest-body-inner .action-row {
  display: flex;
  gap: 8px;
  margin-top: 14px;
  flex-wrap: wrap;
}
.interest-body-inner .btn { flex: 1; min-width: 120px; padding: 10px 14px; font-size: 0.8rem; }

/* Luojing teaser (no QR on namecard — link to site) */
.lj-teaser {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px;
  background: var(--teal-light);
  border-radius: 10px;
  font-size: 0.82rem;
  color: var(--navy);
  line-height: 1.5;
}
.lj-teaser-icon {
  font-size: 1.6rem;
  flex-shrink: 0;
}
.wechat-id {
  font-size: 0.85rem;
  color: var(--navy);
  font-weight: 600;
  text-align: center;
  padding: 8px;
  background: var(--teal-light);
  border-radius: 8px;
  margin-top: 8px;
}

/* Save contact FAB */
.save-bar {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
  background: linear-gradient(transparent, var(--bg) 30%);
  z-index: 50;
}
.save-bar .btn { width: 100%; max-width: 420px; margin: 0 auto; display: flex; }

/* ── Document viewer ── */
body.doc-page { background: var(--bg); }
.doc-shell { padding-top: 52px; padding-bottom: 32px; }
.doc-back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.8rem;
  color: var(--grey);
  text-decoration: none;
  margin-bottom: 12px;
}
.doc-back:hover { color: var(--teal); }
.doc-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--navy);
  margin: 0 0 6px;
}
.doc-note {
  font-size: 0.78rem;
  color: var(--grey-light);
  margin: 0 0 16px;
}
.wechat-tip {
  background: #fff8e6;
  border: 1px solid #f0d78c;
  border-radius: 10px;
  padding: 12px 14px;
  margin-bottom: 14px;
  font-size: 0.82rem;
  line-height: 1.55;
  color: #5c4a1a;
}
.wechat-tip p { margin: 6px 0 0; }
.doc-actions {
  display: flex;
  gap: 10px;
  margin-bottom: 14px;
}
.doc-actions .btn { flex: 1; }
.doc-viewer-wrap {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  border: 1px solid var(--line);
  min-height: 60vh;
}
.doc-frame {
  width: 100%;
  height: 72vh;
  border: none;
  display: block;
  background: #525659;
}
.actions-compact .btn { padding: 11px 14px; font-size: 0.8rem; }

/* Hidden lang content */
[lang-content] { display: none; }
[lang-content].visible { display: block; }
[lang-content-inline] { display: none; }
[lang-content-inline].visible { display: inline; }

@media (min-width: 480px) {
  .page { padding-top: 64px; }
  .person-name { font-size: 2rem; }
}
