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

body {
  font-family: -apple-system, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  background: #f2f5fa;
  color: #1f2430;
  -webkit-font-smoothing: antialiased;
}

.app { max-width: 520px; margin: 0 auto; min-height: 100%; padding-bottom: 20px; }

/* 顶栏 */
.topbar {
  display: flex; align-items: center; border-radius: 12px; justify-content: center;
  padding: 18px; background: linear-gradient(135deg, #12316b, #1f4fd0); color: #fff;
  position: sticky; top: 0; z-index: 10;
}
.topbar h1 { font-size: 20px; font-weight: 700; letter-spacing: 2px; }

.btn-ghost {
  background: transparent; border: 1px solid #c9d2e3; color: #33415c;
  padding: 8px 14px; border-radius: 8px; font-size: 14px; cursor: pointer;
}
.topbar .btn-ghost { border-color: rgba(255,255,255,.4); color: #fff; }
.btn-ghost.wide { display: block; width: 100%; text-align: center; text-decoration: none; margin: 6px 0; }
.btn-ghost:hover { background: rgba(18,49,107,.06); }
.topbar .btn-ghost:hover { background: rgba(255,255,255,.12); }

.btn-primary {
  display: block; width: 100%; background: linear-gradient(135deg,  #054559, #02181e);
  color: #f3c741; border: none; padding: 14px; border-radius: 12px; font-size: 14px;
  font-weight: 500; cursor: pointer; margin-top: 8px;
  box-shadow: 0 4px 12px rgba(31, 79, 208, 0.3);
  transition: transform 0.1s, box-shadow 0.2s;
}
.btn-primary:hover { background: linear-gradient(135deg, #173eac, #1f4fd0); box-shadow: 0 6px 16px rgba(31, 79, 208, 0.4); }
.btn-primary:active { transform: translateY(1px); }

/* 视图 */
.view { padding: 18px; }
.card-box { background: #fff; border-radius: 14px; padding: 22px; box-shadow: 0 4px 16px rgba(18,49,107,.06); }

/* 登录注册 */
.auth-card { margin-top: 60px; box-shadow: 0 8px 30px rgba(18,49,107,.1); }
.auth-tabs { display: flex; margin-bottom: 24px; border-bottom: 2px solid #f0f4fa; }
.auth-tabs .tab {
  flex: 1; background: none; border: none; padding: 12px; font-size: 16px;
  color: #94a3b8; cursor: pointer; border-bottom: 3px solid transparent;
  transition: all 0.2s;
}
.auth-tabs .tab.active { color: #1f4fd0; font-weight: 600; border-bottom-color: #1f4fd0; }
.auth-form input {
  width: 100%; padding: 14px 16px; margin-bottom: 24px;
  border: 1.5px solid #e2e8f0;
  border-radius: 12px; font-size: 15px; background: #f8fafc; outline: none;
  transition: all 0.2s;
  display: block;
}
.auth-form input:focus {
  border-color: #1f4fd0; background: #fff;
  box-shadow: 0 0 0 3px rgba(31, 79, 208, 0.1);
}
.auth-tip { font-size: 11px; color: #98a1b3; margin-top: 12px; text-align: center; }
.msg { font-size: 14px; text-align: center; margin-top: 1px; min-height: 12px; }
.msg.err { color: #d33; }
.msg.ok { color: #2e8b57; }

/* 底部导航 */
.tabnav {
  display: flex; background: #fff; border-radius: 12px; padding: 6px;
  margin-bottom: 16px; box-shadow: 0 2px 8px rgba(18,49,107,.05);
}
.tabnav .tn {
  flex: 0.5; padding: 11px; border: none; background: none; border-radius: 9px;
  font-size: 15px; color: #7b869b; cursor: pointer;
}
.tabnav .tn.active { background: #1f4fd0; color: #fff; font-weight: 600; }

.section-title { font-size: 16px; font-weight: 700; color: #12316b; margin-bottom: 14px; }

/* 名片编辑 */
.card-editor, .share-box { background: #fff; border-radius: 14px; padding: 20px; margin-bottom: 16px; box-shadow: 0 4px 16px rgba(18,49,107,.06); }

.field { margin-bottom: 14px; }
.field label { display: block; font-size: 13px; color: #5b6577; margin-bottom: 6px; }
.field label .req { color: #e25555; }
.field input {
  width: 100%; padding: 12px; border: 1px solid #dbe2ee; border-radius: 10px;
  font-size: 15px; background: #fafbfe; outline: none;
}
.field input:focus { border-color: #1f4fd0; background: #fff; }
.field textarea {
  width: 100%; padding: 12px; border: 1px solid #dbe2ee; border-radius: 10px;
  font-size: 15px; background: #fafbfe; outline: none; resize: vertical;
  font-family: inherit; line-height: 1.5; min-height: 70px;
}
.field textarea:focus { border-color: #1f4fd0; background: #fff; }

.logo-row { display: flex; align-items: center; gap: 10px; }
.logo-preview { width: 52px; height: 52px; object-fit: contain; border-radius: 8px; border: 1px solid #e0e6f1; }

/* 迷你名片预览 */
.mini-card {
  border: 1px solid #e0e6f1; border-radius: 12px; padding: 16px; margin-bottom: 18px;
  background: linear-gradient(135deg, #12316b, #1f4fd0); color: #fff;
}
.mc-top { display: flex; align-items: center; margin-bottom: 12px; }
.mc-logo { width: 42px; height: 42px; object-fit: contain; background: #fff; border-radius: 8px; margin-right: 12px; }
.mc-name { font-size: 19px; font-weight: 700; flex: 1; }
.mc-pos { font-size: 12px; color: rgba(255,255,255,.85); margin-top: 2px; }
.mc-rows { border-top: 1px solid rgba(255,255,255,.18); padding-top: 8px; }
.mc-rows div { display: flex; font-size: 12.5px; padding: 3px 0; }
.mc-rows span { width: 42px; color: rgba(255,255,255,.7); }
.mc-rows em { font-style: normal; flex: 1; word-break: break-all; }

/* 分享 */
.share-qr { text-align: center; margin: 8px 0 12px; }
.share-qr canvas, .share-qr img { max-width: 200px; border: 1px solid #eee; border-radius: 8px; }
.share-url { display: flex; gap: 8px; margin-top: 8px; }
.share-url input { flex: 1; padding: 10px; border: 1px solid #dbe2ee; border-radius: 8px; font-size: 12.5px; color: #5b6577; background: #fafbfe; }

/* 通讯录 */
#contactsList { display: flex; flex-direction: column; gap: 10px; }
.contact-card {
  background: #fff; border-radius: 12px; padding: 14px; display: flex;
  align-items: center; box-shadow: 0 2px 8px rgba(18,49,107,.05);
}
.contact-avatar {
  width: 46px; height: 46px; border-radius: 10px; background: #1f4fd0; color: #fff;
  display: flex; align-items: center; justify-content: center; font-size: 20px; font-weight: 700;
  margin-right: 12px; overflow: hidden; flex-shrink: 0;
}
.contact-avatar img { width: 100%; height: 100%; object-fit: cover; }
.contact-info { flex: 1; min-width: 0; }
.contact-info .cn { font-size: 15px; font-weight: 600; }
.contact-info .cc { font-size: 12.5px; color: #7b869b; margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.contact-btn { border: 1px solid #dbe2ee; background: #fff; border-radius: 8px; padding: 7px 12px; font-size: 13px; color: #1f4fd0; cursor: pointer; }
.empty { text-align: center; color: #98a1b3; font-size: 14px; padding: 30px 10px; }

/* 分享页 */
.share-body { background: #eef2fa; }
.share-app { padding: 20px 18px; }
.share-card-wrap { display: flex; justify-content: center; margin-bottom: 1px; }
.big-card {
  width: 100%; max-width: 370px; background: linear-gradient(135deg, #054559, #02181e);
  color: #fff; border-radius: 20px; padding: 28px 24px; box-shadow: 0 10px 30px rgba(18,49,107,.25);
}
.big-logo {
  width: 64px; height: 64px; border-radius: 16px; background: rgba(255,255,255,.92);
  display: flex; align-items: center; justify-content: center; font-size: 30px;
  font-weight: 800; color: #12316b; margin: 0 auto 18px; overflow: hidden;
}
.big-logo img { width: 100%; height: 100%; object-fit: contain; }
.big-name { font-size: 26px; font-weight: 800; letter-spacing: 1px; }
.big-name-pos { font-size: 14px; font-weight: 400; color: rgba(255,255,255,.75); margin-left: 8px; }
.big-company { font-size: 14px; color: rgba(255,255,255,.75); margin: 2px 0 5px; text-align: left; padding-left: 4px; line-height: 1.8; }
.big-rows { border-top: 1px solid rgba(255,255,255,.2); padding-top: 12px; }
.big-row { display: flex; align-items: center; padding: 2px 0; font-size: 14px; word-break: break-all; flex-wrap: nowrap; }
.big-row .br-ico { width: 26px; min-width: 26px; color: rgba(249,245,245,.75); font-style: normal; }
.big-row > *:not(.br-ico) { flex: 1; }
.big-row a { color: #fff; text-decoration: none; word-break: break-all; }
.share-actions { max-width: 360px; margin: 0 auto; }
.share-tip { color: #98a1b3; }

/* 分享提示框 */
.share-tip-box { max-width: 360px; margin: 8px auto; background: #fff7e6; border: 1px solid #ffd591; border-radius: 8px; padding: 10px 14px; font-size: 13px; color: #161514; text-align: center; }

/* 供需信息卡片 */
.supply-box { max-width: 370px; margin: 16px auto 0; background: #e7ebe2; border-radius: 12px; padding: 16px; box-shadow: 5px 9px 3px rgba(0,0,0,.06); }
.supply-title { font-size: 14px; font-weight: 700; color: #12316b; margin-bottom: 8px; }
.supply-content { font-size: 14px; color: #333; line-height: 1.6; word-break: break-all; overflow-wrap: break-word; }
.supply-content img { max-width: 100%; height: auto; border-radius: 8px; }
.supply-content video { max-width: 100%; height: auto; border-radius: 8px; display: block; margin: 8px 0; }
.supply-content p { margin: 0 0 8px 0; }
.supply-content p:last-child { margin-bottom: 0; }

/* 底部广告 */
.ad-box { display: block; max-width: 360px; margin: 16px auto 0; background: #fff; border-radius: 12px; overflow: hidden; box-shadow: 0 2px 12px rgba(0,0,0,.06); text-decoration: none; }
.ad-box img { width: 100%; display: block; }
.ad-title { padding: 10px 14px; font-size: 13px; color: #666; text-align: center; }









