/* =====================================================
   个人工具区:待办 / 打卡 / 倒计时 (自起始页 v1.9.x 迁入)
   适配个人空间设计:复用 .glass / .btn / .modal-mask,
   挂件专属变量只在 .oc-widgets 作用域内生效
   ===================================================== */
.oc-widgets{
  --ocw-radius:20px;
  --ocw-ink:#3c2c4d; --ocw-ink-soft:#6d5b80; --ocw-ink-faint:#8e7fa3;
  --ocw-ease-bounce:cubic-bezier(.34,1.56,.64,1);
  --ocw-ease-smooth:cubic-bezier(.22,.61,.36,1);
  margin: 0 4vw 8px;
}
.oc-widgets[hidden]{ display:none !important; }

@keyframes ocwCardIn{ from{ opacity:0; transform: translateY(20px) scale(.94); } to{ opacity:1; transform:none; } }
@keyframes ocwGradShift{ 0%,100%{ background-position:0% 50%; } 50%{ background-position:100% 50%; } }
@keyframes ocwBob{ 0%,100%{ transform: translateY(0) rotate(-3deg); } 50%{ transform: translateY(-5px) rotate(3deg); } }
@keyframes ocwHeartUp{
  0%{ transform: translate(-50%,-50%) scale(.4); opacity:0; }
  25%{ opacity:1; }
  100%{ transform: translate(calc(-50% + var(--dx)), calc(-50% + var(--dy))) scale(1.25); opacity:0; }
}

/* 卡片布局 */
.oc-widgets{
  display:grid; gap:16px;
  grid-template-columns: 1.15fr 1fr 1fr;
}
.oc-widgets .widget{
  border-radius:var(--ocw-radius); padding:16px 18px 15px;
  display:flex; flex-direction:column; gap:10px; min-width:0;
  animation: ocwCardIn .55s var(--ocw-ease-bounce) both;
  transition: transform .3s var(--ocw-ease-bounce), box-shadow .3s ease;
}
.oc-widgets .widget:hover{ transform: translateY(-4px); box-shadow:0 22px 46px rgba(150,110,190,.26); }

