/* 九派IM · 日历模块样式 (独立文件, 只作用于 #calPane / .cal-*) */
#calPane { flex: 1; display: flex; flex-direction: column; min-width: 0; background: #fff; }
#calHead {
  height: 56px; flex: none; display: flex; align-items: center; gap: 10px;
  padding: 0 20px; border-bottom: 1px solid var(--line);
}
.cal-h-title { font-size: 16px; font-weight: 600; margin-right: 6px; }
.cal-h-spacer { flex: 1; }
.cal-nav-btn {
  width: 28px; height: 28px; border: 1px solid var(--line); background: #fff;
  border-radius: 6px; cursor: pointer; font-size: 16px; line-height: 1; color: #51565e;
}
.cal-nav-btn:hover { border-color: var(--accent); color: var(--accent); }
#calRangeTitle { font-size: 14px; font-weight: 600; min-width: 150px; }
.cal-view-tabs { display: flex; border: 1px solid var(--line); border-radius: 6px; overflow: hidden; }
.cal-vt { padding: 5px 16px; font-size: 13px; cursor: pointer; color: var(--txt2); }
.cal-vt + .cal-vt { border-left: 1px solid var(--line); }
.cal-vt.active { background: var(--accent); color: #fff; }
#calBody { flex: 1; overflow-y: auto; padding: 12px 20px 20px; }

/* 月视图 */
.cal-month { display: grid; grid-template-columns: repeat(7, 1fr); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.cal-wd { background: #f6f7f9; padding: 7px 8px; font-size: 12px; color: var(--txt2); text-align: center; }
.cal-cell { background: #fff; min-height: 92px; padding: 4px 5px; cursor: default; }
.cal-cell.out { background: #fafbfc; color: #c3c9d4; }
.cal-cell.today .cal-dnum { background: var(--accent); color: #fff; }
.cal-dnum {
  width: 22px; height: 22px; line-height: 22px; text-align: center; border-radius: 50%;
  font-size: 12px; margin-bottom: 3px;
}
.cal-chip {
  font-size: 11px; padding: 2px 6px; border-radius: 4px; margin-bottom: 2px; cursor: pointer;
  background: var(--accent-weak); color: var(--accent);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.cal-chip.st-pending { background: #fff4e0; color: #b0730d; }
.cal-chip.st-declined { background: #f3f4f6; color: #9aa2af; text-decoration: line-through; }
.cal-chip.st-tentative { background: #f1e9ff; color: #7a4fd0; }
.cal-chip-t { font-weight: 600; margin-right: 4px; }
.cal-more { font-size: 11px; color: var(--txt2); cursor: pointer; padding: 1px 6px; }
.cal-more:hover { color: var(--accent); }

/* 周视图 */
.cal-week { display: grid; grid-template-columns: repeat(7, 1fr); gap: 8px; min-height: 100%; }
.cal-wcol { border: 1px solid var(--line); border-radius: 8px; display: flex; flex-direction: column; min-height: 300px; }
.cal-wcol.today { border-color: var(--accent); }
.cal-whead { padding: 8px; font-size: 12px; color: var(--txt2); border-bottom: 1px solid var(--line); cursor: pointer; }
.cal-whead b { display: block; font-size: 14px; color: #1f2329; }
.cal-wcol.today .cal-whead b { color: var(--accent); }
.cal-wlist { flex: 1; padding: 6px; }
.cal-wlist .cal-chip { padding: 5px 7px; font-size: 12px; white-space: normal; }

/* 日视图 */
.cal-daylist { max-width: 720px; }
.cal-dayitem {
  display: flex; gap: 14px; padding: 12px 14px; border: 1px solid var(--line);
  border-radius: 10px; margin-bottom: 10px; cursor: pointer; border-left: 4px solid var(--accent);
}
.cal-dayitem:hover { box-shadow: 0 3px 12px rgba(30,60,120,.08); }
.cal-dayitem.st-pending { border-left-color: #e8a23d; }
.cal-dayitem.st-declined { border-left-color: #c3c9d4; opacity: .65; }
.cal-dayitem.st-tentative { border-left-color: #8358c9; }
.cal-di-time { font-size: 13px; font-weight: 600; min-width: 46px; }
.cal-di-time span { font-weight: 400; color: var(--txt2); font-size: 12px; }
.cal-di-title { font-size: 14px; font-weight: 600; margin-bottom: 3px; }
.cal-di-sub { font-size: 12px; color: var(--txt2); }
.cal-di-sub b { color: #b0730d; }
.cal-empty { text-align: center; color: #9aa2af; font-size: 13px; padding: 60px 0; }

/* 模块私有弹层(不依赖 app.js 的 modalMask) */
#calMask { position: fixed; inset: 0; background: rgba(15,23,42,.45); z-index: 320; display: flex; align-items: center; justify-content: center; }
#calMask.hidden { display: none !important; }
#calBox { background: #fff; border-radius: 12px; width: 520px; max-width: 92vw; max-height: 84vh; display: flex; flex-direction: column; overflow: hidden; box-shadow: 0 12px 40px rgba(0,0,0,.18); }
.cal-m-head { height: 50px; flex: none; display: flex; align-items: center; justify-content: space-between; padding: 0 18px; border-bottom: 1px solid var(--line); font-weight: 600; font-size: 15px; }
.cal-close { cursor: pointer; color: var(--txt2); font-size: 14px; }
.cal-m-body { padding: 16px 18px 6px; overflow-y: auto; flex: 1; }
.cal-m-foot { padding: 12px 18px; border-top: 1px solid var(--line); display: flex; justify-content: flex-end; gap: 10px; }

/* 表单 */
.cal-form-row { display: flex; gap: 8px; align-items: center; }
.cal-form-row label { font-size: 13px; color: var(--txt2); flex: none; }
.cal-att-head { font-size: 13px; font-weight: 600; margin: 4px 0 8px; }
.cal-hint { font-size: 12px; color: var(--txt2); font-weight: 400; }
.cal-att-sug { border: 1px solid var(--line); border-radius: 8px; margin: -8px 0 10px; max-height: 180px; overflow-y: auto; }
.cal-sug-item { padding: 7px 12px; font-size: 13px; cursor: pointer; }
.cal-sug-item:hover { background: var(--accent-weak); }
.cal-sug-item span { color: var(--txt2); font-size: 12px; margin-left: 8px; }
.cal-att-picked { display: flex; flex-wrap: wrap; gap: 6px; min-height: 26px; }
.cal-att-tag {
  background: var(--accent-weak); color: var(--accent); font-size: 12px;
  padding: 3px 8px; border-radius: 12px; display: inline-flex; gap: 5px; align-items: center;
}
.cal-att-tag i { cursor: pointer; font-style: normal; opacity: .7; }

/* 详情 */
.cal-dt-title { font-size: 17px; font-weight: 600; margin-bottom: 10px; }
.cal-canceled { font-size: 12px; color: #d4433b; border: 1px solid #d4433b; border-radius: 4px; padding: 1px 6px; }
.cal-dt-row { font-size: 13px; margin-bottom: 7px; color: #37404d; }
.cal-dt-desc { background: #f6f7f9; border-radius: 8px; padding: 10px 12px; white-space: pre-wrap; }
.cal-dt-atts { border: 1px solid var(--line); border-radius: 8px; max-height: 180px; overflow-y: auto; margin-bottom: 12px; }
.cal-dt-att { display: flex; justify-content: space-between; padding: 7px 12px; font-size: 13px; border-bottom: 1px solid #f1f3f6; }
.cal-dt-att:last-child { border-bottom: none; }
.cal-st-badge { font-size: 11px; padding: 1px 8px; border-radius: 9px; background: #f3f4f6; color: var(--txt2); }
.cal-st-badge.st-accepted { background: #e3f3e3; color: #2f9e44; }
.cal-st-badge.st-declined { background: #fdebea; color: #d4433b; }
.cal-st-badge.st-tentative { background: #f1e9ff; color: #7a4fd0; }
.cal-dt-rsvp { display: flex; gap: 10px; margin-top: 6px; }

/* 消息卡片(聊天气泡内) */
.cal-card { min-width: 240px; max-width: 320px; cursor: pointer; }
.cal-card-head { display: flex; align-items: center; gap: 7px; font-size: 14px; margin-bottom: 6px; }
.cal-card-ico { font-size: 17px; }
.cal-card-row { font-size: 12.5px; color: #37404d; margin-bottom: 3px; }
.cal-card-sub { font-size: 12px; color: var(--txt2); margin: 4px 0 8px; }
.cal-card-rsvp { display: flex; gap: 6px; }
.cal-rsvp {
  flex: 1; padding: 5px 0; font-size: 12px; border: 1px solid var(--line);
  background: #fff; border-radius: 6px; cursor: pointer; color: #37404d;
}
.cal-rsvp:hover { border-color: var(--accent); color: var(--accent); }
.cal-rsvp.on { background: var(--accent); border-color: var(--accent); color: #fff; }
.cal-card-state { font-size: 11.5px; color: var(--txt2); margin-top: 6px; min-height: 14px; }

/* 移动端 */
@media (max-width: 520px) {
  #calPane:not(.hidden) { flex: 1; min-height: 0; }
  #calHead { flex-wrap: wrap; height: auto; padding: 8px 10px; gap: 6px; }
  #calBody { padding: 8px; }
  .cal-week { grid-template-columns: 1fr; }
  .cal-cell { min-height: 56px; }
}
