/* 租户管理（台账后台）。按《设计总纲》：字阶 13/16/24（一屏 ≤4 档）、间距 4 的倍数、圆角 8/12/16、
   只有浮层（弹窗、提示条）带影、一个强调色（品牌蓝，只给一个主动作）、选中态只用一种线索、尊重「减少动画」。
   图标：Lucide（ISC 许可，© Lucide Icons and Contributors），线宽 1.5。所有规则都限定在 #tenantsApp.tn 或租户表单（.tn-form）里，不影响别的页面。 */
#tenantsApp.tn,.tn-form{--surface:#fff;--line:#e4e7ec;--ink:#101828;--ink2:#475467;--blue:#0265c2;--blue-soft:#e8f1fb;--ok:#067647;--ok-bg:#ecfdf3;
  --warn:#93370d;--warn-bg:#fffaeb;--bad:#b42318;--bad-bg:#fef3f2;--ease:cubic-bezier(.2,0,0,1);font-size:16px;line-height:24px;color:var(--ink)}
#tenantsApp.tn{padding:0}
.tn *,.tn-form *{box-sizing:border-box}
.tn button,.tn-form button{font:inherit;color:inherit}
.tn :focus-visible,.tn-form :focus-visible{outline:2px solid var(--blue);outline-offset:2px}
.tn-ico{width:20px;height:20px;flex:none;stroke:currentColor;fill:none;stroke-width:1.5;stroke-linecap:round;stroke-linejoin:round}
.tn-wrap{max-width:1280px;margin:0 auto;padding:24px}
.tn-dim{color:var(--ink2);font-weight:400}

/* 按钮：一个主动作（蓝），其余都是次要 */
.tn-btn{display:inline-flex;gap:8px;align-items:center;justify-content:center;height:40px;padding:0 16px;border:1px solid var(--line);border-radius:8px;
  background:var(--surface);font-weight:600;cursor:pointer;white-space:nowrap;transition:background-color .15s var(--ease),border-color .15s var(--ease)}
