/* PC正文宽由共享主列接管，沿用现有gutter只扣一次，不保留旧1664等比上限。 */
@media (min-width:1024px){.hg-main>.main.hg-settings{max-width:none}}
/* 私有尺寸：PC按1920设计稿同比，H5沿用独立移动稿的像素值。 */
:root{--hg-profile-unit:1px;--hg-profile-text-unit:1px;--hg-profile-aux-min:0px}
@media (min-width:1024px){:root{--hg-profile-unit:var(--hg-pc-unit,calc(100vw / 1920));--hg-profile-text-unit:var(--hg-text-unit,max(.875px,var(--hg-profile-unit)));--hg-profile-aux-min:12px}}
/* 账户设置（Figma 1356:21768）。左右 gutter 与个人中心同源，PC内容区跟随共享主列。 */
.hg-settings{
  box-sizing:border-box;
  max-width:none;
  margin:0;
  padding:24px var(--page-gutter) 88px
}
@media (min-width:769px){
  .hg-settings{padding-top:32px}
}
.hg-settings__head{
  display:flex;align-items:flex-start;justify-content:space-between;gap:calc(16 * var(--hg-profile-unit));
  margin-top:calc(14 * var(--hg-profile-unit))
}
.hg-settings__titles h1{
  margin:0;color:#fff;font-size:max(14px,calc(26 * var(--hg-profile-text-unit)));font-weight:600;line-height:calc(39 * var(--hg-profile-text-unit));letter-spacing:calc(-.04 * var(--hg-profile-unit))
}
.hg-settings__titles p{
  margin:calc(3 * var(--hg-profile-unit)) 0 0;color:rgba(255,255,255,.6);font-size:max(14px,calc(14 * var(--hg-profile-text-unit)));line-height:calc(20 * var(--hg-profile-text-unit))
}
.hg-settings__card{
  display:flex;align-items:center;gap:calc(20 * var(--hg-profile-unit));
  box-sizing:border-box;min-height:calc(90 * var(--hg-profile-unit));margin-top:calc(20 * var(--hg-profile-unit));padding:calc(17 * var(--hg-profile-unit)) calc(25 * var(--hg-profile-unit));
  border:calc(1 * var(--hg-profile-unit)) solid rgba(255,255,255,.06);border-radius:calc(14 * var(--hg-profile-unit));background:#161616
}
.hg-settings__head + .hg-settings__card{margin-top:calc(30 * var(--hg-profile-unit))}
.hg-settings__card[hidden]{display:none!important}
.hg-settings__card--edit{
  display:block;min-height:calc(110 * var(--hg-profile-unit));padding:calc(20 * var(--hg-profile-unit)) calc(36 * var(--hg-profile-unit)) calc(20 * var(--hg-profile-unit)) calc(23 * var(--hg-profile-unit));
  border-color:rgba(255,255,255,.1);border-radius:calc(16 * var(--hg-profile-unit))
}
.hg-settings__left{
  display:flex;align-items:center;gap:calc(48 * var(--hg-profile-unit));min-width:0;flex:1
}
.hg-settings__label{
  flex-shrink:0;width:calc(56 * var(--hg-profile-unit));color:rgba(255,255,255,.65);font-size:max(14px,calc(14 * var(--hg-profile-text-unit)));line-height:calc(21 * var(--hg-profile-text-unit));
  letter-spacing:calc(-.15 * var(--hg-profile-unit));text-align:left
}
.hg-settings__avatar{
  flex-shrink:0;width:calc(50 * var(--hg-profile-unit));height:calc(50 * var(--hg-profile-unit));border-radius:calc(25 * var(--hg-profile-unit));overflow:hidden;background:#fff
}
.hg-settings__avatar img{display:block;width:100%;height:100%;object-fit:cover}
/* TG 风格色块头像（hg/user-avatar 的 .hg-avatar）撑满 50px 的外框：
   子模板的 --md 档是 56px，不压尺寸会被外框的 overflow:hidden 裁掉一圈。 */
