*{box-sizing:border-box}
body{
  margin:0;
  font-family:-apple-system,BlinkMacSystemFont,"Segoe UI","PingFang SC",sans-serif;
  background:#f4f7f5;
  color:#17231d
}
button,select,input,textarea{font:inherit}

.top{
  height:64px;
  display:flex;
  align-items:center;
  gap:12px;
  padding:0 18px;
  background:#fff;
  border-bottom:1px solid #e5ebe7
}
.top button,.toolbar button{
  border:0;
  background:#eef2f0;
  border-radius:10px;
  padding:8px 12px
}
.top-title{flex:1}
.top-title b{display:block;font-size:18px}
.top-title span{font-size:9px;color:#849089}

.employee{
  max-width:180px;
  border:1px solid #dde5e0;
  background:#fff;
  border-radius:10px;
  padding:8px
}

.layout{
  display:grid;
  grid-template-columns:minmax(0,1fr) 330px;
  min-height:calc(100vh - 64px)
}

.calendar-wrap{padding:18px}

.toolbar{
  display:flex;
  align-items:center;
  gap:8px;
  margin-bottom:14px
}
.month-title{
  flex:1;
  font-size:22px;
  font-weight:800
}
.today-btn{margin-left:auto}

.week,.calendar{
  display:grid;
  grid-template-columns:repeat(7,1fr)
}
.week div{
  padding:9px;
  text-align:center;
  font-size:11px;
  color:#78857e
}

.day{
  min-height:112px;
  padding:8px;
  background:#fff;
  border-right:1px solid #edf1ef;
  border-bottom:1px solid #edf1ef;
  cursor:pointer
}
.day:nth-child(7n+1){border-left:1px solid #edf1ef}
.day.other{opacity:.34}
.day.selected{background:#edf5f1}
.day.today{
  box-shadow:inset 0 0 0 2px #647e70
}

.day-number{
  font-size:14px;
  font-weight:800
}
.lunar{
  margin-top:2px;
  font-size:9px;
  color:#89958e
}

.event{
  margin-top:5px;
  padding:4px 5px;
  border-radius:6px;
  background:#eff4f1;
  font-size:9px;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis
}
.memo-mark{
  display:inline-block;
  width:5px;
  height:5px;
  margin-left:4px;
  border-radius:50%;
  background:#405c4d
}

.detail{
  padding:18px;
  background:#fff;
  border-left:1px solid #e4eae6
}
.detail-date{
  font-size:18px;
  font-weight:800
}
.detail-lunar{
  margin:4px 0 18px;
  font-size:11px;
  color:#758179
}
.section-title{
  margin:16px 0 9px;
  font-size:12px;
  font-weight:800
}
.card{
  margin-bottom:9px;
  padding:11px;
  border:1px solid #e5ebe7;
  border-radius:13px;
  background:#fafcfb
}
.card b{
  display:block;
  margin-bottom:4px;
  font-size:12px
}
.card p{
  margin:4px 0;
  font-size:11px;
  line-height:1.5;
  color:#58675f
}

.add-btn{
  width:100%;
  height:41px;
  border:0;
  border-radius:11px;
  background:#17251e;
  color:#fff;
  font-weight:700
}
.memo-form{
  margin-top:10px;
  padding:12px;
  border-radius:13px;
  background:#f3f6f4
}
.memo-form input,
.memo-form textarea{
  width:100%;
  margin-bottom:8px;
  border:1px solid #dce4df;
  border-radius:9px;
  background:#fff;
  padding:9px
}
.memo-form textarea{min-height:75px}
.trip-check{
  display:flex;
  gap:7px;
  align-items:flex-start;
  padding:6px 0;
  font-size:11px
}
.delete{
  border:0;
  background:none;
  color:#986060;
  padding:5px 0;
  font-size:10px
}
.empty{
  padding:10px 0;
  color:#929d97;
  font-size:11px
}
.error{
  margin:12px;
  padding:12px;
  border-radius:10px;
  background:#fff1f1;
  color:#9a4d4d
}

@media(max-width:760px){
  .layout{display:block}
  .calendar-wrap{padding:10px}
  .day{
    min-height:79px;
    padding:5px
  }
  .event{
    font-size:8px;
    padding:2px 3px
  }
  .detail{
    border-left:0;
    border-top:1px solid #e4eae6
  }
  .employee{max-width:110px}
}

/* ===== SELECTED DAY V2 ===== */

.day.selected{
  position:relative;
  background:#17251e !important;
  color:#fff !important;
  box-shadow:
    0 6px 18px rgba(23,37,30,.18),
    inset 0 0 0 2px #17251e !important;
}

.day.selected .day-number{
  color:#fff;
}

.day.selected .lunar{
  color:rgba(255,255,255,.68);
}

.day.selected .event{
  background:rgba(255,255,255,.13);
  color:#fff;
}

.day.selected .memo-mark{
  background:#fff;
}

.day.selected.today{
  box-shadow:
    0 6px 18px rgba(23,37,30,.22),
    inset 0 0 0 2px #fff !important;
}

/* 今天但未选中 */
.day.today:not(.selected) .day-number{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  min-width:27px;
  height:27px;
  padding:0 6px;
  border-radius:14px;
  background:#dfeae4;
  color:#17251e;
}

body.embed-mode .top > button:first-child{
  display:none !important;
}

/* ===== SCHEDULE MOBILE UX V3 ===== */

/* 嵌入主App后，不再重复显示“日程 / LEAF TRIP” */
body.embed-mode .top{
  display:none !important;
}

/* 手机端 */
@media(max-width:760px){

  .layout{
    display:block;
    min-height:100%;
  }

  .calendar-wrap{
    padding:10px 10px 220px;
  }

  .toolbar{
    margin-bottom:7px;
  }

  .month-title{
    font-size:20px;
  }

  .week div{
    padding:6px 2px;
  }

  /* 月历格子压缩一点，减少占屏 */
  .day{
    min-height:66px;
    padding:5px;
  }

  .day-number{
    font-size:13px;
  }

  .lunar{
    font-size:9px;
  }

  .event{
    margin-top:3px;
    font-size:8px;
  }

  /* 当天详情 / 备忘固定显示在底部 */
  .detail{
    position:fixed;
    left:0;
    right:0;
    bottom:0;

    z-index:100;

    max-height:38vh;
    overflow-y:auto;

    padding:22px 16px
            calc(14px + env(safe-area-inset-bottom));

    background:rgba(255,255,255,.98);

    border:0;
    border-radius:20px 20px 0 0;

    box-shadow:
      0 -8px 28px rgba(20,40,30,.12);

    -webkit-overflow-scrolling:touch;
  }

  .detail:before{
    content:"";
    position:absolute;
    top:8px;
    left:50%;
    transform:translateX(-50%);

    width:36px;
    height:4px;
    border-radius:4px;

    background:#d7ded9;
  }

  .detail-date{
    font-size:16px;
  }

  .detail-lunar{
    margin-bottom:10px;
  }

  .section-title{
    margin:12px 0 7px;
  }

  .card{
    padding:9px 10px;
    margin-bottom:7px;
  }

  .empty{
    padding:6px 0 9px;
  }

  .add-btn{
    height:43px;
    margin-top:5px;
  }
}
