/* ============================================================
   UserGroup 前台样式
   ============================================================ */
*{box-sizing:border-box}
html,body{margin:0;padding:0}
body.ug-page{
  font-family:-apple-system,BlinkMacSystemFont,"PingFang SC","Microsoft YaHei",sans-serif;
  background:#f6f8fb;color:#1e293b;font-size:14px;line-height:1.6;
  min-height:100vh;display:flex;flex-direction:column;
}
body.ug-page a{color:#2563eb;text-decoration:none}
body.ug-page a:hover{text-decoration:underline}

/* ---------- 顶栏 ---------- */
.ug-topbar{
  background:#fff;border-bottom:1px solid #eef2f7;
  position:sticky;top:0;z-index:50;
  box-shadow:0 1px 3px rgba(15,23,42,.04);
}
.ug-topbar-inner{
  max-width:1080px;margin:0 auto;padding:14px 20px;
  display:flex;align-items:center;justify-content:space-between;gap:16px;
}
.ug-brand{
  display:inline-flex;align-items:center;gap:10px;
  color:#0f172a;font-weight:700;font-size:15px;
}
.ug-brand:hover{text-decoration:none}
.ug-brand-logo{
  width:32px;height:32px;border-radius:9px;
  background:linear-gradient(135deg,#2563eb,#7c3aed);
  color:#fff;display:inline-flex;align-items:center;justify-content:center;
  font-weight:700;font-size:16px;
}
.ug-topnav{display:flex;align-items:center;gap:6px}
.ug-topnav a{
  display:inline-block;padding:7px 14px;border-radius:7px;
  color:#475569;font-size:13.5px;font-weight:500;
  transition:all .15s;
}
.ug-topnav a:hover{background:#f1f5f9;text-decoration:none;color:#2563eb}
.ug-topnav .ug-register{
  background:linear-gradient(135deg,#2563eb,#7c3aed);color:#fff;
}
.ug-topnav .ug-register:hover{background:linear-gradient(135deg,#1d4ed8,#6d28d9);color:#fff}
.ug-topnav .ug-logout{color:#dc2626}
.ug-topnav .ug-logout:hover{background:#fef2f2;color:#dc2626}

/* ---------- 主内容 ---------- */
.ug-main{flex:1;max-width:1080px;width:100%;margin:0 auto;padding:28px 20px 60px}
.ug-footer{
  text-align:center;padding:22px 20px;color:#94a3b8;font-size:12.5px;
  border-top:1px solid #eef2f7;
}

/* ---------- 认证页 ---------- */
.ug-auth-wrap{
  display:flex;align-items:center;justify-content:center;
  padding:40px 20px;flex:1;
}
.ug-auth-card{
  width:100%;max-width:420px;background:#fff;border-radius:16px;
  box-shadow:0 12px 40px rgba(15,23,42,.08);padding:40px 36px 32px;
}
.ug-auth-card h1{margin:0 0 6px;font-size:22px;font-weight:700;color:#0f172a}
.ug-auth-sub{color:#94a3b8;font-size:13.5px;margin:0 0 24px}
.ug-auth-foot{
  margin-top:22px;padding-top:18px;border-top:1px solid #f1f5f9;
  text-align:center;font-size:13px;color:#94a3b8;
}

/* ---------- 表单 ---------- */
.ug-form .ug-field{margin-bottom:16px}
.ug-form .ug-field label{
  display:block;font-size:13px;font-weight:500;color:#334155;margin-bottom:6px;
}
.ug-form .ug-field input[type=text],
.ug-form .ug-field input[type=email],
.ug-form .ug-field input[type=password],
.ug-form .ug-field input[type=url],
.ug-form .ug-field input[type=file],
.ug-form .ug-field select,
.ug-form .ug-field textarea{
  display:block;width:100%;padding:10px 13px;
  border:1px solid #dfe3e8;border-radius:9px;
  font-size:14px;font-family:inherit;background:#fff;
  transition:border-color .15s,box-shadow .15s;
}
.ug-form .ug-field textarea{resize:vertical;min-height:90px;line-height:1.7}
.ug-form .ug-field input:focus,
.ug-form .ug-field select:focus,
.ug-form .ug-field textarea:focus{
  outline:0;border-color:#2563eb;box-shadow:0 0 0 3px rgba(37,99,235,.12);
}
.ug-hint{font-size:12px;color:#94a3b8;margin:6px 0 0}

.ug-row{display:grid;grid-template-columns:1fr 1fr;gap:14px}
@media (max-width:600px){.ug-row{grid-template-columns:1fr}}

/* ---------- 按钮 ---------- */
.ug-btn{
  display:inline-flex;align-items:center;justify-content:center;gap:6px;
  height:42px;padding:0 22px;border-radius:9px;border:0;
  font-size:14px;font-weight:500;font-family:inherit;
  cursor:pointer;transition:all .15s;
  text-decoration:none;
}
.ug-btn-primary{
  background:linear-gradient(135deg,#2563eb,#7c3aed);color:#fff;
  box-shadow:0 4px 14px rgba(37,99,235,.25);width:100%;
}
.ug-btn-primary:hover{
  background:linear-gradient(135deg,#1d4ed8,#6d28d9);
  box-shadow:0 6px 18px rgba(37,99,235,.35);
  text-decoration:none;color:#fff;
}
.ug-btn-outline{
  background:#fff;color:#475569;border:1px solid #dfe3e8;
}
.ug-btn-outline:hover{background:#f8fafc;text-decoration:none;color:#2563eb}

/* ---------- 提示条 ---------- */
.ug-alert{
  padding:12px 16px;border-radius:10px;font-size:13.5px;
  margin-bottom:18px;border:1px solid;
}
.ug-alert-success{background:#ecfdf5;border-color:#a7f3d0;color:#065f46}
.ug-alert-error{background:#fef2f2;border-color:#fecaca;color:#b91c1c}

/* ---------- 用户中心布局 ---------- */
.ug-layout{
  display:grid;grid-template-columns:240px minmax(0,1fr);gap:22px;align-items:start;
}
@media (max-width:820px){.ug-layout{grid-template-columns:1fr}}

.ug-sidebar{
  background:#fff;border-radius:14px;border:1px solid #eef2f7;
  box-shadow:0 1px 3px rgba(15,23,42,.04);padding:22px;
  position:sticky;top:88px;
}
.ug-sidebar-user{
  display:flex;justify-content:center;padding-bottom:16px;
  border-bottom:1px solid #f1f5f9;margin-bottom:14px;
}
.ug-sidebar-nav{display:flex;flex-direction:column;gap:2px}
.ug-sidebar-nav a{
  display:block;padding:9px 12px;border-radius:8px;
  color:#475569;font-size:13.5px;font-weight:500;
  transition:all .15s;
}
.ug-sidebar-nav a:hover{background:#f1f5f9;color:#2563eb;text-decoration:none}
.ug-sidebar-nav a.active{
  background:linear-gradient(135deg,#eff6ff,#f5f3ff);
  color:#2563eb;
}
.ug-sidebar-back{
  margin-top:8px;color:#94a3b8 !important;font-size:12.5px !important;
}

/* ---------- 内容区卡片 ---------- */
.ug-content{min-width:0}
.ug-card{
  background:#fff;border-radius:14px;border:1px solid #eef2f7;
  box-shadow:0 1px 3px rgba(15,23,42,.04);padding:24px 26px;margin-bottom:20px;
}
.ug-card-title{
  font-size:15px;font-weight:700;color:#0f172a;margin-bottom:18px;
  padding-left:10px;position:relative;
}
.ug-card-title::before{
  content:'';position:absolute;left:0;top:50%;transform:translateY(-50%);
  width:3px;height:16px;background:linear-gradient(180deg,#2563eb,#7c3aed);
  border-radius:2px;
}

/* ---------- Hero ---------- */
.ug-hero{
  background:linear-gradient(135deg,#1e293b,#0f172a);
  border-radius:16px;padding:30px;color:#fff;
  display:flex;align-items:center;gap:20px;margin-bottom:20px;
  position:relative;overflow:hidden;
}
.ug-hero::before{
  content:'';position:absolute;top:-80px;right:-40px;
  width:280px;height:280px;
  background:radial-gradient(circle,rgba(124,58,237,.5),transparent 70%);
  filter:blur(20px);pointer-events:none;
}
.ug-hero-avatar{
  position:relative;z-index:1;flex-shrink:0;
  width:72px;height:72px;border-radius:50%;overflow:hidden;
  border:3px solid rgba(255,255,255,.15);
}
.ug-hero-avatar img,
.ug-hero-avatar .ug-avatar{width:100%!important;height:100%!important;border-radius:50%}
.ug-hero-info{position:relative;z-index:1;min-width:0}
.ug-hero-info h1{margin:0 0 8px;font-size:22px;font-weight:700}
.ug-hero-badges{display:flex;gap:6px;flex-wrap:wrap;margin-bottom:6px}
.ug-hero-bio{margin:4px 0 0;color:#cbd5e1;font-size:13.5px}

.ug-badge{
  display:inline-block;padding:2px 10px;border-radius:10px;
  font-size:11.5px;font-weight:600;line-height:1.7;
}
.ug-badge-gray{background:rgba(255,255,255,.12);color:#cbd5e1}
.ug-badge-blue{background:rgba(37,99,235,.35);color:#dbeafe}
.ug-badge-admin{background:#f59e0b;color:#fff}

/* ---------- 统计 ---------- */
.ug-stats{
  display:grid;grid-template-columns:repeat(auto-fit,minmax(130px,1fr));
  gap:14px;margin-bottom:20px;
}
.ug-stat{
  background:#fff;border-radius:12px;border:1px solid #eef2f7;
  box-shadow:0 1px 3px rgba(15,23,42,.04);
  padding:18px;text-align:center;
}
.ug-stat-value{
  font-size:24px;font-weight:700;color:#0f172a;line-height:1.2;
  letter-spacing:-.02em;
}
.ug-stat-label{font-size:12.5px;color:#94a3b8;margin-top:4px}

/* ---------- 信息列表 ---------- */
.ug-info-list{
  display:grid;grid-template-columns:1fr 1fr;gap:0;
}
@media (max-width:600px){.ug-info-list{grid-template-columns:1fr}}
.ug-info-list > div{
  display:flex;justify-content:space-between;align-items:center;gap:10px;
  padding:11px 0;border-bottom:1px solid #f8fafc;font-size:13.5px;
}
.ug-info-list > div:last-child{border-bottom:0}
.ug-info-list span{color:#94a3b8}
.ug-info-list b{color:#0f172a;font-weight:600;text-align:right}

/* ---------- 头像预览 ---------- */
.ug-avatar-preview{
  display:flex;justify-content:center;padding:14px 0 22px;
}

/* ---------- 文章列表 ---------- */
.ug-post-list{display:flex;flex-direction:column;gap:0}
.ug-post-item{
  display:block;padding:14px 4px;border-bottom:1px solid #f1f5f9;
  color:inherit;transition:padding .15s;
}
.ug-post-item:last-child{border-bottom:0}
.ug-post-item:hover{text-decoration:none}
.ug-post-item:hover .ug-post-title{color:#2563eb}
.ug-post-title{
  font-size:14.5px;font-weight:600;color:#1e293b;
  transition:color .15s;margin-bottom:4px;
}
.ug-post-meta{
  display:flex;gap:14px;font-size:12.5px;color:#94a3b8;
}

/* ---------- 标签 / 空状态 ---------- */
.ug-tag{
  display:inline-block;padding:1px 8px;border-radius:5px;
  font-size:11.5px;font-weight:600;margin-left:6px;line-height:1.7;
}
.ug-tag-orange{background:#fff7ed;color:#ea580c}

.ug-empty{
  text-align:center;padding:40px 20px;color:#94a3b8;
  font-size:13.5px;margin:0;
}

/* ---------- 头像 ---------- */
.ug-avatar{
  display:inline-flex;align-items:center;justify-content:center;
  border-radius:50%;overflow:hidden;
  color:#fff;font-weight:600;flex-shrink:0;
}
.ug-avatar img{width:100%;height:100%;object-fit:cover;display:block}

/* ---------- 分页 ---------- */
body.ug-page .pagination{
  display:flex;justify-content:center;gap:5px;margin-top:20px;
  flex-wrap:wrap;
}
body.ug-page .pagination a,
body.ug-page .pagination .current,
body.ug-page .pagination span{
  display:inline-flex;align-items:center;justify-content:center;
  min-width:34px;height:34px;padding:0 10px;border-radius:7px;
  background:#fff;border:1px solid #eef2f7;color:#475569;
  font-size:13.5px;
}
body.ug-page .pagination a:hover{
  border-color:#bfdbfe;color:#2563eb;background:#eff6ff;text-decoration:none;
}
body.ug-page .pagination .current{
  background:#2563eb;border-color:#2563eb;color:#fff;
}

/* ---------- 用户组标签 ---------- */
.user-group-tag{
  display:inline-block;padding:2px 9px;border-radius:9px;
  color:#fff;font-size:11.5px;font-weight:600;line-height:1.7;
  margin-right:4px;
}
.user-group-badge{display:inline-flex;gap:3px;flex-wrap:wrap}