/* ===== 代理端桌面端适配（≥1024px 生效，手机端完全不受影响） ===== */
@media (min-width: 1024px) {

  /* 页面底板：由居中手机壳改为左侧栏 + 右侧内容区 */
  body{
    display: block !important;
    overflow: auto !important;
    background: #f2f4f3 !important;
    min-height: 100vh;
  }

  #shell{
    display: block !important;
    max-width: none !important;
    max-height: none !important;
    height: auto !important;
    width: auto !important;
    min-height: 100vh;
    margin-left: 236px;
    background: transparent !important;
    overflow: visible !important;
    position: relative;
  }

  /* 顶栏：整宽吸顶 */
  #shell > header{
    position: sticky;
    top: 0;
    z-index: 30;
    background: #fff;
    padding: 17px 34px !important;
    border-bottom: 1px solid #edf0ec;
    box-shadow: 0 1px 2px rgba(20,30,25,.03);
  }
  #shell > header a[class*="w-8"][class*="h-8"]{ display: none !important; }   /* 去掉返回箭头 */
  #shell > header h1{ font-size: 17px !important; }
  #shell > header .flex-1{ flex: none !important; }

  /* 内容区 */
  #shell > main{
    max-width: 1060px;
    margin: 0 auto;
    width: 100%;
    padding: 26px 34px 44px !important;
    overflow: visible !important;
    min-height: 0 !important;
  }
  #shell > main > section{
    padding-left: 0 !important;
    padding-right: 0 !important;
    margin-top: 0 !important;
    margin-bottom: 20px !important;
  }
  #shell > main > div{ padding-left: 0 !important; padding-right: 0 !important; }

  /* 手机端底部多标签栏、底栏按钮、占位块在桌面端隐藏 */
  #shell > nav{ display: none !important; }
  #shell > div.h-3{ display: none !important; }
  #shell > div[class*="px-5"][class*="py-3"]{ display: none !important; }

  /* 列表吸顶筛选条改为普通跟随 */
  #shell main .sticky{ position: static !important; background: transparent !important; }

  /* 卡片列表在桌面端两列铺开 */
  #shell main .d-grid{
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
  }

  /* 代理首页：左栏（收益/邀请码/规则） + 右栏（概览/海报/返现） */
  body[data-dp="agent-home"] #shell > main{
    max-width: 1120px;
    display: flex;
    flex-wrap: nowrap;
    gap: 24px;
    align-items: flex-start;
  }
  body[data-dp="agent-home"] #shell > main > section{ margin-bottom: 0 !important; }
  body[data-dp="agent-home"] .d-col{ display: flex; flex-direction: column; gap: 20px; }
  body[data-dp="agent-home"] .d-col-a{ flex: 0 0 392px; }
  body[data-dp="agent-home"] .d-col-b{ flex: 1 1 auto; min-width: 0; }
  body[data-dp="agent-home"] .poster{ border-radius: 20px; }

  /* 弹层：居中成对话框，宽度收拢 */
  body[data-dp="agent-home"] #posterModal > div{ max-width: 420px; width: 100%; }
  body[data-dp="withdraw"] #wdModal{ align-items: center !important; justify-content: center !important; padding: 28px; }
  body[data-dp="withdraw"] #wdModal > div{
    max-width: 478px; width: 100%;
    border-radius: 22px !important;
    max-height: 86vh; overflow-y: auto;
  }
  body[data-dp="agent-apply"] #termsLayer > div[class*="rounded-t"]{
    left: 50% !important; right: auto !important; top: 50% !important; bottom: auto !important;
    transform: translate(-50%, -50%);
    width: 560px; max-width: calc(100% - 56px);
    max-height: 82vh; border-radius: 22px !important;
  }

  /* 提现页柱状图在宽屏适当加宽，避免过于稀疏 */
  body[data-dp="withdraw"] #shell main [class*="max-w-[18px]"]{ max-width: 42px !important; }

  /* 窄表单页（申请入驻）单独收窄 */
  body[data-dp="agent-apply"] #shell > main{ max-width: 760px; }
}

/* ===== 桌面侧边栏（由 assets/desktop.js 注入，仅桌面端存在） ===== */
.d-side{
  position: fixed; left: 0; top: 0; bottom: 0; width: 236px;
  background: #fff; border-right: 1px solid #e9ece8;
  display: flex; flex-direction: column; z-index: 40;
  font-family: -apple-system,BlinkMacSystemFont,"PingFang SC","Hiragino Sans GB","Microsoft YaHei",sans-serif;
  color: #1a1d21;
}
.d-brand{ display: flex; align-items: center; gap: 10px; padding: 20px 18px 14px; }
.d-logo{
  width: 34px; height: 34px; border-radius: 11px; background: #0f766e; color: #fff;
  display: grid; place-items: center; font-size: 15px; font-weight: 600;
  box-shadow: 0 4px 12px rgba(15,118,110,.25);
}
.d-brand strong{ display: block; font-size: 14px; }
.d-brand small{ display: block; font-size: 10.5px; color: #9aa197; margin-top: 2px; }

.d-agent{
  margin: 2px 14px 12px; padding: 12px; border-radius: 14px;
  background: linear-gradient(160deg, #0f766e 0%, #115e59 100%); color: #fff;
}
.d-agent .row{ display: flex; align-items: center; gap: 9px; }
.d-agent .ava{
  width: 30px; height: 30px; border-radius: 999px; background: rgba(255,255,255,.18);
  display: grid; place-items: center; font-size: 12px; font-weight: 600; flex: 0 0 auto;
}
.d-agent .who b{ display: block; font-size: 12.5px; font-weight: 600; }
.d-agent .who span{ display: block; font-size: 9.5px; color: rgba(255,255,255,.65); margin-top: 2px; }
.d-agent .money{ margin-top: 10px; }
.d-agent .money i{ font-style: normal; font-size: 9.5px; color: rgba(255,255,255,.6); display: block; }
.d-agent .money b{ font-size: 19px; font-weight: 600; letter-spacing: -.3px; }

.d-nav{ padding: 4px 10px; }
.d-nav .cap{ font-size: 10px; color: #a4aca4; padding: 6px 12px 4px; letter-spacing: .06em; }
.d-nav a{
  display: flex; align-items: center; gap: 10px; height: 42px; padding: 0 12px;
  border-radius: 12px; color: #5b6259; font-size: 13px; text-decoration: none; cursor: pointer;
  transition: background .15s, color .15s;
}
.d-nav a:hover{ background: #f4f7f4; color: #2f3a33; }
.d-nav a.on{ background: #e6f4f1; color: #0f766e; font-weight: 600; }
.d-nav a.on iconify-icon{ color: #0f766e; }
.d-nav a iconify-icon{ color: #8a928a; }

.d-foot{ margin-top: auto; border-top: 1px solid #f0f2ee; padding: 12px 10px 16px; }

/* 手机端：两列容器等于不存在，维持原堆叠顺序 */
@media (max-width: 1023px) {
  .d-col{ display: contents; }
}
