/* 设计稿基准宽度 375px，尺寸换算：px ÷ 3.75 = vw */

:root {
  --color-primary: #f5266a;
  --color-text: #000;
  --color-label: #333;
  --color-divider: #eee;
  --color-qr-bg: #ededed;
  --color-page-bg: #f5f5f5;
  --qr-size: 53vw;
  --img-dash-color: #d8d8d8;
  --img-dash-width: 0.27vw;
  --img-dash-segment: 0.5vw; /* 单段虚线长度 */
  --img-dash-gap: 0.5vw; /* 虚线间距 */
  --img-dash-corner-gap: 1.87vw; /* 四角留白 */
  --avatar-size: 44vw;
}

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

html {
  font-size: 3.75vw; /* 1rem = 3.75vw ≈ 14.0625px @375 */
  height: 100%;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB",
    "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  color: #000;
  height: 100%;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* 档案数据加载完成前隐藏动态区域（首屏由 index.html 内联脚本控制） */
html.profile-loading .qr-section,
html.profile-loading .avatar-section,
html.profile-loading .info-list {
  visibility: hidden;
}

/* 固定背景层：滚动时不动 */
.page-bg {
  position: fixed;
  inset: 0;
  background: var(--color-page-bg);
  z-index: 0;
}

button,
a {
  border: none;
  background: none;
  cursor: pointer;
  padding: 0;
  font: inherit;
  text-decoration: none;
  -webkit-tap-highlight-color: transparent;
  tap-highlight-color: transparent;
}

img {
  display: block;
  max-width: 100%;
}

.page {
  position: relative;
  z-index: 1;
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* ========== 全屏斜向水印（与 entry.html 一致，由 watermark.js 渲染） ========== */
.watermark {
  position: fixed;
  top: 11.5vw;
  left: 0;
  z-index: 99;
  pointer-events: none;
  overflow: visible;
}

.watermark-grid {
  position: absolute;
  top: 0;
  left: 0;
  overflow: visible;
}

.watermark-item {
  position: absolute;
  font-size: 12px;
  line-height: 1;
  color: #d6d6d6;
  white-space: nowrap;
  letter-spacing: 0;
  user-select: none;
}

/* ========== 顶部导航 ========== */
.header {
  width: 100vw;
  background: var(--color-primary);
  flex-shrink: 0;
  position: relative;
  z-index: 100;
}

.nav-bar {
  width: 100vw;
  height: 11.5vw;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 4vw;
  position: relative;
}

.nav-back {
  width: 10.67vw; /* 40px */
  height: 10.67vw;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  flex-shrink: 0;
  -webkit-tap-highlight-color: transparent;
  tap-highlight-color: transparent;
  outline: none;
  user-select: none;
}

.nav-back:focus,
.nav-back:focus-visible,
.nav-back:active {
  outline: none;
  box-shadow: none;
  background: transparent;
  opacity: 1;
}

.nav-back svg {
  width: 3.2vw; /* 12px */
  height: 5.33vw; /* 20px */
}

.nav-title {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  font-size: 4.8vw; /* 18px */
  font-weight: 600;
  color: #fff;
  letter-spacing: 0.27vw; /* 1px */
  white-space: nowrap;
  line-height: 1;
}

.nav-placeholder {
  width: 10.67vw;
  flex-shrink: 0;
}

/* ========== 主内容（可滚动，浮在固定背景之上） ========== */
.main {
  position: relative;
  z-index: 1;
  width: 100vw;
  flex: 1;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  background: transparent;
}

/* 说明文案 */
.notice {
  width: 100vw;
  padding: 8vw 5.33vw 0; /* 20px */
  text-align: center;
}

.notice-main {
  font-size: 4vw; /* 15px */
  font-weight: 700;
  color: #000;
  line-height: 1.6;
  letter-spacing: 0.053vw;
}

.notice-warn {
  font-size: 4vw; /* 13px */
  font-weight: 700;
  color: var(--color-primary);
  line-height: 1.65;
  margin-top: 1.07vw; /* 4px */
  letter-spacing: 0.027vw;
}

.notice-warn + .notice-warn {
  margin-top: 0.53vw;
}

/* 二维码区域 */
.qr-section {
  width: 100vw;
  display: flex;
  justify-content: center;
  padding-top: 5.87vw; /* 22px */
}

.qr-wrap {
  display: flex;
  justify-content: center;
  position: relative;
}

.qr-card {
  width: var(--qr-size);
  height: var(--qr-size);
  flex-shrink: 0;
  overflow: visible;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: var(--color-qr-bg);
  background-image: url("../assets/deng.gif");
  background-repeat: no-repeat;
  background-position: center;
  background-size: 100% 100%;
}

/* 二维码 / 人像 共用虚线外框 */
.img-dash-frame {
  position: relative;
  box-sizing: border-box;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: visible;
}

.img-dash-frame__line {
  position: absolute;
  pointer-events: none;
}

.img-dash-frame__line--top {
  top: calc(-1 * var(--img-dash-width));
  left: var(--img-dash-corner-gap);
  right: var(--img-dash-corner-gap);
  height: var(--img-dash-width);
  background: repeating-linear-gradient(
    to right,
    var(--img-dash-color) 0,
    var(--img-dash-color) var(--img-dash-segment),
    transparent var(--img-dash-segment),
    transparent calc(var(--img-dash-segment) + var(--img-dash-gap))
  );
}

.img-dash-frame__line--bottom {
  bottom: calc(-1 * var(--img-dash-width));
  left: var(--img-dash-corner-gap);
  right: var(--img-dash-corner-gap);
  height: var(--img-dash-width);
  background: repeating-linear-gradient(
    to right,
    var(--img-dash-color) 0,
    var(--img-dash-color) var(--img-dash-segment),
    transparent var(--img-dash-segment),
    transparent calc(var(--img-dash-segment) + var(--img-dash-gap))
  );
}

.img-dash-frame__line--left {
  left: calc(-1 * var(--img-dash-width));
  top: var(--img-dash-corner-gap);
  bottom: var(--img-dash-corner-gap);
  width: var(--img-dash-width);
  background: repeating-linear-gradient(
    to bottom,
    var(--img-dash-color) 0,
    var(--img-dash-color) var(--img-dash-segment),
    transparent var(--img-dash-segment),
    transparent calc(var(--img-dash-segment) + var(--img-dash-gap))
  );
}

.img-dash-frame__line--right {
  right: calc(-1 * var(--img-dash-width));
  top: var(--img-dash-corner-gap);
  bottom: var(--img-dash-corner-gap);
  width: var(--img-dash-width);
  background: repeating-linear-gradient(
    to bottom,
    var(--img-dash-color) 0,
    var(--img-dash-color) var(--img-dash-segment),
    transparent var(--img-dash-segment),
    transparent calc(var(--img-dash-segment) + var(--img-dash-gap))
  );
}

.img-dash-frame img {
  position: relative;
  z-index: 1;
  width: 100%;
  height: 100%;
  display: block;
}

.qr-img {
  width: var(--avatar-size);
  height: var(--avatar-size);
}

.qr-img img {
  object-fit: contain;
}

/* 人像 */
.avatar-section {
  width: 100vw;
  display: flex;
  justify-content: center;
  padding-top: 8vw;
  overflow: visible;
}

/* 人像：与二维码相同四边虚线（四角断开、短线段、线在外侧） */
.avatar-img {
  width: var(--avatar-size);
  height: var(--avatar-size);
}

.avatar-img img {
  object-fit: cover;
}

/* 信息列表 */
.info-list {
  width: 100vw;
  margin-top: 8vw;
  padding-bottom: 0;
}

/* 紧挨信息列表的按钮区（样式同 entry.html .btn-open） */
.action-section {
  width: 100vw;
  margin-top: 10vw;
  padding: 0 5vw 8vw;
}

.btn-open {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 14.6vw;
  background: var(--color-primary);
  border-radius: 7.3vw;
  font-size: 5.2vw;
  font-weight: 500;
  color: #fff;
  letter-spacing: 0.13vw;
  line-height: 1;
  -webkit-tap-highlight-color: transparent;
  tap-highlight-color: transparent;
  outline: none;
  user-select: none;
}

.btn-open:focus,
.btn-open:focus-visible,
.btn-open:active {
  outline: none;
  box-shadow: none;
}

.btn-open:active {
  opacity: 0.88;
}

.info-row {
  width: 100vw;
  height: 13.87vw; /* 52px */
  padding: 0 5.33vw;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.info-label-wrap {
  display: flex;
  align-items: center;
  gap: 2vw;
  flex-shrink: 0;
}

.info-label {
  font-size: 3.5vw; /* 15px */
  color: #999999;
  font-weight: 400;
  flex-shrink: 0;
}

.btn-privacy {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 3.5vw;
  height: 3.5vw;
  padding: 0;
  flex-shrink: 0;
  -webkit-tap-highlight-color: transparent;
}

.btn-privacy img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.btn-privacy:active {
  opacity: 0.7;
}

.info-value {
  font-size: 3.5vw;
  color: #222;
  font-weight: 400;
  text-align: right;
  letter-spacing: 0.027vw;
}

.info-value--name {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 2.13vw; /* 8px */
}

.badge-verified {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 1.5vw;
  height: 5.8vw;
  padding: 0 2.8vw 0 2.8vw;
  background: #f6e2e8;
  border-radius: 2.9vw;
  font-size: 3.3vw;
  font-weight: 600;
  color: var(--color-primary);
  white-space: nowrap;
  line-height: 1;
  vertical-align: middle;
}

.badge-icon {
  display: block;
  width: 3.47vw;
  height: 3.47vw;
  flex-shrink: 0;
  object-fit: contain;
  margin: 0;
  align-self: center;
}

.info-name {
  font-size: 3.5vw;
  color: #222;
  font-weight: 400;
}

.info-divider {
  width: 100vw;
  height: 0.3vw; /* 1px */
  background: #e5e5e5;
  transform: scaleY(0.5);
  transform-origin: center;
}
