/* ==================== 全局 ==================== */
* { box-sizing: border-box; margin: 0; padding: 0; }
:root {
  --bg-0: #07091a;
  --bg-1: #0b0e1f;
  --ink: #e8ebf7;
  --ink-dim: #8a92a8;
  --ink-soft: #5a6178;
  --accent: #ff3030;        /* 联通红 */
  --accent-2: #ffb800;      /* 商务金 */
  --gold: #d4af37;
  --line: rgba(255,255,255,0.08);
  --line-strong: rgba(255,255,255,0.18);
  --glass: rgba(255,255,255,0.04);
  --glass-strong: rgba(255,255,255,0.08);
}
html, body { height: 100%; }
body {
  font-family: -apple-system, "PingFang SC", "Microsoft YaHei", "Helvetica Neue", "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", sans-serif;
  background: radial-gradient(ellipse at top, var(--bg-1), var(--bg-0));
  color: var(--ink);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  min-height: 100dvh;            /* 6.1 移动端地址栏高度变化, 100dvh 比 100vh 更准 */
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 16px 48px;
  padding-top: calc(24px + env(safe-area-inset-top, 0px));     /* 6.2 刘海屏顶部留白 */
  padding-bottom: calc(48px + env(safe-area-inset-bottom, 0px)); /* 6.2 刘海屏底部留白 */
  position: relative;
  -webkit-tap-highlight-color: transparent;  /* 6.3 安卓点击蓝框去除 */
  touch-action: manipulation;                /* 6.4 消除 300ms 点击延迟 (FastClick) */
  -webkit-text-size-adjust: 100%;           /* 6.5 iOS 旋转/缩放后字号不自适应 */
  text-size-adjust: 100%;
}

/* 6.6 backdrop-filter 兜底: 不支持的浏览器用更高对比度背景代替 */
@supports not (backdrop-filter: blur(20px)) {
  .card { background: rgba(20, 24, 45, 0.95) !important; }
  .qr-modal { background: rgba(0, 0, 0, 0.92) !important; }
  .toast { background: rgba(20, 24, 45, 0.98) !important; }
}

/* ==================== 背景 ==================== */
#bg {
  position: fixed; inset: 0; z-index: 0;
  pointer-events: none;
}
.halo {
  position: fixed;
  width: 480px; height: 480px;
  border-radius: 50%;
  filter: blur(120px);
  opacity: 0.35;
  pointer-events: none;
  z-index: 0;
  animation: drift 20s ease-in-out infinite alternate;
}
.halo-1 { background: var(--accent); top: -120px; left: -120px; }
.halo-2 { background: var(--accent-2); bottom: -160px; right: -120px; animation-delay: -10s; }
@keyframes drift {
  0%   { transform: translate(0, 0) scale(1); }
  100% { transform: translate(80px, 60px) scale(1.2); }
}

/* ==================== 卡片 ==================== */
.card-wrap {
  position: relative; z-index: 1;
  width: 100%; max-width: 420px;
}
.card {
  background: linear-gradient(160deg, rgba(255,255,255,0.05), rgba(255,255,255,0.02));
  border: 1px solid var(--line);
  border-radius: 24px;
  padding: 28px 22px 22px;
  backdrop-filter: blur(20px) saturate(140%);
  -webkit-backdrop-filter: blur(20px) saturate(140%);
  box-shadow:
    0 30px 80px rgba(0,0,0,0.5),
    inset 0 1px 0 rgba(255,255,255,0.06);
  position: relative;
  overflow: hidden;
}
.card::before {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(255,48,48,0.06), transparent 40%);
  pointer-events: none;
}

/* 顶部品牌条 */
.card-head {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 24px;
  font-size: 12px; color: var(--ink-dim);
  letter-spacing: 0.5px;
}
.brand { display: flex; align-items: center; gap: 8px; }
.brand-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 12px var(--accent);
}
.brand-name { font-weight: 600; color: var(--ink); }
.status { display: flex; align-items: center; gap: 6px; }
.status-dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: #2ee676;
  box-shadow: 0 0 8px #2ee676;
  animation: pulse 2s ease-in-out infinite;
}
@keyframes pulse { 0%,100%{opacity:1} 50%{opacity:0.4} }
.status-text { font-family: "SF Mono", Menlo, monospace; }

