/* 四海商塾 · 名片 M69 样式（Shard-C 维护）
 * 含：ME 页 8 宫格 / 名片成品页 / 整页编辑器 / 实时预览
 * 设计 token：深海军蓝 #16304a · 暖金 #c9a25b · 米白底 #f6f3ed
 */

/* ============ A) ME 页 8 宫格 ============ */
.me-grid8 {
  background: #fff; border-radius: 18px; margin: 12px 12px 0;
  display: grid; grid-template-columns: repeat(4, 1fr);
  box-shadow: 0 8px 22px rgba(14,36,56,.06); border: 1px solid #f1ece1;
  overflow: hidden;
}
.me-grid8 .mg8 {
  background: none; border: 0; cursor: pointer; padding: 16px 4px 14px;
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  color: #16304a; position: relative;
}
.me-grid8 .mg8 + .mg8, .me-grid8 .mg8:nth-child(-n+4) ~ .mg8 {
  border-top: 1px solid #f1ece1;
}
.me-grid8 .mg8::before {
  content: ''; position: absolute; left: 0; top: 18%; bottom: 18%; width: 1px; background: #f1ece1;
}
.me-grid8 .mg8:nth-child(4n+1)::before { display: none; }
.me-grid8 .mg8 .mg8-ic { width: 26px; height: 26px; color: #16304a; display: inline-flex; }
.me-grid8 .mg8 .mg8-ic svg { width: 100%; height: 100%; }
.me-grid8 .mg8 b { font-size: 12px; font-weight: 500; color: #2a3a4d; letter-spacing: .3px; }
.me-grid8 .mg8:active { background: #faf7f0; }

/* ME 学分紧凑小入口 */
.me-slim {
  background: #fff; border: 1px solid #f1ece1; border-radius: 14px; margin: 12px 12px 0;
  display: flex; align-items: center; gap: 10px; padding: 10px 14px; width: calc(100% - 24px);
  box-shadow: 0 8px 22px rgba(14,36,56,.06); cursor: pointer; color: #16304a;
}
.me-slim-ic { width: 34px; height: 34px; border-radius: 50%; background: #faf4e6; color: #bd8f52; display: inline-flex; align-items: center; justify-content: center; flex: none; }
.me-slim-ic svg { width: 19px; height: 19px; }
.me-slim-tx { flex: 1; text-align: left; display: flex; flex-direction: column; line-height: 1.25; }
.me-slim-tx b { font-size: 15px; color: #16304a; }
.me-slim-tx span { font-size: 11px; color: #8a95a3; }
.me-slim-go { color: #c8bfa9; font-size: 16px; }
.me-friends-slim .me-fpin { display: flex; gap: 12px; overflow-x: auto; padding-bottom: 2px; }
.me-friends-slim .me-fpin-item { flex: none; }

/* ME 紧凑小入口（学分 / 好友） */
.me-compact {
  background: #fff; border-radius: 16px; margin: 12px 12px 0;
  display: flex; box-shadow: 0 8px 22px rgba(14,36,56,.06); border: 1px solid #f1ece1;
}
.me-compact .mc-item {
  flex: 1; background: none; border: 0; cursor: pointer; display: flex; align-items: center; gap: 10px;
  padding: 12px 14px; text-align: left; color: #16304a;
}
.me-compact .mc-item + .mc-item { border-left: 1px solid #f1ece1; }
.me-compact .mc-ic { width: 34px; height: 34px; border-radius: 50%; background: #faf4e6; color: #bd8f52; display: inline-flex; align-items: center; justify-content: center; flex: none; }
.me-compact .mc-ic svg { width: 19px; height: 19px; }
.me-compact .mc-item b { display: block; font-size: 15px; color: #16304a; line-height: 1.2; }
.me-compact .mc-item span { font-size: 11px; color: #8a95a3; }
.me-compact .mc-go { margin-left: auto; color: #c8bfa9; font-size: 16px; }

/* ============ B) 名片成品页 ============ */
.nc-wrap {
  max-width: 680px; margin: 0 auto; padding: 12px 12px 40px;
  background: #f6f3ed; min-height: 100vh; box-sizing: border-box;
}
.nc-loading { padding: 80px 0; text-align: center; color: #8a95a3; }

.nc-hero {
  position: relative; border-radius: 20px; padding: 16px 18px 18px;
  box-shadow: 0 14px 32px rgba(14,36,56,.18); overflow: hidden;
}
.nc-brand { position: absolute; top: 14px; right: 16px; display: flex; align-items: center; gap: 7px; color: #16395a; }
.nc-brand-logo { width: 26px; height: 26px; border-radius: 50%; background: #fff; display: inline-flex; align-items: center; justify-content: center; overflow: hidden; }
.nc-brand-logo img { width: 18px; height: 18px; }
.nc-brand-tx { display: flex; flex-direction: column; line-height: 1.1; }
.nc-brand-tx b { font-size: 12px; color: #16395a; }
.nc-brand-tx em { font-style: normal; font-size: 9.5px; color: #5d6878; }

.nc-hero-top { display: flex; gap: 14px; align-items: flex-start; margin-top: 14px; }
.nc-ava { position: relative; width: 74px; height: 74px; flex: none; }
.nc-ava-img, .nc-ava-ph {
  width: 74px; height: 74px; border-radius: 50%; object-fit: cover;
  border: 2px solid #d8b273; box-shadow: 0 4px 12px rgba(14,36,56,.18); background: #fff;
}
.nc-ava-ph { display: flex; align-items: center; justify-content: center; font-size: 28px; color: #16395a; font-weight: 600; }
.nc-medal {
  position: absolute; right: -4px; bottom: -4px; width: 29px; height: 29px; border-radius: 50%;
  background: linear-gradient(160deg,#d8b273,#bd8f52); color: #fff; display: flex; align-items: center; justify-content: center;
  border: 2px solid #fff;
}
.nc-medal svg { width: 16px; height: 16px; }
.nc-id { flex: 1; min-width: 0; padding-top: 4px; }
.nc-name { font-size: 20px; font-weight: 700; color: #16304a; letter-spacing: 1px; margin: 0; }
.nc-co { font-size: 12px; color: #465566; margin-top: 5px; }
.nc-job { font-size: 12px; color: #8a95a3; margin-top: 2px; }
.nc-badge {
  display: inline-block; margin-top: 8px; padding: 3px 12px; border-radius: 20px;
  background: linear-gradient(160deg,#d8b273,#bd8f52); color: #fff; font-size: 11.5px; letter-spacing: .5px;
}
.nc-hero-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: .16; pointer-events: none; }

.nc-hero-bot {
  border-radius: 0 0 20px 20px; padding: 18px 20px 22px; margin-top: -6px;
  box-shadow: 0 14px 32px rgba(14,36,56,.18); position: relative; z-index: 1;
}
.nc-s1 { margin: 0; font-size: 19px; font-weight: 700; color: #fff; letter-spacing: 1px; }
.nc-s2 { margin: 6px 0 0; font-size: 12.5px; color: rgba(255,255,255,.78); line-height: 1.6; }

.nc-contact {
  background: #fff; border-radius: 18px; margin-top: 14px; padding: 16px 6px;
  display: flex; box-shadow: 0 8px 22px rgba(14,36,56,.06); border: 1px solid #f1ece1;
}
.nc-c-cell { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 5px; text-align: center; padding: 0 4px; }
.nc-c-ic { width: 44px; height: 44px; border-radius: 50%; background: #f4f1ea; color: #465566; display: flex; align-items: center; justify-content: center; }
.nc-c-ic svg { width: 22px; height: 22px; }
.nc-c-cell b { font-size: 13.5px; color: #16304a; font-weight: 600; }
.nc-c-v { font-size: 11px; color: #8a95a3; line-height: 1.4; word-break: break-all; }

.nc-card {
  background: #fff; border-radius: 18px; margin-top: 14px; padding: 16px;
  box-shadow: 0 8px 22px rgba(14,36,56,.06); border: 1px solid #f1ece1;
}
.nc-sec-t { display: flex; align-items: center; gap: 8px; font-size: 17px; font-weight: 700; color: #16304a; margin-bottom: 12px; }
.nc-bar { width: 4px; height: 16px; border-radius: 2px; background: linear-gradient(180deg,#d8b273,#bd8f52); display: inline-block; }
.nc-edit-link { margin-left: auto; font-size: 13px; color: #a8813f; background: none; border: 0; cursor: pointer; font-weight: 400; }
.nc-poster { width: 100%; height: 200px; object-fit: cover; border-radius: 14px; display: block; }
.nc-co-name { font-size: 19px; font-weight: 700; color: #16304a; margin: 12px 0 4px; }
.nc-co-name sup { font-size: 11px; color: #8a95a3; margin-left: 2px; }
.nc-co-tag { font-size: 12.5px; color: #a8813f; }
.nc-divider { width: 34px; height: 2px; background: linear-gradient(90deg,#d8b273,#bd8f52); margin: 14px 0; border-radius: 1px; }
.nc-co-intro { font-size: 13.5px; color: #566575; line-height: 1.8; margin: 0; white-space: pre-wrap; }

.nc-facts { display: flex; margin-top: 16px; }
.nc-fact { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 3px; text-align: center; }
.nc-f-ic { width: 26px; height: 26px; color: #16304a; }
.nc-f-ic svg { width: 100%; height: 100%; }
.nc-fact b { font-size: 18px; color: #16304a; }
.nc-fact span { font-size: 11.5px; color: #8a95a3; }

.nc-banner {
  margin-top: 14px; border-radius: 18px; height: 118px; padding: 0 20px;
  background-size: cover; background-position: center; color: #fff;
  display: flex; flex-direction: column; justify-content: center; gap: 6px;
}
.nc-banner b { font-size: 20px; font-weight: 700; }
.nc-banner span { font-size: 12.5px; color: rgba(255,255,255,.82); }

.nc-blocks { padding: 16px; }
.nc-block-text { font-size: 13.5px; color: #465566; line-height: 1.8; margin: 0 0 12px; white-space: pre-wrap; }
.nc-block-text:last-child { margin-bottom: 0; }
.nc-block-img { width: 100%; border-radius: 14px; margin-bottom: 10px; display: block; }
.nc-block-img:last-child { margin-bottom: 0; }

.nc-actions { margin-top: 18px; display: flex; flex-direction: column; gap: 10px; }
.nc-actions.row { flex-direction: row; }
.nc-share {
  height: 52px; border-radius: 14px; border: 0; cursor: pointer; width: 100%;
  background: linear-gradient(160deg,#d8b273,#bd8f52); color: #fff; font-size: 16px; font-weight: 700; letter-spacing: 2px;
}
.nc-edit-pill {
  align-self: center; background: #fff; border: 1px solid #e6dcc6; color: #8a6a2e;
  padding: 9px 26px; border-radius: 20px; font-size: 13.5px; cursor: pointer;
}
.nc-o-add, .nc-o-advisor { flex: 1; height: 48px; border-radius: 14px; font-size: 15px; font-weight: 600; cursor: pointer; }
.nc-o-add { background: #fff; border: 1px solid #e6dcc6; color: #16304a; }
.nc-o-advisor { background: linear-gradient(160deg,#d8b273,#bd8f52); color: #fff; border: 0; }
.nc-foot { text-align: center; font-size: 11px; color: #b6bcc6; margin-top: 24px; }
.nc-empty { text-align: center; padding: 40px 16px; }
.nc-empty h3 { color: #16304a; margin: 0 0 8px; }

.nc-longimg-ov { position: fixed; inset: 0; background: rgba(0,0,0,.9); z-index: 9999; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 20px; }
.nc-longimg-ov img { max-width: 100%; max-height: 80vh; border-radius: 8px; }
.nc-longimg-ov p { color: #fff; margin-top: 14px; font-size: 14px; }

/* ============ C) 整页编辑器 ============ */
.ce-page { background: #f6f3ed; min-height: 100vh; padding-bottom: 30px; }
.ce-topbar {
  position: sticky; top: 0; z-index: 50; display: flex; align-items: center; justify-content: space-between;
  padding: 12px 16px; background: rgba(246,243,237,.86); backdrop-filter: blur(10px);
  border-bottom: 1px solid #f1ece1;
}
.ce-topbar b { font-size: 16px; color: #16304a; }
.ce-back { background: none; border: 0; font-size: 24px; color: #16304a; cursor: pointer; line-height: 1; padding: 4px 8px; }
.ce-save {
  background: linear-gradient(160deg,#d8b273,#bd8f52); color: #fff; border: 0; cursor: pointer;
  padding: 8px 20px; border-radius: 20px; font-size: 14px; font-weight: 600;
}
.ce-save:disabled { opacity: .6; }
.ce-body { max-width: 680px; margin: 0 auto; padding: 12px; }
.ce-sec {
  background: #fff; border-radius: 16px; padding: 14px; margin-bottom: 12px;
  box-shadow: 0 8px 22px rgba(14,36,56,.06); border: 1px solid #f1ece1;
}
.ce-sec-t { font-size: 14px; font-weight: 700; color: #16304a; margin-bottom: 10px; display: flex; align-items: center; gap: 8px; }
.ce-sec-t::before { content: ''; width: 3px; height: 14px; border-radius: 2px; background: linear-gradient(180deg,#d8b273,#bd8f52); }

.ce-tpls { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; }
.ce-tpl { position: relative; border: 2px solid transparent; border-radius: 10px; background: none; cursor: pointer; padding: 4px; display: flex; flex-direction: column; gap: 4px; align-items: center; }
.ce-tpl.on { border-color: #bd8f52; }
.ce-tpl-sw { width: 100%; height: 26px; border-radius: 6px 6px 0 0; display: block; }
.ce-tpl-sw.bot { border-radius: 0 0 6px 6px; height: 16px; }
.ce-tpl em { font-style: normal; font-size: 10px; color: #566575; }
.ce-tpl-ok { position: absolute; top: -6px; right: -6px; width: 18px; height: 18px; border-radius: 50%; background: #bd8f52; color: #fff; font-size: 11px; font-style: normal; display: flex; align-items: center; justify-content: center; }

.ce-vis { display: flex; flex-direction: column; gap: 8px; }
.ce-vis-o { display: flex; align-items: center; gap: 8px; font-size: 13.5px; color: #465566; cursor: pointer; }
.ce-cols { display: flex; gap: 10px; }
.ce-cols .field { flex: 1; }
.ce-up-row { display: flex; gap: 12px; align-items: flex-start; margin-bottom: 10px; }
.ce-up-row .ce-cols { flex: 1; }
.ce-upload {
  width: 64px; height: 64px; border-radius: 12px; border: 1.5px dashed #d8cfb8; display: flex; align-items: center; justify-content: center;
  color: #a8813f; font-size: 12px; cursor: pointer; overflow: hidden; flex: none; background: #fcfaf6;
}
.ce-upload img { width: 100%; height: 100%; object-fit: cover; }
.ce-upload.wide { width: 100%; height: 90px; margin-bottom: 10px; }

.ce-fact { display: flex; gap: 8px; margin-bottom: 8px; }
.ce-fact input { flex: 1; }

.ce-block-ops { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 10px; }
.ce-block { border: 1px solid #f1ece1; border-radius: 12px; padding: 10px; margin-bottom: 10px; background: #fcfaf6; }
.ce-block-bar { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.ce-block-idx { font-size: 12px; color: #8a95a3; }
.ce-block-type { font-size: 12px; color: #a8813f; }
.ce-block-op { margin-left: auto; display: flex; gap: 6px; }
.ce-block-op button { background: #fff; border: 1px solid #e6dcc6; border-radius: 6px; padding: 3px 9px; font-size: 12px; cursor: pointer; color: #465566; }
.ce-block-op button:disabled { opacity: .4; cursor: default; }
.ce-block-op .ce-del { color: #b5463a; border-color: #e8c9c4; }
.ce-block textarea { width: 100%; border: 1px solid #e6dcc6; border-radius: 10px; padding: 8px; font-size: 13px; resize: vertical; box-sizing: border-box; }
.ce-block-img { width: 100%; border-radius: 10px; }

.ce-preview-sec { background: #eef1f5; }
.ce-phone {
  width: 320px; max-width: 100%; margin: 0 auto; background: #f6f3ed; border-radius: 24px; overflow: hidden;
  box-shadow: 0 10px 30px rgba(14,36,56,.15);
}
.ce-phone #cePreview .nc-wrap { padding: 8px; max-width: none; }
.ce-phone #cePreview .nc-hero { border-radius: 14px; }
.ce-phone #cePreview .nc-hero-bot { border-radius: 0 0 14px 14px; }

/* 通用 field 复用已有 styles.css；补充编辑器聚焦态 */
.ce-sec input:focus, .ce-sec textarea:focus { outline: none; border-color: #c9a25b !important; }

@media (max-width: 380px) {
  .nc-c-cell b { font-size: 12px; }
  .nc-c-v { font-size: 10px; }
}
