/* ============================================================
   settings.css — 我 tab / 资料编辑 / 群聊创建 / 设置全套 / 关于 / AI 设置
   依赖 base.css 设计令牌；开关 .wx-switch 等自定义组件在此实现
   ============================================================ */

/* ============================================================
   「我」tab
   ============================================================ */
.me-page{flex:1;overflow-y:auto;overflow-x:hidden;background:var(--wx-bg);}
.me-page::-webkit-scrollbar{display:none;}

/* 顶部个人资料大卡片行 */
.me-hero{
  display:flex;align-items:center;gap:16px;background:#fff;
  padding:26px 16px 22px;cursor:pointer;
}
.me-hero img{width:64px;height:64px;border-radius:8px;object-fit:cover;}
.me-hero .me-hero-main{flex:1;min-width:0;}
.me-hero .me-name{font-size:20px;font-weight:600;}
.me-hero .me-wxid{font-size:14px;color:var(--wx-text-sub);margin-top:6px;}
.me-hero .me-arrow{color:#C7C7CC;font-size:20px;}

/* 我的页功能分组（图标彩色方块 + 标签） */
.me-group{background:#fff;margin-top:10px;}
.me-cell{
  display:flex;align-items:center;gap:14px;padding:12px 15px;position:relative;cursor:pointer;
}
.me-cell + .me-cell::before{
  content:"";position:absolute;left:54px;right:0;top:0;height:.5px;background:var(--wx-line-soft);
}
.me-cell:active{background:#EBEBEB;}
.me-cell .mc-icon{
  width:26px;height:26px;border-radius:5px;flex:none;display:flex;align-items:center;
  justify-content:center;font-size:18px;color:#fff;
}
.mc-icon.wallet{background:#F7B500;}
.mc-icon.fav{background:#07C160;}
.mc-icon.moments{background:#5B8FF9;}
.mc-icon.card{background:#FA5151;}
.mc-icon.emoji{background:#722ED1;}
.mc-icon.settings{background:#888;}
.me-cell .mc-label{flex:1;font-size:16px;}
.me-cell .mc-value{color:var(--wx-text-sub);font-size:14px;}
.me-cell .mc-arrow{color:#C7C7CC;font-size:18px;}

/* ============================================================
   资料编辑页
   ============================================================ */
.editme-page{position:absolute;inset:0;display:flex;flex-direction:column;background:var(--wx-bg);}
.editme-body{flex:1;overflow-y:auto;padding-bottom:24px;}
.em-group{background:#fff;margin-top:10px;}
.em-row{
  display:flex;align-items:center;gap:12px;padding:11px 15px;position:relative;
}
.em-row + .em-row::before{
  content:"";position:absolute;left:15px;right:0;top:0;height:.5px;background:var(--wx-line-soft);
}
.em-row .em-label{width:88px;flex:none;color:var(--wx-text-sub);font-size:15px;}
.em-row .em-input{
  flex:1;border:none;background:transparent;font-size:16px;text-align:right;outline:none;
}
.em-row .em-input::placeholder{color:#C7C7CC;}
.em-row textarea.em-input{text-align:left;resize:none;height:60px;line-height:1.5;}
.em-row .em-readonly{flex:1;text-align:right;font-size:16px;color:var(--wx-text-sub);}
.em-row .em-arrow{color:#C7C7CC;font-size:18px;}
.em-avatar-row{display:flex;align-items:center;gap:12px;padding:14px 15px;}
.em-avatar-row .em-label{width:88px;flex:none;color:var(--wx-text-sub);font-size:15px;}
.em-avatar-row img{width:64px;height:64px;border-radius:8px;object-fit:cover;margin-left:auto;}
.em-sex-picker{display:flex;gap:10px;margin:12px 15px;}
.em-sex-picker .sex-opt{
  flex:1;text-align:center;padding:9px 0;border-radius:6px;background:#F2F2F2;font-size:15px;
}
.em-sex-picker .sex-opt.on{background:var(--wx-green);color:#fff;}
.em-save-bar{padding:12px 15px calc(12px + env(safe-area-inset-bottom));background:#fff;border-top:.5px solid var(--wx-line-soft);}

/* ============================================================
   群聊创建（多选好友）
   ============================================================ */
.pick-page{position:absolute;inset:0;display:flex;flex-direction:column;background:var(--wx-bg);}
.pick-list{flex:1;overflow-y:auto;}
.pick-row{display:flex;align-items:center;gap:12px;background:#fff;padding:10px 14px;cursor:pointer;}
.pick-row + .pick-row{border-top:.5px solid var(--wx-line-soft);}
.pick-row .pick-check{
  width:22px;height:22px;border-radius:50%;border:2px solid #C7C7CC;flex:none;
  display:flex;align-items:center;justify-content:center;color:#fff;font-size:13px;
}
.pick-row.on .pick-check{background:var(--wx-green);border-color:var(--wx-green);}
.pick-row .pick-avatar{width:42px;height:42px;border-radius:6px;object-fit:cover;}
.pick-row .pick-main{flex:1;min-width:0;}
.pick-row .pick-name{font-size:16px;}
.pick-row .pick-sub{font-size:12px;color:var(--wx-text-sub);margin-top:2px;}
.pick-bar{
  display:flex;align-items:center;justify-content:space-between;
  padding:10px 14px calc(10px + env(safe-area-inset-bottom));background:#fff;border-top:.5px solid var(--wx-line-soft);
}
.pick-bar .pick-count{font-size:14px;color:var(--wx-text-sub);}
.pick-bar .pick-done{
  background:var(--wx-green);color:#fff;border-radius:6px;padding:8px 20px;font-size:15px;
}
.pick-bar .pick-done[disabled]{opacity:.45;}

/* ============================================================
   设置页（通用）
   ============================================================ */
.set-page{position:absolute;inset:0;display:flex;flex-direction:column;background:var(--wx-bg);}
.set-body{flex:1;overflow-y:auto;padding-bottom:24px;}
.set-group{background:#fff;margin-top:10px;}
.set-group:first-child{margin-top:0;}
.set-group .group-hint{padding:6px 15px 4px;font-size:12px;color:var(--wx-text-sub);}
.set-cell{
  display:flex;align-items:center;gap:12px;padding:12px 15px;position:relative;cursor:pointer;
}
.set-cell + .set-cell::before{
  content:"";position:absolute;left:15px;right:0;top:0;height:.5px;background:var(--wx-line-soft);
}
.set-cell:active{background:#EBEBEB;}
.set-cell .sc-label{flex:1;font-size:16px;}
.set-cell .sc-value{color:var(--wx-text-sub);font-size:14px;}
.set-cell .sc-arrow{color:#C7C7CC;font-size:18px;}

/* 微信开关 */
.wx-switch{
  width:48px;height:28px;border-radius:14px;background:#E5E5E5;position:relative;flex:none;
  transition:background var(--wx-fast);cursor:pointer;
}
.wx-switch::after{
  content:"";position:absolute;left:2px;top:2px;width:24px;height:24px;border-radius:50%;
  background:#fff;box-shadow:0 1px 3px rgba(0,0,0,.2);transition:transform var(--wx-fast);
}
.wx-switch.on{background:var(--wx-green);}
.wx-switch.on::after{transform:translateX(20px);}

/* 字体大小分段选择器 */
.font-picker{display:flex;margin:14px 15px;border-radius:8px;overflow:hidden;border:.5px solid var(--wx-line);}
.font-picker .fp-opt{
  flex:1;text-align:center;padding:10px 0;font-size:14px;color:var(--wx-text-sub);background:#fff;
  border-right:.5px solid var(--wx-line-soft);
}
.font-picker .fp-opt:last-child{border-right:none;}
.font-picker .fp-opt.on{background:#E8F8EE;color:var(--wx-green);font-weight:600;}
.font-picker .fp-opt.small{font-size:12px;}
.font-picker .fp-opt.normal{font-size:15px;}
.font-picker .fp-opt.large{font-size:18px;}
.font-picker .fp-opt.xlarge{font-size:21px;}

/* 聊天背景选择网格 */
.bg-grid{display:grid;grid-template-columns:repeat(3,1fr);gap:8px;padding:12px 15px;}
.bg-grid .bg-item{
  aspect-ratio:3/4;border-radius:6px;overflow:hidden;position:relative;border:2px solid transparent;
}
.bg-grid .bg-item.on{border-color:var(--wx-green);}
.bg-grid .bg-item img{width:100%;height:100%;object-fit:cover;}
.bg-grid .bg-item .bg-none{
  width:100%;height:100%;background:#f2f2f2;display:flex;align-items:center;justify-content:center;
  color:#999;font-size:12px;
}
.bg-grid .bg-item .bg-check{
  position:absolute;right:4px;top:4px;width:18px;height:18px;border-radius:50%;
  background:var(--wx-green);color:#fff;font-size:12px;line-height:18px;text-align:center;
  display:none;
}
.bg-grid .bg-item.on .bg-check{display:block;}

/* 存储空间进度条 */
.storage-block{padding:14px 15px;}
.storage-row{display:flex;justify-content:space-between;font-size:15px;margin-bottom:8px;}
.storage-row .storage-val{color:var(--wx-text-sub);}
.storage-bar{height:10px;border-radius:5px;background:#ECECEC;overflow:hidden;}
.storage-bar .storage-fill{height:100%;background:linear-gradient(90deg,#07C160,#5BD68A);border-radius:5px;transition:width .4s;}
.storage-detail{margin-top:12px;}
.storage-detail .sd-row{
  display:flex;justify-content:space-between;font-size:14px;color:var(--wx-text-sub);padding:5px 0;
  border-bottom:.5px solid var(--wx-line-soft);
}

/* ============================================================
   关于页
   ============================================================ */
.about-page{position:absolute;inset:0;display:flex;flex-direction:column;background:var(--wx-bg);}
.about-body{flex:1;overflow-y:auto;display:flex;flex-direction:column;align-items:center;padding-top:48px;}
.about-logo{
  width:76px;height:76px;border-radius:16px;background:var(--wx-green);
  display:flex;align-items:center;justify-content:center;color:#fff;
}
.about-name{margin-top:14px;font-size:20px;font-weight:600;}
.about-ver{margin-top:6px;font-size:14px;color:var(--wx-text-sub);}
.about-list{width:100%;margin-top:36px;}
.about-foot{margin-top:auto;padding:24px 24px 40px;text-align:center;font-size:12px;color:#B2B2B2;line-height:1.7;}

/* ============================================================
   AI 设置页
   ============================================================ */
.ai-page{position:absolute;inset:0;display:flex;flex-direction:column;background:var(--wx-bg);}
.ai-body{flex:1;overflow-y:auto;padding-bottom:24px;}
.ai-group{background:#fff;margin-top:10px;}
.ai-group:first-child{margin-top:0;}
.ai-group .ai-group-title{padding:8px 15px 4px;font-size:12px;color:var(--wx-text-sub);}
.ai-row{display:flex;align-items:center;gap:12px;padding:11px 15px;position:relative;}
.ai-row + .ai-row::before{
  content:"";position:absolute;left:15px;right:0;top:0;height:.5px;background:var(--wx-line-soft);
}
.ai-row .ai-label{width:86px;flex:none;font-size:15px;color:var(--wx-text-sub);}
.ai-row .ai-input{
  flex:1;background:transparent;font-size:15px;outline:none;border:none;text-align:right;
}
.ai-row select.ai-input{
  -webkit-appearance:none;appearance:none;background:#F2F2F2;border-radius:6px;
  padding:7px 10px;font-size:15px;text-align:left;
}
.ai-row.full{flex-direction:column;align-items:stretch;gap:6px;}
.ai-row.full .ai-label{width:auto;}
.ai-row.full .ai-input{
  text-align:left;background:#F2F2F2;border-radius:6px;padding:9px 10px;font-size:15px;
}

/* 滑杆 */
.ai-slider-row{padding:12px 15px;}
.ai-slider-head{display:flex;justify-content:space-between;font-size:15px;margin-bottom:8px;}
.ai-slider-head .ai-val{color:var(--wx-green);font-weight:600;}
.ai-slider-row input[type=range]{
  width:100%;-webkit-appearance:none;appearance:none;height:4px;border-radius:2px;background:#DDD;outline:none;
}
.ai-slider-row input[type=range]::-webkit-slider-thumb{
  -webkit-appearance:none;appearance:none;width:24px;height:24px;border-radius:50%;background:#fff;
  box-shadow:0 1px 4px rgba(0,0,0,.25);cursor:pointer;
}

/* 拉模型 / 测连接按钮 */
.ai-btn-row{display:flex;gap:10px;padding:12px 15px;}
.ai-btn{
  flex:1;padding:10px 0;text-align:center;border-radius:7px;font-size:15px;
}
.ai-btn.primary{background:var(--wx-green);color:#fff;}
.ai-btn.plain{background:#fff;color:var(--wx-text-main);border:.5px solid var(--wx-line);}
.ai-btn[disabled]{opacity:.5;}
.ai-test-result{
  margin:0 15px 12px;padding:10px 12px;border-radius:8px;font-size:13px;line-height:1.5;
  background:#F4F4F4;color:var(--wx-text-sub);
}
.ai-test-result.ok{background:#E8F8EE;color:#06AD56;}
.ai-test-result.fail{background:#FDECEC;color:#FA5151;}

/* AI 页底部保存条 */
.ai-save-bar{padding:12px 15px calc(12px + env(safe-area-inset-bottom));background:#fff;border-top:.5px solid var(--wx-line-soft);}

/* 通用：导航栏占位高度与 tab 页对齐 */
.tab-page .page-navbar{height:var(--wx-navbar-h);}

/* 开关深色/禁用态 */
.wx-switch.off{background:#E5E5E5;}
.wx-switch[disabled]{opacity:.5;pointer-events:none;}

/* 设置页小标题与危险操作 */
.set-cell.danger{justify-content:center;color:var(--wx-red);}
.set-cell.link{color:var(--wx-blue);justify-content:center;}
.set-group .group-footer{padding:6px 15px 10px;font-size:12px;color:var(--wx-text-faint);line-height:1.5;}

/* 关于页 Logo 微光晕 */
.about-logo{box-shadow:0 8px 24px rgba(7,193,96,.35);}
.about-name{letter-spacing:2px;}

/* AI 页结果日志列表 */
.ai-log{margin:0 15px 12px;background:#0f1420;color:#9fe8b0;border-radius:8px;
  font-family:Menlo,Consolas,monospace;font-size:12px;padding:10px;max-height:120px;overflow-y:auto;}
.ai-log .log-line{padding:2px 0;word-break:break-all;}
.ai-log .log-line.err{color:#ff8a8a;}

/* AI 厂商说明卡片 */
.ai-vendor-note{margin:10px 15px;padding:10px 12px;background:#F4F9FF;border-radius:8px;
  font-size:12px;color:#576B95;line-height:1.6;}

/* 存储环形占位（备用） */
.storage-ring{width:96px;height:96px;border-radius:50%;margin:6px auto 0;
  background:conic-gradient(var(--wx-green) 0 35%, #ECECEC 0 100%);
  display:flex;align-items:center;justify-content:center;}
.storage-ring .ring-inner{width:74px;height:74px;border-radius:50%;background:#fff;
  display:flex;flex-direction:column;align-items:center;justify-content:center;}
.storage-ring .ring-inner b{font-size:16px;}
.storage-ring .ring-inner span{font-size:11px;color:#999;}

/* 资料编辑：头像悬停角标 */
.em-avatar-row{position:relative;}
.em-avatar-row .em-avatar-badge{
  position:absolute;right:15px;bottom:8px;width:22px;height:22px;border-radius:50%;
  background:rgba(0,0,0,.45);color:#fff;font-size:12px;display:flex;align-items:center;justify-content:center;
}

/* 群聊创建：已选成员横排预览 */
.pick-preview{display:flex;gap:6px;padding:8px 14px;background:#fff;border-bottom:.5px solid var(--wx-line-soft);
  overflow-x:auto;}
.pick-preview img{width:30px;height:30px;border-radius:4px;object-fit:cover;}

/* 表情页分类条 */
.emoji-cats{display:flex;gap:6px;padding:8px 10px;background:#fff;overflow-x:auto;}
.emoji-cats .ecat{flex:none;padding:5px 12px;border-radius:14px;background:#F2F2F2;font-size:13px;color:#555;}
.emoji-cats .ecat.on{background:var(--wx-green);color:#fff;}

/* 卡包券面 */
.coupon{
  margin:10px 12px;background:#fff;border-radius:10px;padding:14px;position:relative;overflow:hidden;
}
.coupon::before,.coupon::after{
  content:"";position:absolute;left:-10px;width:20px;height:20px;border-radius:50%;background:var(--wx-bg);
}
.coupon::before{top:38px;}
.coupon::after{bottom:38px;}

/* 窄屏适配 */
@media (max-width:380px){
  .me-hero{padding:20px 14px 18px;}
  .em-row .em-label{width:76px;}
  .ai-row .ai-label{width:76px;}
}

/* ============================================================
   settings.css 补充：细节动效 / 表单 / 暗黑结果块
   ============================================================ */

/* 设置行按压态 */
.set-cell:active,.me-cell:active,.ai-row:active{background:#F5F5F5;}

/* 开关滑动 */
.wx-switch{transition:background .18s;user-select:none;}
.wx-switch::after{transition:transform .18s;}

/* 头像上传行 hover */
.em-avatar-row:active{background:#F5F5F5;}
.em-avatar-row img{transition:opacity .2s;}
.em-avatar-row:active img{opacity:.85;}

/* 分段选择器选中滑动 */
.font-picker .fp-opt{transition:background .15s,color .15s;}

/* 聊天背景项 hover */
.bg-item{transition:transform .15s;}
.bg-item:active{transform:scale(.96);}

/* 存储条动画 */
.storage-bar{overflow:hidden;}
.storage-fill{transition:width .6s ease;}

/* 关于页列表 */
.about-list .set-group{margin-top:0;}

/* AI 结果块换行 */
.ai-test-result{white-space:pre-wrap;word-break:break-all;}

/* AI 按钮 */
.ai-btn{transition:opacity .15s;}
.ai-btn:active{opacity:.85;}

/* 性别选择 */
.em-sex-picker .sex-opt{transition:background .15s,color .15s;}

/* 群聊完成按钮 */
.pick-done{transition:opacity .15s;}
.pick-done:active{opacity:.85;}

/* 我的页 hero 按压 */
.me-hero:active{background:#F2F2F2;}

/* 收藏删除按钮 */
.pick-row .pick-check{transition:all .15s;}
.pick-row.on .pick-check{transform:scale(1.05);}

/* 卡券虚线边 */
.coupon{border:1px dashed #ddd;}

/* 输入框聚焦 */
.ai-input:focus{background:#EFEFEF;}

/* PC 端设置页限宽居中 */
@media (min-width:900px){
  .set-body,.ai-body,.editme-body{max-width:560px;margin:0 auto;width:100%;}
}

/* 大字号下表头 */
body.font-large .wx-navbar{font-size:19px;}
body.font-xlarge .wx-navbar{font-size:21px;}

/* 额外细节：设置页分段 / 注释 */
.set-legend{padding:8px 15px;font-size:12px;color:var(--wx-text-faint);line-height:1.5;}
.ai-divider{height:8px;background:var(--wx-bg);}
.ai-save-bar{background:var(--wx-bg);}
.ai-save-bar .wx-btn{box-shadow:0 2px 8px rgba(7,193,96,.25);}

/* 设置页通用间距与安全区 */
.set-body{padding-bottom:calc(24px + env(safe-area-inset-bottom));}
.ai-body{padding-bottom:calc(24px + env(safe-area-inset-bottom));}
.about-body{padding-bottom:calc(20px + env(safe-area-inset-bottom));}

/* 资料编辑签名框 */
.em-row textarea.em-input{line-height:1.5;}
.em-row .em-label{align-self:flex-start;padding-top:12px;}

/* 关于页 Logo 下版本阴影 */
.about-ver{opacity:.8;}

/* AI 页厂商说明 */
.ai-vendor-note b{color:#1a1a1a;}

/* 存储详情滚动 */
.storage-detail{max-height:260px;overflow-y:auto;}

/* 卡包券面值 */
.coupon .cp-price{font-size:22px;color:#e4393c;font-weight:700;}
.coupon .cp-name{font-size:14px;margin-top:4px;}
.coupon .cp-exp{font-size:12px;color:#999;margin-top:6px;}