.tn-btn:hover{background:#f4f6f9}
.tn-btn.sm{height:32px;padding:0 12px}
.tn-btn.primary{background:var(--blue);border-color:var(--blue);color:#fff}
.tn-btn.primary:hover{background:#014f9b;border-color:#014f9b}
.tn-btn.danger{border-color:var(--bad-bg);background:var(--bad-bg);color:var(--bad)}
.tn-btn:disabled{opacity:.5;cursor:not-allowed}

/* 结论带：标题 + 一句话 + 两个关键数 + 一个主动作（版式同「政策审核」页的头部） */
.tn-band{display:flex;flex-wrap:wrap;gap:16px 24px;align-items:flex-end;justify-content:space-between;margin-bottom:24px}
.tn-band-main{min-width:0;flex:1 1 360px}
.tn-title{margin:0;font-size:24px;line-height:32px;font-weight:600}
.tn-sentence{margin:4px 0 0;color:var(--ink2)}
.tn-sentence b{color:var(--ink);font-weight:600;font-variant-numeric:tabular-nums}
.tn-sub{margin:4px 0 0;font-size:13px;line-height:20px;color:var(--ink2)}
.tn-stats{display:flex;gap:8px}
.tn-stat{min-width:112px;padding:12px 16px;border:1px solid var(--line);border-radius:12px;background:var(--surface)}
.tn-stat .n{display:block;font-size:24px;line-height:32px;font-weight:600;font-variant-numeric:tabular-nums}
.tn-stat .l{display:block;font-size:13px;line-height:20px;color:var(--ink2)}
.tn-num.bump{animation:tn-bump .35s var(--ease)}
@keyframes tn-bump{0%{transform:translateY(-6px);opacity:.3}100%{transform:none;opacity:1}}

/* 分段开关（企业/个人；当前入驻/全部/集团自有）：选中 = 白底 + 深字，未选中 = 灰字 */
.tn-controls{display:flex;flex-wrap:wrap;gap:12px;align-items:center;margin-bottom:16px}
.tn-seg{display:inline-flex;padding:4px;background:#eceff3;border-radius:12px}
.tn-seg button{height:32px;padding:0 12px;border:0;border-radius:8px;background:transparent;color:var(--ink2);font-weight:600;cursor:pointer;white-space:nowrap;
  transition:background-color .2s var(--ease),color .2s var(--ease)}
.tn-seg button[aria-pressed="true"]{background:var(--surface);color:var(--ink)}
.tn-seg .n{margin-left:4px;font-variant-numeric:tabular-nums}
.tn-search{position:relative;flex:1 1 240px;min-width:200px;max-width:360px}
.tn-search .tn-ico{position:absolute;left:12px;top:10px;color:var(--ink2);pointer-events:none}
.tn-search input{width:100%;height:40px;padding:0 12px 0 40px;border:1px solid var(--line);border-radius:8px;background:var(--surface);font:inherit;color:var(--ink)}
.tn-search input::placeholder{color:var(--ink2)}
.tn-new{margin-left:auto}

/* 左列表 + 右详情 */
.tn-split{display:grid;grid-template-columns:minmax(360px,440px) minmax(0,1fr);gap:24px;align-items:start}
.tn-list{margin:0;padding:0;list-style:none;display:flex;flex-direction:column;gap:4px}
.tn-grp{margin:16px 0 4px;padding:0 16px;font-size:13px;line-height:20px;font-weight:600;color:var(--ink2)}
.tn-grp:first-child{margin-top:0}
.tn-row{display:flex;gap:12px;align-items:center;justify-content:space-between;width:100%;min-height:56px;padding:8px 16px;border:0;border-radius:12px;background:transparent;
  text-align:left;cursor:pointer;transition:background-color .2s var(--ease)}
.tn-row:hover{background:#eceff3}
.tn-row[aria-current="true"]{background:var(--blue-soft)}
.tn-row-main{min-width:0;display:flex;flex-direction:column}
.tn-name{font-weight:600;overflow-wrap:anywhere;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2;overflow:hidden}
.tn-meta{font-size:13px;line-height:20px;color:var(--ink2)}
/* 缺信用代码的户数多时，每行都亮色等于没有重点：行内只用灰字，提醒交给顶部结论带和「补下一家」 */
.tn-meta .tn-warn{color:var(--ink2)}
.tn-code{font-variant-numeric:tabular-nums}
.tn-note{margin:16px 16px 0;font-size:13px;line-height:20px;color:var(--ink2)}

/* 状态胶囊（小面积带色） */
.tn-chip{display:inline-flex;align-items:center;gap:4px;padding:0 8px;border-radius:999px;background:#eef1f5;color:var(--ink2);font-size:13px;line-height:24px;font-weight:600;white-space:nowrap}
.tn-chip.ok{background:var(--ok-bg);color:var(--ok)}
.tn-chip.warn{background:var(--warn-bg);color:var(--warn)}
.tn-chip.blue{background:#eef1f5;color:var(--ink2)}

/* 详情 */
.tn-detailcol{position:sticky;top:24px;align-self:start}
.tn-card{background:var(--surface);border:1px solid var(--line);border-radius:16px;overflow:hidden}
.tn-detail{animation:tn-in .25s var(--ease)}
@keyframes tn-in{from{opacity:0;transform:translateY(8px)}to{opacity:1;transform:none}}
.tn-back{display:none;margin:0 0 12px}
.tn-dhead{display:flex;gap:16px;align-items:flex-start;justify-content:space-between;padding:24px 24px 0}
.tn-dhead h3{margin:0;font-size:24px;line-height:32px;font-weight:600;overflow-wrap:anywhere}
.tn-dtitle{min-width:0}
.tn-chips{display:flex;flex-wrap:wrap;gap:8px;margin-top:8px}
.tn-dact{display:flex;flex-wrap:wrap;gap:8px;flex:none}
.tn-facts{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:16px 24px;margin:0;padding:24px}
.tn-facts>div{min-width:0}
.tn-facts dt{font-size:13px;line-height:20px;color:var(--ink2)}
.tn-facts dd{display:flex;flex-wrap:wrap;gap:4px 8px;align-items:center;margin:0;font-weight:600;overflow-wrap:anywhere}
.tn-facts .wide{grid-column:1/-1}
.tn-facts dd.tn-dim{font-weight:400}
.tn-link{padding:0;border:0;background:none;color:var(--blue);font-weight:600;cursor:pointer;text-decoration:underline;text-underline-offset:4px;min-height:32px}

/* 折叠区：来源与核验 */
.tn-fold{border-top:1px solid var(--line)}
.tn-fold-h{display:flex;width:100%;align-items:center;justify-content:space-between;gap:8px;min-height:48px;padding:0 24px;border:0;border-radius:0;background:transparent;
  color:var(--ink2);font-weight:600;cursor:pointer}
.tn-fold-h:hover{background:#f9fafb}
.tn-fold-h .tn-ico{transition:transform .25s var(--ease)}
.tn-fold.open .tn-fold-h .tn-ico{transform:rotate(180deg)}
.tn-fold-b{display:grid;grid-template-rows:0fr;transition:grid-template-rows .3s var(--ease)}
.tn-fold.open .tn-fold-b{grid-template-rows:1fr}
.tn-fold-i{min-height:0;overflow:hidden;visibility:hidden;transition:visibility 0s .3s}
.tn-fold.open .tn-fold-i{visibility:visible;transition-delay:0s}
.tn-fold-i .tn-facts{padding-top:8px}
.tn-fold-act{display:flex;justify-content:flex-end;padding:0 24px 24px}

/* 空态 / 加载态 / 出错态 */
.tn-empty{display:flex;flex-direction:column;align-items:center;gap:8px;padding:48px 24px;text-align:center;color:var(--ink2)}
.tn-empty .tn-ico{width:40px;height:40px}
.tn-empty b{color:var(--ink);font-weight:600}
.tn-empty .tn-btn{margin-top:8px}
.tn-sk{display:block;height:20px;border-radius:8px;background:#eceff3;animation:tn-pulse 1.4s ease-in-out infinite}
.tn-sk.t{width:60%;height:32px}.tn-sk.s{width:40%}
.tn-skelrow{display:flex;flex-direction:column;gap:8px;align-items:stretch;cursor:default}
.tn-skelrow:hover{background:transparent}
.tn-skelcard{display:flex;flex-direction:column;gap:12px;padding:24px;min-height:240px}
@keyframes tn-pulse{50%{opacity:.5}}

/* 新建/编辑表单（弹窗里；只在租户表单打开时改弹窗外壳） */
#modalBox:has(>.tn-form){padding:24px;border-radius:16px;width:min(520px,calc(100vw - 32px))}
.tn-form h3{margin:0 0 16px;font-size:24px;line-height:32px;font-weight:600}
.tn-form .form-field{margin-bottom:16px}
.tn-form .form-field label{display:block;margin-bottom:4px;font-size:13px;line-height:20px;color:var(--ink2)}
.tn-form input,.tn-form select{width:100%;height:40px;padding:0 12px;border:1px solid var(--line);border-radius:8px;background:var(--surface);font:inherit;color:var(--ink)}
.tn-form .hint{margin-top:4px;font-size:13px;line-height:20px;color:var(--ink2)}
.tn-form .form-error{margin-top:0;font-size:13px;line-height:20px;color:var(--bad)}
.tn-form .modal-actions{display:flex;gap:8px;justify-content:flex-end;margin-top:24px}

@media (max-width:1000px){
  .tn-split{grid-template-columns:1fr}
  .tn-detailcol{position:static}
  .tn-split:not(.tn-has-sel) .tn-detailcol{display:none}
  .tn-split.tn-has-sel .tn-listcol{display:none}
  .tn.tn-open .tn-band,.tn.tn-open .tn-controls{display:none}
  .tn-back{display:block}
}
@media (max-width:760px){
  .tn-wrap{padding:16px}
  .tn-band{gap:12px;margin-bottom:16px}
  .tn-stats{display:none}   /* 手机上一句话里已经带了这两个数，数字块再占一屏会把列表挤到第二行以后 */
  /* 手机第一屏要看到列表：企业/个人 与「新建企业」并一行，范围开关通栏，搜索通栏 */
  .tn-controls{gap:8px;margin-bottom:8px}
  .tn-controls>.tn-seg:first-child{order:1}
  .tn-new{order:2;margin-left:auto}
  .tn-controls>.tn-seg:nth-child(2){order:3;flex:1 1 100%}
  .tn-controls>.tn-seg:nth-child(2) button{flex:1 1 0;padding:0 8px}
  .tn-search{order:4}
  .tn-btn,.tn-btn.sm,.tn-seg button,.tn-link{min-height:44px}
  .tn-search input,.tn-form input,.tn-form select{height:44px}
  .tn-search .tn-ico{top:12px}
  .tn-search{max-width:none;flex-basis:100%}
  .tn-facts{grid-template-columns:1fr;padding:16px}
  .tn-dhead{flex-direction:column;padding:16px 16px 0}
  .tn-fold-h{padding:0 16px;min-height:48px}
  .tn-fold-act{padding:0 16px 16px}
}
@media (prefers-reduced-motion:reduce){
  .tn *,.tn-form *{animation:none!important;transition:none!important}
}

/* ===== 手机端（§3C，11/14 本地起草，zc-fast）：租户页头部与列表（证照页所在） ===== */
@media (max-width:900px){
  /* 1. 结论带：蓝底、圆角12、无阴影、padding16 */
  #tenantsApp.tn .tn-band{
    background:var(--blue-soft);
    border-radius:12px;
    padding:16px;
    margin-bottom:16px;
    flex-direction:column;
    align-items:stretch;
    gap:12px;
  }
  #tenantsApp.tn .tn-band-main{flex:none;width:100%}
  #tenantsApp.tn .tn-stats{flex:none;justify-content:space-between;width:100%}
  #tenantsApp.tn .tn-stat{flex:1;border:0;background:transparent;padding:0}
  #tenantsApp.tn .tn-stat .n{font-size:24px;line-height:32px}
  #tenantsApp.tn .tn-stat .l{font-size:13px;line-height:20px}
  #tenantsApp.tn .tn-title{font-size:20px;line-height:28px}
  #tenantsApp.tn .tn-sentence{font-size:16px;line-height:24px}

  /* 2. 列表行名称：取消固定高度/截断，允许完整换行 */
  #tenantsApp.tn .tn-name{
    -webkit-line-clamp:unset;
    display:block;
    height:auto;
    max-height:none;
    overflow:visible;
    white-space:normal;
  }
  #tenantsApp.tn .tn-row{min-height:auto;padding:12px 16px}

  /* 3. 筛选与搜索：min-height44px、nowrap */
  #tenantsApp.tn .tn-controls{flex-wrap:wrap}
  #tenantsApp.tn .tn-seg button,#tenantsApp.tn .tn-btn,#tenantsApp.tn .tn-link{min-height:44px}
  #tenantsApp.tn .tn-search input{min-height:44px;height:auto}
  #tenantsApp.tn .tn-search .tn-ico{top:12px}
}
@media (min-width:901px){ html.sh-on #tenantsApp .tn-wrap{margin-left:0;padding-left:20px;padding-right:20px} }
