/* 内蒙古商协会社会组织公共服务平台 一期主题 */
:root {
  --nmg-primary: #0F6E8C;
  --nmg-primary-deep: #0E5A73;
  --nmg-gold: #D4A017;
  --nmg-bg: #F6F8F9;
  --nmg-bg-soft: #EEF3F5;
  --nmg-ink: #1F2A33;
  --nmg-sub: #5A6B77;
  --nmg-radius: .75rem;
  --nmg-shadow: 0 4px 18px rgba(15, 110, 140, .08);
}
html, body { font-family: "Noto Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif; background: var(--nmg-bg); color: var(--nmg-ink); }
a { text-decoration: none; }
.text-nmg { color: var(--nmg-primary) !important; }
.bg-nmg { background: var(--nmg-primary) !important; }
.bg-nmg-deep { background: var(--nmg-primary-deep) !important; }
.text-gold { color: var(--nmg-gold) !important; }
.bg-gold { background: var(--nmg-gold) !important; }
.sub { color: var(--nmg-sub); }

/* 顶部导航 */
.nmg-nav { background: #fff; box-shadow: 0 2px 12px rgba(15, 110, 140, .10); }
.nmg-nav .navbar-brand { font-weight: 700; color: var(--nmg-primary); }
.nmg-nav .nav-link { color: var(--nmg-sub); font-weight: 500; }
.nmg-nav .nav-link.active, .nmg-nav .nav-link:hover { color: var(--nmg-primary); }
.brand-mark { display: inline-flex; width: 36px; height: 36px; border-radius: 10px; background: linear-gradient(135deg, var(--nmg-primary), var(--nmg-gold)); color: #fff; align-items: center; justify-content: center; font-weight: 800; }

/* 按钮 */
.btn-nmg { background: var(--nmg-primary); color: #fff; border: none; border-radius: .55rem; font-weight: 600; }
.btn-nmg:hover { background: var(--nmg-primary-deep); color: #fff; }
.btn-nmg:disabled, .btn-nmg.disabled { background: #9fb6bf; color: #fff; }
.btn-outline-nmg { border: 1px solid var(--nmg-primary); color: var(--nmg-primary); border-radius: .55rem; font-weight: 600; background: #fff; }
.btn-outline-nmg:hover { background: var(--nmg-bg-soft); color: var(--nmg-primary-deep); }
.btn-gold { background: var(--nmg-gold); color: #fff; border: none; border-radius: .55rem; font-weight: 600; }
.btn-gold:hover { filter: brightness(.95); color: #fff; }

/* 卡片 */
.card { border: none; border-radius: var(--nmg-radius); box-shadow: var(--nmg-shadow); }
.card-hover { transition: transform .18s ease, box-shadow .18s ease; }
.card-hover:hover { transform: translateY(-4px); box-shadow: 0 10px 28px rgba(15, 110, 140, .16); }

/* Hero 区块 */
.nmg-hero { background: linear-gradient(120deg, #EEF3F5 0%, #E8F1F4 55%, #FBF6E9 100%); border-radius: 1.2rem; }
.nmg-hero .big-title { font-size: clamp(1.5rem, 4vw, 2.4rem); font-weight: 800; color: var(--nmg-primary-deep); }

/* 统计卡 */
.stat-chip { background: #fff; border-radius: 1rem; padding: .9rem 1rem; box-shadow: var(--nmg-shadow); text-align: center; }
.stat-chip .num { font-size: 1.4rem; font-weight: 800; color: var(--nmg-primary); }
.stat-chip .lbl { color: var(--nmg-sub); font-size: .82rem; }

/* 表单面板 */
.form-panel { background: #fff; border-radius: 1rem; box-shadow: 0 8px 30px rgba(15, 110, 140, .10); padding: 1.4rem; }
.form-label { font-weight: 600; color: var(--nmg-ink); }

/* 状态徽章 */
.badge-soft-primary { background: #E3EEF2; color: var(--nmg-primary); }
.badge-soft-success { background: #E3F4E8; color: #15803D; }
.badge-soft-danger { background: #FBE9E9; color: #DC2626; }
.badge-soft-warning { background: #FCF3E0; color: #B45309; }
.badge-soft-secondary { background: #EDF1F3; color: #5A6B77; }

/* 协会logo占位 */
.logo-ph { display: flex; align-items: center; justify-content: center; background: var(--nmg-bg-soft); color: var(--nmg-primary); font-weight: 700; border-radius: .6rem; }
.logo-ph svg { width: 55%; height: 55%; }

/* 资源库缩略图网格：移动端1行2个 / 中屏3个 / 电脑4个 */
.res-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: .8rem; }
@media (min-width: 768px) { .res-grid { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 992px) { .res-grid { grid-template-columns: repeat(4, 1fr); } }
.res-thumb { position: relative; border-radius: .6rem; overflow: hidden; background: #fff; box-shadow: var(--nmg-shadow); cursor: pointer; }
.res-thumb img { width: 100%; aspect-ratio: 1; object-fit: cover; display: block; }
.res-thumb .res-meta { padding: .45rem .6rem .55rem; }
.res-thumb .res-name { font-size: .82rem; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.res-thumb .res-size { font-size: .72rem; color: var(--nmg-sub); }
.res-thumb .res-detail-btn { position: absolute; top: .4rem; right: .4rem; z-index: 3; }
.res-thumb .res-check { position: absolute; inset: 0; display: none; background: rgba(15, 110, 140, .42); z-index: 2; align-items: center; justify-content: center; }
.res-thumb .res-check .tick { width: 44px; height: 44px; border-radius: 50%; background: var(--nmg-primary); color: #fff; font-size: 1.4rem; display: flex; align-items: center; justify-content: center; }
.res-thumb.selected .res-check { display: flex; }

/* 消息角标 */
.msg-dot { position: absolute; top: -2px; right: -6px; }
.msg-dot-pulse { animation: pulse 1.6s infinite; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(220, 38, 38, .5); } 70% { box-shadow: 0 0 0 8px rgba(220, 38, 38, 0); } 100% { box-shadow: 0 0 0 0 rgba(220, 38, 38, 0); } }

/* 步骤条 */
.step-bar { display: flex; gap: .4rem; flex-wrap: wrap; }
.step-bar .step { flex: 1 1 0; min-width: 90px; text-align: center; font-size: .8rem; color: var(--nmg-sub); }
.step-bar .step .dot { width: 26px; height: 26px; margin: 0 auto .3rem; border-radius: 50%; background: #E3E9EC; color: var(--nmg-sub); display: flex; align-items: center; justify-content: center; font-weight: 700; }
.step-bar .step.done .dot { background: var(--nmg-primary); color: #fff; }
.step-bar .step.cur .dot { background: var(--nmg-gold); color: #fff; }

/* 后台侧边栏（协会端/超管端） */
.admin-shell { min-height: 100vh; }
.admin-side { background: var(--nmg-primary-deep); color: #fff; min-height: 100vh; }
.admin-side .nav-link { color: rgba(255, 255, 255, .78); border-radius: .5rem; padding: .55rem .9rem; margin: .15rem .6rem; font-size: .92rem; }
.admin-side .nav-link:hover { background: rgba(255, 255, 255, .08); color: #fff; }
.admin-side .nav-link.active { background: #fff; color: var(--nmg-primary-deep); font-weight: 700; }
.admin-side .nav-section { font-size: .72rem; color: rgba(255, 255, 255, .45); padding: .8rem 1rem .3rem; letter-spacing: .12em; }
@media (max-width: 991.98px) {
  .admin-side { position: fixed; top: 0; left: -280px; width: 260px; z-index: 1080; transition: left .25s; overflow-y: auto; }
  .admin-side.show { left: 0; }
  .admin-side-backdrop { position: fixed; inset: 0; background: rgba(0, 0, 0, .4); z-index: 1070; }
}
.admin-main { background: var(--nmg-bg); min-height: 100vh; }
.icon-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: .9rem; }
.icon-tile { background: #fff; border-radius: .9rem; padding: 1rem .5rem; text-align: center; box-shadow: var(--nmg-shadow); transition: transform .18s; color: var(--nmg-ink); }
.icon-tile:hover { transform: translateY(-4px); color: var(--nmg-primary); }
.icon-tile .ic { width: 46px; height: 46px; margin: 0 auto .5rem; border-radius: 12px; background: var(--nmg-bg-soft); color: var(--nmg-primary); display: flex; align-items: center; justify-content: center; font-size: 1.3rem; }

/* 列表项 */
.list-tile { background: #fff; border-radius: .7rem; box-shadow: var(--nmg-shadow); padding: .9rem 1rem; }
.avatar-ph { background: var(--nmg-bg-soft); color: var(--nmg-primary); display: flex; align-items: center; justify-content: center; border-radius: 50%; font-weight: 700; }

/* 预留功能置灰 */
.reserved-btn[disabled] { filter: grayscale(.8); opacity: .55; cursor: not-allowed; }

/* 分页 */
.pagination .page-link { color: var(--nmg-primary); }
.pagination .active .page-link { background: var(--nmg-primary); border-color: var(--nmg-primary); }

/* 页脚 */
.nmg-footer { background: var(--nmg-ink); color: rgba(255, 255, 255, .7); }
.nmg-footer a { color: rgba(255, 255, 255, .7); }
/* 图片渐进加载（通用）：小图模糊占位 → 大图淡入 */
.nmg-lqip { position: relative; overflow: hidden; background: var(--nmg-bg-soft); min-height: 60px; }
.nmg-lqip-bg { position: absolute; inset: 0; background-position: center; background-size: cover; background-repeat: no-repeat; filter: blur(12px); transform: scale(1.06); }
.nmg-lqip-img { position: relative; display: block; width: 100%; height: auto; opacity: 0; transition: opacity .35s ease; }
.nmg-lqip-img.is-loaded { opacity: 1; }
/* Banner（首屏大图） */
.nmg-banner { border-radius: .5rem; min-height: 80px; }
.nmg-footer-contact { display: flex; flex-wrap: wrap; gap: 6px 22px; justify-content: center; font-size: .82rem; color: rgba(255, 255, 255, .65); border-top: 1px solid rgba(255, 255, 255, .12); padding-top: 12px; }
.nmg-footer-contact a { color: rgba(255, 255, 255, .75); text-decoration: none; }
.nmg-footer-contact a:hover { color: #fff; text-decoration: underline; }

/* 弹层（layer v3.1.1）移动端兜底
   说明：JS 已按视口计算 area（见 nmg_ui.js 的 nmgArea），此处仅防止极端机型/字体缩放下溢出，
   并放大按钮触控区域、避开底部安全区（全面屏手势条） */
@media (max-width: 767.98px) {
  .layui-layer { max-width: 96vw !important; }
  .layui-layer-title { font-size: 15px !important; padding-right: 62px !important; }
  .layui-layer-dialog .layui-layer-content { max-height: 74vh; overflow-y: auto; -webkit-overflow-scrolling: touch; word-break: break-word; }
  .layui-layer-btn { padding: 8px 12px calc(8px + env(safe-area-inset-bottom)) !important; text-align: center !important; }
  .layui-layer-btn a { height: 38px !important; line-height: 36px !important; padding: 0 18px !important; }
}