.hg-settings__avatar .hg-avatar{width:100%;height:100%;font-size:max(14px,calc(20 * var(--hg-profile-text-unit)))}
.hg-settings__name{
  min-width:0;color:#fff;font-size:max(14px,calc(18 * var(--hg-profile-text-unit)));font-weight:600;line-height:calc(24 * var(--hg-profile-text-unit));letter-spacing:calc(-.3 * var(--hg-profile-unit));
  overflow:hidden;text-overflow:ellipsis;white-space:nowrap
}
.hg-settings__nick-row{display:flex;align-items:center;width:100%}
.hg-settings__nick-row .hg-settings__label{margin-right:calc(48 * var(--hg-profile-unit))}
.hg-settings__input{
  box-sizing:border-box;flex:1;min-width:0;height:calc(44 * var(--hg-profile-unit));padding:0 calc(14 * var(--hg-profile-unit));border:calc(1 * var(--hg-profile-unit)) solid #ffd21c;
  border-radius:calc(6 * var(--hg-profile-unit));background:#1a1a1b;color:#fff;font-size:max(14px,calc(15 * var(--hg-profile-text-unit)));font-weight:500;outline:none
}
.hg-settings__hint{margin:calc(8 * var(--hg-profile-unit)) calc(240 * var(--hg-profile-unit)) 0 calc(104 * var(--hg-profile-unit));color:#5c5c5e;font-size:max(12px,calc(12 * var(--hg-profile-text-unit)));line-height:calc(17 * var(--hg-profile-text-unit))}
.hg-settings__actions{display:flex;align-items:center;gap:calc(20 * var(--hg-profile-unit));flex-shrink:0;margin-left:calc(20 * var(--hg-profile-unit))}
.hg-settings__ghost,.hg-settings__save{
  -webkit-appearance:none;appearance:none;box-sizing:border-box;flex-shrink:0;
  display:inline-flex;align-items:center;justify-content:center;
  width:calc(100 * var(--hg-profile-unit));height:calc(46 * var(--hg-profile-unit));padding:0;border-radius:calc(999 * var(--hg-profile-unit));font-size:max(12px,calc(13 * var(--hg-profile-text-unit)));font-weight:500;
  line-height:calc(19.5 * var(--hg-profile-text-unit));letter-spacing:calc(-.08 * var(--hg-profile-unit));white-space:nowrap;cursor:pointer
}
.hg-settings__card--edit .hg-settings__ghost,.hg-settings__save{font-size:max(14px,calc(14 * var(--hg-profile-text-unit)))}
button.hg-settings__ghost{
  border:calc(1 * var(--hg-profile-unit)) solid rgba(255,255,255,.2);
  background:rgba(0,0,0,.5);background-color:rgba(0,0,0,.5);background-image:none;
  color:rgba(255,255,255,.8)
}
/* 压过 common.css 的 button:not(.hg-btn){background-color:unset}，否则黄底被卸掉。 */
button.hg-settings__save{
  border:0;background:#ffd21c;background-color:#ffd21c;background-image:none;color:#000
}
button.hg-settings__ghost:disabled,button.hg-settings__save:disabled{opacity:.55;cursor:default}
/* 提示条钉在视口正中，不再贴底（44755）：昵称编辑区在页面靠上位置，
   原先 bottom:32px 让「昵称不能为空」出现在视口最下沿，离用户视线焦点太远，
   测试当时直接没看见、按「保存无提示」报的单。改成正中后与操作区同屏可见。 */
.hg-settings__toast{
  position:fixed;left:50%;top:50%;z-index:80;transform:translate(-50%,-50%);
  max-width:min(calc(420 * var(--hg-profile-unit)),calc(100vw - calc(32 * var(--hg-profile-unit))));padding:calc(10 * var(--hg-profile-unit)) calc(16 * var(--hg-profile-unit));border-radius:calc(8 * var(--hg-profile-unit));
  background:rgba(0,0,0,.82);color:#fff;font-size:max(12px,calc(13 * var(--hg-profile-text-unit)));line-height:calc(18 * var(--hg-profile-text-unit));pointer-events:none
}
.hg-avatar-pick{
  position:fixed;inset:0;z-index:12020;display:flex;align-items:center;justify-content:center;
  padding:calc(16 * var(--hg-profile-unit));box-sizing:border-box
}
.hg-avatar-pick[hidden]{display:none!important}
.hg-avatar-pick__backdrop{position:absolute;inset:0;background:rgba(0,0,0,.72)}
/* max-height + 自身滚动是给矮屏兜底：色板 20 色在窄屏是 4 列五行（~420px），
   加上标题/预览/按钮，iPhone SE 那档 667 高会顶出视口、确认键点不到。
   dvh 覆盖移动端地址栏收放；不支持 dvh 的浏览器落回上一条 vh。 */
.hg-avatar-pick__box{
  position:relative;z-index:1;box-sizing:border-box;width:calc(480 * var(--hg-profile-unit));max-width:100%;
  max-height:calc(100vh - calc(32 * var(--hg-profile-unit)));max-height:calc(100dvh - calc(32 * var(--hg-profile-unit)));overflow-y:auto;
  padding:calc(32 * var(--hg-profile-unit));border:calc(1 * var(--hg-profile-unit)) solid rgba(255,255,255,.1);border-radius:calc(24 * var(--hg-profile-unit));background:#111;
  box-shadow:0 calc(24 * var(--hg-profile-unit)) calc(24 * var(--hg-profile-unit)) rgba(0,0,0,.5)
}
.hg-avatar-pick__head{display:flex;align-items:flex-start;justify-content:space-between;gap:calc(16 * var(--hg-profile-unit))}
.hg-avatar-pick__head h2{margin:0;color:#fff;font-size:max(14px,calc(32 * var(--hg-profile-text-unit)));font-weight:600;line-height:1.4}
.hg-avatar-pick__head p{margin:calc(6 * var(--hg-profile-unit)) 0 0;color:#8e8e93;font-size:max(14px,calc(14 * var(--hg-profile-text-unit)));line-height:1.4}
.hg-avatar-pick__x{
  display:flex;align-items:center;justify-content:center;flex-shrink:0;
  width:calc(40 * var(--hg-profile-unit));height:calc(40 * var(--hg-profile-unit));padding:0;border:0;border-radius:calc(8 * var(--hg-profile-unit));
  background:rgba(255,255,255,.05);cursor:pointer
}
.hg-avatar-pick__x img{display:block;width:calc(28 * var(--hg-profile-unit));height:calc(28 * var(--hg-profile-unit))}
/* 预览：所选背景色 + 昵称首字符，实时跟着色块走。
   .hg-avatar 来自 hg/user-avatar 子模板（样式在 shell.tpl 的 hg/user-avatar-style），
   这里只压尺寸——单类 (0,1,0) 被下面的 (0,2,0) 稳压。 */
.hg-avatar-pick__preview{display:flex;align-items:center;gap:calc(16 * var(--hg-profile-unit));margin-top:calc(24 * var(--hg-profile-unit))}
.hg-avatar-pick__preview-dot{display:flex;flex-shrink:0}
.hg-avatar-pick__preview .hg-avatar{width:calc(72 * var(--hg-profile-unit));height:calc(72 * var(--hg-profile-unit));font-size:max(14px,calc(30 * var(--hg-profile-text-unit)))}
.hg-avatar-pick__preview-tip{margin:0;color:#8e8e93;font-size:max(12px,calc(13 * var(--hg-profile-text-unit)));line-height:calc(19 * var(--hg-profile-text-unit))}
/* 列数跟着色板数量走：色板 20 色，PC 排 10 列正好两行满行（8 列会剩半行 4 个，
   左对齐地吊在下面）。弹窗内容区 480-2*32=416px，10 列 + 9 道 10px 间距，
   每格 32.6px —— 所以下面 swatch 的 min-height 必须小于它，否则 aspect-ratio
   被顶掉、圆点又会压成椭圆（改造时在窄屏上踩过一次）。 */
.hg-avatar-pick__grid{
  display:grid;grid-template-columns:repeat(10,minmax(0,1fr));gap:calc(10 * var(--hg-profile-unit));margin-top:calc(24 * var(--hg-profile-unit))
}
/* 色块的背景色走**行内 style**（模板里 style="background-color:#XXXXXX"）：
   common.css 有 button:not(.hg-btn){background-color:unset}，特异度 (0,1,1)，
   同级类选择器压不稳；行内样式一定赢。这里只负责形状，绝不在类里写 background-color，
   免得日后有人以为改这儿就能换色。background-image:none 是清掉 common.css 同一条预设。 */
button.hg-avatar-pick__swatch{
  -webkit-appearance:none;appearance:none;box-sizing:border-box;
  width:100%;aspect-ratio:1/1;min-height:calc(28 * var(--hg-profile-unit));padding:0;border:0;border-radius:50%;
  background-image:none;cursor:pointer;transition:transform .12s ease
}
button.hg-avatar-pick__swatch:hover{transform:scale(1.08)}
/* 选中环：内圈先补一圈弹窗底色再画黄环，避免黄环紧贴色块看不出间隙。 */
button.hg-avatar-pick__swatch.is-on{box-shadow:0 0 0 calc(2 * var(--hg-profile-unit)) #111,0 0 0 calc(4 * var(--hg-profile-unit)) #ffd21c}
.hg-avatar-pick__actions{display:flex;align-items:center;justify-content:center;gap:calc(20 * var(--hg-profile-unit));margin-top:calc(24 * var(--hg-profile-unit))}
.hg-avatar-pick__cancel,button.hg-avatar-pick__ok{
  -webkit-appearance:none;appearance:none;box-sizing:border-box;
  display:inline-flex;align-items:center;justify-content:center;
  width:calc(198 * var(--hg-profile-unit));height:calc(42 * var(--hg-profile-unit));padding:0 calc(24 * var(--hg-profile-unit));border-radius:calc(100 * var(--hg-profile-unit));
  font-size:max(14px,calc(14 * var(--hg-profile-text-unit)));font-weight:500;line-height:normal;white-space:nowrap;cursor:pointer
}
.hg-avatar-pick__cancel{border:calc(1 * var(--hg-profile-unit)) solid rgba(255,255,255,.1);background:#242426;color:#8e8e93}
button.hg-avatar-pick__ok{
  border:calc(1 * var(--hg-profile-unit)) solid rgba(255,255,255,.1);
  background:#ffd21c;background-color:#ffd21c;background-image:none;color:#000
}
button.hg-avatar-pick__ok:disabled{opacity:.55;cursor:default}
body.is-hg-avatar-open{overflow:hidden}
@media (max-width:900px){
  .hg-settings__head{margin-top:calc(8 * var(--hg-profile-unit));align-items:flex-start}
  .hg-settings__titles h1{font-size:max(14px,calc(22 * var(--hg-profile-text-unit)));line-height:calc(30 * var(--hg-profile-text-unit))}
  .hg-settings__titles p{font-size:max(12px,calc(13 * var(--hg-profile-text-unit)))}
  .hg-settings__card{
    min-height:calc(70 * var(--hg-profile-unit));padding:calc(16 * var(--hg-profile-unit)) calc(14 * var(--hg-profile-unit));margin-top:calc(12 * var(--hg-profile-unit));gap:calc(12 * var(--hg-profile-unit))
  }
  .hg-settings__head + .hg-settings__card{margin-top:calc(16 * var(--hg-profile-unit))}
  .hg-settings__left{gap:calc(16 * var(--hg-profile-unit))}
  .hg-settings__label{width:auto;text-align:left}
  .hg-settings__avatar{width:calc(45 * var(--hg-profile-unit));height:calc(45 * var(--hg-profile-unit));border-radius:calc(22 * var(--hg-profile-unit))}
  .hg-settings__avatar .hg-avatar{font-size:max(14px,calc(18 * var(--hg-profile-text-unit)))}
  .hg-settings__name{font-size:max(14px,calc(16 * var(--hg-profile-text-unit)))}
  .hg-settings__card--edit{min-height:0;padding:calc(16 * var(--hg-profile-unit)) calc(14 * var(--hg-profile-unit))}
  .hg-settings__nick-row{flex-wrap:wrap;align-items:center}
  .hg-settings__nick-row .hg-settings__label{margin-right:0}
  .hg-settings__input{order:3;flex:1 1 100%;width:100%;margin-top:calc(12 * var(--hg-profile-unit));height:calc(40 * var(--hg-profile-unit))}
  .hg-settings__actions{margin-left:auto}
  .hg-settings__ghost,.hg-settings__save{width:calc(72 * var(--hg-profile-unit));height:calc(32 * var(--hg-profile-unit));font-size:max(12px,calc(13 * var(--hg-profile-text-unit)))}
  .hg-settings__act{width:calc(82 * var(--hg-profile-unit));height:calc(32 * var(--hg-profile-unit));font-size:max(12px,calc(13 * var(--hg-profile-text-unit)))}
  button.hg-settings__save{width:calc(82 * var(--hg-profile-unit))}
  .hg-settings__hint{margin:calc(8 * var(--hg-profile-unit)) 0 0}
  .hg-avatar-pick__box{padding:calc(20 * var(--hg-profile-unit))}
  .hg-avatar-pick__head h2{font-size:max(14px,calc(24 * var(--hg-profile-text-unit)))}
  /* 窄屏一行摆不下 10 列：390 宽下弹窗内容区仅 303px，摊到 10 列每格不足 20px，
     aspect-ratio 会被 min-height 顶掉、圆点压成小椭圆也点不准。
     改 4 列（20 色 = 五行），每格 ~65px，正圆且够手指点。 */
  .hg-avatar-pick__grid{grid-template-columns:repeat(4,minmax(0,1fr));gap:calc(14 * var(--hg-profile-unit))}
  .hg-avatar-pick__cancel,.hg-avatar-pick__ok{width:auto;flex:1}
}
@media (min-width:1024px){
  .hg-settings__ghost,.hg-settings__save,.hg-settings__input,.hg-avatar-pick__x,.hg-avatar-pick__ok,.hg-avatar-pick__cancel{min-height:36px;line-height:1.4}
  .hg-settings__ghost,.hg-settings__save{min-width:90px;padding-inline:12px;font-size:14px}
  .hg-settings__label{min-width:56px;line-height:1.4}
  .hg-settings__actions{gap:max(12px,calc(20 * var(--hg-profile-unit)))}
  .hg-settings__name{line-height:1.4}
}
@media (min-width:1024px){
  .hg-avatar-pick__grid{grid-template-columns:repeat(auto-fit,minmax(36px,1fr))}
  button.hg-avatar-pick__swatch{min-height:36px;min-width:36px}
}