/* 头像 + 名字 */
.profile { text-align: center; margin-bottom: 28px; }
.avatar-wrap {
  width: 96px; height: 96px;
  margin: 0 auto 16px;
  position: relative;
}
.avatar-ring {
  position: absolute; inset: -6px;
  border-radius: 50%;
  background: conic-gradient(from 0deg, var(--accent), var(--accent-2), var(--accent));
  animation: spin 8s linear infinite;
  filter: blur(2px);
  opacity: 0.6;
}
@keyframes spin { to { transform: rotate(360deg); } }
.avatar {
  position: relative;
  width: 96px; height: 96px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid rgba(255,255,255,0.15);
  box-shadow: 0 4px 16px rgba(0,0,0,0.4);
}
.name {
  font-size: 28px; font-weight: 700;
  letter-spacing: 2px;
  margin-bottom: 6px;
  background: linear-gradient(135deg, #fff, #d4af37);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.title {
  font-size: 14px; color: var(--ink);
  margin-bottom: 4px;
  font-weight: 500;
}
.company {
  font-size: 12px; color: var(--ink-dim);
  line-height: 1.5;
}

/* 联系方式 */
.contacts { display: flex; flex-direction: column; gap: 10px; margin-bottom: 24px; }
.contact {
  display: grid;
  grid-template-columns: 40px 1fr auto;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  background: var(--glass);
  border: 1px solid var(--line);
  border-radius: 14px;
  text-decoration: none;
  color: var(--ink);
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
  opacity: 0;
  transform: translateX(-20px);
  position: relative;
  overflow: hidden;
}
.contact::after {
  content: ""; position: absolute; left: 0; top: 0; bottom: 0;
  width: 3px; background: var(--accent);
  transform: scaleY(0);
  transform-origin: center;
  transition: transform 0.3s;
}
.contact.in { opacity: 1; transform: translateX(0); }
.contact:hover {
  background: var(--glass-strong);
  border-color: var(--line-strong);
  transform: translateX(4px);
}
.contact:hover::after { transform: scaleY(1); }
.ico { font-size: 22px; line-height: 1; }
.label {
  font-size: 12px; color: var(--ink-soft);
  display: block; margin-bottom: 3px;
  text-transform: uppercase; letter-spacing: 1.5px;
  font-weight: 600;
}
.value {
  font-size: 16px; font-weight: 500;
  font-family: "SF Mono", Menlo, monospace;
  color: var(--ink);
  letter-spacing: 0.3px;
}
.action {
  font-size: 12px; color: var(--accent-2);
  font-weight: 600;
  white-space: nowrap;
}

/* 行动按钮 */
.actions {
  display: grid; grid-template-columns: 1fr 1fr; gap: 10px;
  margin-bottom: 24px;
}
.actions .btn-primary { grid-column: 1 / -1; }
.btn {
  display: flex; align-items: center; justify-content: center; gap: 6px;
  padding: 13px 16px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--glass);
  color: var(--ink);
  font-size: 14px; font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.2s;
}
.btn:hover { background: var(--glass-strong); transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn-primary {
  background: linear-gradient(135deg, var(--accent), #c41a1a);
  border-color: transparent;
  color: #fff;
  font-weight: 600;
  box-shadow: 0 8px 20px rgba(255,48,48,0.3);
}
.btn-primary:hover { box-shadow: 0 10px 28px rgba(255,48,48,0.4); }
.btn-ico { font-size: 16px; }

/* 二维码弹层 */
.qr-modal {
  position: fixed; inset: 0; z-index: 9999;
  background: rgba(0,0,0,0.7);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
  animation: qrfadeIn 0.2s;
}
@keyframes qrfadeIn { from {opacity:0} to {opacity:1} }
.qr-card {
  position: relative; z-index: 10000;
  background: var(--bg-1);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 28px 24px;
  max-width: 320px; width: 100%;
  text-align: center;
  animation: zoomIn 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
  pointer-events: auto;
}
@keyframes zoomIn { from { transform: scale(0.9); opacity: 0; } }
.qr-img {
  width: 240px; height: 240px;
  margin: 0 auto 16px;
  background: #fff;
  border-radius: 12px;
  padding: 12px;
  display: flex; align-items: center; justify-content: center;
}
.qr-img canvas, .qr-img img { width: 100%; height: 100%; }
.qr-tip { color: var(--ink-dim); font-size: 13px; margin-bottom: 16px; }

/* 页脚 */
.card-foot { text-align: center; padding-top: 16px; border-top: 1px solid var(--line); }
.motto {
  font-size: 13px; color: var(--ink);
  font-style: italic;
  margin-bottom: 8px;
  min-height: 18px;
}
.meta { font-size: 11px; color: var(--ink-soft); font-family: "SF Mono", Menlo, monospace; }

/* Toast */
.toast {
  position: fixed; bottom: 60px; left: 50%;
  transform: translateX(-50%);
  background: rgba(0,0,0,0.85);
  border: 1px solid var(--line-strong);
  color: #fff;
  padding: 12px 20px;
  border-radius: 100px;
  font-size: 14px;
  z-index: 20;
  backdrop-filter: blur(10px);
  animation: toastIn 0.3s;
}
@keyframes toastIn { from { transform: translate(-50%, 20px); opacity: 0; } }

/* 移动端微调 */
@media (max-width: 480px) {
  body { padding: 12px 12px 32px; }
  .card { padding: 24px 18px 18px; border-radius: 20px; }
  .name { font-size: 24px; }
  .avatar-wrap, .avatar { width: 84px; height: 84px; }
  .avatar { font-size: 36px; }
}