.oc-widgets .w-head{ display:flex; align-items:center; gap:10px; }
.oc-widgets .w-head h2{ margin:0; font-size:14.5px; font-weight:800; letter-spacing:.3px; }
.oc-widgets .w-head-right{ margin-left:auto; display:flex; align-items:center; gap:8px; }
.oc-widgets .w-tag{
  margin-left:auto; font-size:11.5px; font-weight:700; color:var(--text-muted);
  background:rgba(255,255,255,.45); border:1px solid rgba(255,255,255,.7);
  padding:2px 9px; border-radius:999px;
}
.oc-widgets .w-head-right .w-tag{ margin-left:0; }
.oc-widgets .w-mini{
  cursor:pointer; border:1px solid rgba(255,255,255,.7); background:rgba(255,255,255,.4);
  color:var(--text-muted); font-size:11px; padding:3px 9px; border-radius:999px;
  transition: transform .2s var(--ocw-ease-bounce), background .2s ease;
}
.oc-widgets .w-mini:hover{ transform: translateY(-1px) scale(1.05); background:#fff; color:var(--text); }

/* 待办 */
.oc-widgets .w-progress{ height:6px; border-radius:999px; background:rgba(255,255,255,.4); overflow:hidden; }
.oc-widgets .w-progress i{
  display:block; height:100%; width:0; border-radius:999px;
  background:linear-gradient(90deg,#ff9ecb,#a98bff 60%,#68e2f0);
  transition: width .5s var(--ocw-ease-smooth);
  background-size:200% 100%; animation: ocwGradShift 5s ease infinite;
}
.oc-widgets .todo-list{ display:flex; flex-direction:column; gap:7px; max-height:230px; overflow-y:auto; padding-right:2px; }
.oc-widgets .todo-list::-webkit-scrollbar{ width:6px; }
.oc-widgets .todo-list::-webkit-scrollbar-thumb{ background:rgba(169,139,255,.45); border-radius:999px; }
.oc-widgets .todo-empty{ font-size:12.5px; color:var(--text-muted); padding:12px 2px; text-align:center; }
.oc-widgets .todo-item{
  display:flex; align-items:center; gap:10px; padding:8px 10px; border-radius:13px;
  background:rgba(255,255,255,.42); border:1px solid rgba(255,255,255,.65);
  transition: transform .22s var(--ocw-ease-bounce), background .22s ease, opacity .22s ease;
  animation: ocwCardIn .32s var(--ocw-ease-bounce) both;
}
.oc-widgets .todo-item:hover{ transform: translateX(3px); background:rgba(255,255,255,.72); }
.oc-widgets .todo-item.done{ opacity:.62; }
.oc-widgets .todo-item.done .todo-text{ text-decoration:line-through; text-decoration-color:rgba(169,139,255,.85); }
.oc-widgets .todo-due{ display:inline-block; margin-left:8px; padding:1px 8px; border-radius:999px; font-size:11px; font-style:normal;
  background:rgba(169,139,255,.14); color:var(--text-muted); white-space:nowrap; }
.oc-widgets .todo-due.soon{ background:rgba(245,158,11,.16); color:#b45309; }
.oc-widgets .todo-due.late{ background:rgba(244,63,94,.16); color:#e11d48; font-weight:600; }
.oc-widgets .todo-due.done{ background:rgba(16,185,129,.14); color:#047857; text-decoration:none; }
.oc-widgets .todo-check{
  flex:0 0 20px; width:20px; height:20px; border-radius:7px; cursor:pointer;
  border:2px solid rgba(169,139,255,.7); background:rgba(255,255,255,.5);
  color:#fff; font-size:12px; font-weight:900; line-height:1; display:grid; place-items:center;
  transition: transform .22s var(--ocw-ease-bounce), background .22s ease, border-color .22s ease;
}
.oc-widgets .todo-check:hover{ transform: scale(1.14); }
.oc-widgets .todo-item.done .todo-check{ background:linear-gradient(135deg,#8fe3b0,#4ecf8a); border-color:transparent; }
.oc-widgets .todo-text{ flex:1; font-size:13px; line-height:1.5; word-break:break-word; }
.oc-widgets .todo-add{ display:flex; gap:8px; }
.oc-widgets .todo-add input{
  flex:1; min-width:0; border-radius:13px; padding:10px 13px; font-size:13px; color:var(--text);
  border:1px solid rgba(255,255,255,.7); background:rgba(255,255,255,.5); outline:0;
  transition: box-shadow .22s ease, background .22s ease;
}
.oc-widgets .todo-add input:focus{ background:#fff; box-shadow:0 0 0 3px rgba(255,158,203,.45); }
.oc-widgets .todo-add input:disabled{ opacity:.65; cursor:not-allowed; }
.ocw-note{ margin:0; font-size:11.5px; color:var(--text-muted); text-align:center; }

/* 打卡 */
.oc-widgets .ck-body{ display:flex; align-items:center; gap:14px; padding:4px 0 2px; }
.oc-widgets .ck-ring{
  --p:0; flex:0 0 82px; width:82px; height:82px; border-radius:50%; position:relative;
  display:grid; place-items:center;
  background: conic-gradient(from -90deg, #ffb0d4 calc(var(--p) * 1%), rgba(255,255,255,.42) 0);
  transition: background .5s ease;
}
.oc-widgets .ck-ring.is-done{ background: conic-gradient(from -90deg, #6ddc9f calc(var(--p) * 1%), rgba(255,255,255,.42) 0); }
.oc-widgets .ck-ring::before{
  content:""; position:absolute; inset:8px; border-radius:50%;
  background:rgba(255,255,255,.62); backdrop-filter:blur(8px); -webkit-backdrop-filter:blur(8px);
  box-shadow: inset 0 0 12px rgba(255,255,255,.8);
}
.oc-widgets .ck-ring span{ position:relative; font-size:22px; font-weight:900; color:var(--text); }
.oc-widgets .ck-info{ display:flex; flex-direction:column; gap:3px; min-width:0; }
.oc-widgets .ck-info b{ font-size:13.5px; }
.oc-widgets .ck-info i{ font-style:normal; font-size:12px; color:var(--text-muted); }
.oc-widgets .ck-info em{ font-style:normal; font-size:10.5px; color:var(--text-muted); opacity:.85; }

.oc-widgets .ck-strip{ display:flex; gap:4px; padding:2px 0; }
.oc-widgets .ck-day{
  flex:1 1 0; height:9px; border-radius:999px;
  background:rgba(255,255,255,.42); border:1px solid rgba(255,255,255,.6);
  transition: background .3s ease, transform .25s var(--ocw-ease-bounce);
}
.oc-widgets .ck-day.on{ background:linear-gradient(135deg,#8fe3b0,#4ecf8a); border-color:transparent; }
.oc-widgets .ck-day:hover{ transform: scaleY(1.7); }
.oc-widgets .ck-actions{ display:flex; gap:8px; flex-wrap:wrap; }

/* 心情选择(挂件弹窗内) */
.ocw-mood-grid{ display:grid; grid-template-columns:repeat(3,1fr); gap:9px; margin:4px 0 14px; }
.ocw-mood-grid .mood{
  cursor:pointer; border:1px solid rgba(255,255,255,.75); background:rgba(255,255,255,.45);
  border-radius:15px; padding:11px 6px; display:flex; flex-direction:column; align-items:center; gap:3px;
  transition: transform .22s var(--ocw-ease-bounce), background .22s ease, box-shadow .22s ease;
}
.ocw-mood-grid .mood span{ font-size:22px; }
.ocw-mood-grid .mood i{ font-style:normal; font-size:11px; color:var(--text-muted); }
.ocw-mood-grid .mood:hover{ transform: translateY(-3px) scale(1.05); background:#fff; }
.ocw-mood-grid .mood.on{
  background:linear-gradient(135deg, rgba(255,194,224,.92), rgba(215,196,255,.92));
  box-shadow:0 10px 22px rgba(169,139,255,.4); border-color:transparent;
}
.ocw-mood-grid .mood.on i{ color:#fff; }

/* 打卡飘心 */
.heart-pop{
  position:fixed; z-index:9999; font-size:19px; pointer-events:none;
  animation: ocwHeartUp 1.3s ease-out forwards;
}

/* 打卡日历(弹窗内) */
.ocw-cal .cal-head{ display:flex; align-items:center; justify-content:center; gap:14px; margin:6px 0 12px; }
.ocw-cal .cal-head b{ font-size:15px; }
.ocw-cal .cal-nav{
  cursor:pointer; border:1px solid rgba(255,255,255,.75); background:rgba(255,255,255,.5);
  color:var(--text); border-radius:11px; width:32px; height:32px;
  transition: transform .2s var(--ocw-ease-bounce), background .2s ease;
}
.ocw-cal .cal-nav:hover{ transform: scale(1.1); background:#fff; }
.ocw-cal .cal-week, .ocw-cal .cal-grid{ display:grid; grid-template-columns:repeat(7,1fr); gap:6px; }
.ocw-cal .cal-week span{ font-size:11px; color:var(--text-muted); text-align:center; }
.ocw-cal .cal-cell{
  position:relative; aspect-ratio:1/1; border-radius:12px; display:grid; place-items:center;
  font-size:12.5px; background:rgba(255,255,255,.35); border:1px solid rgba(255,255,255,.55);
  transition: transform .2s var(--ocw-ease-bounce), background .2s ease;
}
.ocw-cal .cal-cell.empty{ background:transparent; border:0; }
.ocw-cal .cal-cell i{ position:absolute; right:3px; bottom:1px; font-size:10px; font-style:normal; }
.ocw-cal .cal-cell.on{ background:linear-gradient(135deg, rgba(143,227,176,.9), rgba(78,207,138,.9)); color:#0f3d24; border-color:transparent; }
.ocw-cal .cal-cell.today{ box-shadow:0 0 0 2px rgba(255,158,203,.95); }
.ocw-cal .cal-cell:not(.empty):hover{ transform: translateY(-2px) scale(1.06); }
.ocw-cal .cal-stat{ margin:12px 0 0; font-size:12.5px; color:var(--text-muted); text-align:center; }

/* 倒计时 */
.oc-widgets .cd-list{ display:flex; flex-direction:column; gap:8px; }
.oc-widgets .cd-item{
  display:flex; align-items:center; gap:10px; padding:9px 12px; border-radius:13px;
  background:rgba(255,255,255,.4); border:1px solid rgba(255,255,255,.65);
  transition: transform .25s var(--ocw-ease-bounce), box-shadow .25s ease;
  animation: ocwCardIn .35s var(--ocw-ease-bounce) both;
}
.oc-widgets .cd-item:hover{ transform: translateX(3px) scale(1.02); box-shadow:0 10px 22px rgba(150,110,190,.2); }
.oc-widgets .cd-item.hot{
  background:linear-gradient(135deg, rgba(255,194,224,.75), rgba(215,196,255,.75));
  border-color:rgba(255,255,255,.85);
}
.oc-widgets .cd-emoji{ font-size:19px; animation: ocwBob 3.4s ease-in-out infinite; }
.oc-widgets .cd-label{ font-size:13px; font-weight:700; display:flex; flex-direction:column; line-height:1.3; }
.oc-widgets .cd-label i{ font-style:normal; font-size:10.5px; font-weight:500; color:var(--text-muted); }
.oc-widgets .cd-days{ margin-left:auto; font-size:12px; color:var(--text-muted); white-space:nowrap; }
.oc-widgets .cd-days b{ font-size:19px; font-weight:900; color:var(--text); margin-right:2px; font-variant-numeric:tabular-nums; }

/* 挂件弹窗(复用个人空间 .modal-mask/.modal-box) */
.ocw-modal .modal-box{ max-width:480px; }
.ocw-sub{ font-size:12.5px; color:var(--text-muted); margin-bottom:14px; }
.ocw-field{ display:block; margin-bottom:14px; }
.ocw-field span{ display:block; font-size:12px; color:var(--text-muted); margin-bottom:6px; }
.ocw-field input{
  width:100%; border-radius:12px; padding:10px 13px; font-size:13px; color:var(--text);
  border:1px solid var(--glass-border); background:rgba(255,255,255,.6); outline:0;
}
.ocw-field input:focus{ box-shadow:0 0 0 3px rgba(255,158,203,.35); background:#fff; }
.ocw-actions{ display:flex; justify-content:flex-end; gap:10px; }

@media (max-width:980px){
  .oc-widgets{ grid-template-columns: 1fr 1fr; }
  .oc-widgets .widget:nth-child(1){ grid-column: 1 / -1; }
}
@media (max-width:620px){
  .oc-widgets{ grid-template-columns: 1fr; margin: 0 16px 8px; }
  .oc-widgets .widget:nth-child(1){ grid-column:auto; }
}
