/* ================= widget base ================= */
.widget{display:flex;flex-direction:column;font-size:13px}
.widget *{min-width:0}
.wbody{flex:1;min-height:0;display:flex;flex-direction:column;position:relative;padding:0}
.w-loading{position:absolute;inset:0;display:grid;place-items:center;font-size:.75em;color:var(--text-dim)}
.w-err{position:absolute;inset:0;display:grid;place-items:center;font-size:.7em;color:var(--text-dim);text-align:center;padding:.8em;line-height:1.5}
.wbtn{display:grid;place-items:center;width:1.5em;height:1.5em;border-radius:.35em;color:inherit;opacity:.6;transition:.15s}
.wbtn:hover{opacity:1;background:rgba(255,255,255,.16)}
.wbtn svg{width:1.05em;height:1.05em}

/* ================= weather ================= */
.w-weather{color:#fff;padding:.6em;display:flex;flex-direction:column;justify-content:space-between;height:100%}
.w-weather .ww-head{display:flex;justify-content:space-between;align-items:flex-start;font-size:.6em;gap:.4em}
.ww-city{display:flex;align-items:center;gap:.35em;min-width:0}
.ww-city .cname{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;opacity:.95}
.ww-city svg{width:1.1em;height:1.1em;flex:0 0 auto;opacity:.8}
.ww-cond{display:flex;align-items:center;gap:.3em;opacity:.9;flex:0 0 auto}
.ww-cond svg{width:2.6em;height:2.6em}
.ww-mid{display:flex;flex-direction:column;justify-content:center;gap:.18em;flex:1;min-height:0}
.ww-temp{font-size:2.2em;line-height:1;font-weight:300;letter-spacing:-.01em}
.ww-temp sup{font-size:.42em;vertical-align:top;line-height:1}
.ww-aqi{font-size:.56em;opacity:.92;line-height:1.35;text-align:left;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.ww-aqi b{font-weight:500}
.ww-foot{font-size:.55em;opacity:.88;display:flex;gap:.6em;white-space:nowrap}
.aqi-dot{display:inline-block;width:.5em;height:.5em;border-radius:50%;background:#7ed321;margin-right:.3em;vertical-align:middle}

/* ================= calendar ================= */
.w-cal{height:100%;display:flex;flex-direction:column;color:#fff;background:var(--accent)}
.cal-head{height:2.05em;display:flex;align-items:center;justify-content:center;font-size:.83em;background:rgba(0,0,0,.13);letter-spacing:.02em}
.cal-body{flex:1;display:flex;flex-direction:column;align-items:center;justify-content:center;line-height:1;padding:.1em 0}
.cal-day{font-size:2.6em;font-weight:400}
.cal-sub{font-size:.42em;opacity:.85;margin-top:.55em;display:flex;gap:.5em}
.cal-foot{display:flex;align-items:center;justify-content:center;gap:.7em;font-size:.55em;opacity:.92;padding-bottom:.55em}
.cal-foot .dot{width:.25em;height:.25em;border-radius:50%;background:currentColor;opacity:.6}

/* ================= hot list ================= */
.w-hot{height:100%;display:flex;flex-direction:column}
.hot-tabs{display:flex;gap:.15em;padding:.35em .45em .15em;font-size:.62em}
.hot-tab{padding:.25em .5em;border-radius:.35em;opacity:.62;cursor:pointer;white-space:nowrap;transition:.15s}
.hot-tab:hover{opacity:.9}
.hot-tab.active{opacity:1;background:rgba(255,255,255,.14);font-weight:500}
html[data-theme="light"] .hot-tab.active{background:rgba(0,0,0,.07)}
.hot-list{flex:1;overflow:hidden;padding:.1em .3em .3em}
.hot-row{display:flex;align-items:center;gap:.5em;padding:.28em .35em;border-radius:.3em;cursor:pointer;font-size:.68em}
.hot-row:hover{background:rgba(255,255,255,.08)}
html[data-theme="light"] .hot-row:hover{background:rgba(0,0,0,.045)}
.hot-idx{width:1.25em;text-align:center;flex:0 0 auto;opacity:.55;font-size:.95em;font-variant-numeric:tabular-nums}
.hot-row:nth-child(1) .hot-idx{color:#ff4d4f;opacity:1;font-weight:600}
.hot-row:nth-child(2) .hot-idx{color:#ff7a45;opacity:1;font-weight:600}
.hot-row:nth-child(3) .hot-idx{color:#ffa940;opacity:1;font-weight:600}
.hot-word{flex:1;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;line-height:1.5}
.hot-num{flex:0 0 auto;opacity:.5;font-size:.88em;font-variant-numeric:tabular-nums}
.hot-tag{font-size:.78em;padding:0 .25em;border-radius:.2em;background:rgba(255,80,80,.18);color:#ff7875}

/* ================= anniversary ================= */
.w-ann{height:100%;padding:.55em .65em;display:flex;flex-direction:column;justify-content:space-around;gap:.2em}
.ann-row{display:flex;align-items:baseline;justify-content:space-between;gap:.4em}
.ann-label{font-size:.62em;opacity:.75;white-space:nowrap}
.ann-val{display:flex;align-items:baseline;gap:.18em}
.ann-num{font-size:1.35em;font-weight:400;font-variant-numeric:tabular-nums}
.ann-unit{font-size:.55em;opacity:.7}
.ann-row.past .ann-num{color:#ffd666}

/* ================= notes ================= */
.w-notes{height:100%;background:#f6c445;color:#3b2f0b;display:flex;flex-direction:column;border-radius:inherit}
.notes-head{display:flex;align-items:center;justify-content:space-between;padding:.5em .6em .2em;font-size:.72em;font-weight:500}
.notes-head .nt-add{width:1.4em;height:1.4em;display:grid;place-items:center;border-radius:.3em;opacity:.6;cursor:pointer}
.notes-head .nt-add:hover{opacity:1;background:rgba(0,0,0,.08)}
.notes-list{flex:1;overflow:auto;padding:.1em .6em .5em;font-size:.66em;line-height:1.6}
.notes-list::-webkit-scrollbar{width:3px}
.notes-list::-webkit-scrollbar-thumb{background:rgba(0,0,0,.2);border-radius:2px}
.note-row{display:flex;align-items:center;gap:.4em;padding:.18em 0;cursor:pointer;border-radius:.25em}
.note-row:hover{background:rgba(0,0,0,.05)}
.note-dot{width:.3em;height:.3em;border-radius:50%;background:rgba(0,0,0,.45);flex:0 0 auto}
.note-txt{flex:1;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.note-row.done .note-txt{text-decoration:line-through;opacity:.55}
.notes-empty{opacity:.45;font-size:.66em;padding:.3em 0}

/* ================= countdown ================= */
.w-cd{height:100%;display:flex;flex-direction:column;padding:.55em .65em;gap:.3em}
.cd-head{display:flex;align-items:center;justify-content:space-between;font-size:.62em;opacity:.7}
.cd-main{display:flex;align-items:center;justify-content:space-between;gap:.5em;flex:1;min-height:0}
.cd-left{display:flex;flex-direction:column;gap:.15em;min-width:0}
.cd-label{font-size:.6em;opacity:.7}
.cd-time{font-family:"HarmonyOS_Sans",var(--font);font-size:1.42em;line-height:1.1;letter-spacing:.02em;font-variant-numeric:tabular-nums;white-space:nowrap}
.cd-mini{display:flex;gap:.9em;font-size:.58em;opacity:.8;margin-top:.1em;flex-wrap:wrap}
.cd-mini .m{display:flex;flex-direction:column;gap:.15em}
.cd-mini .m b{font-size:1.55em;font-weight:400;line-height:1}
.cd-mini .m span{opacity:.7}
.cd-img{width:4.6em;height:4.6em;border-radius:.5em;object-fit:cover;flex:0 0 auto;background:rgba(255,255,255,.08)}
.cd-money{font-size:.6em;opacity:.85;display:flex;justify-content:space-between;border-top:1px solid var(--line);padding-top:.35em}
.cd-money b{font-weight:500;color:#ffd666}

/* ================= todo ================= */
.w-todo{height:100%;display:flex;flex-direction:column}
.todo-head{display:flex;align-items:center;justify-content:space-between;padding:.5em .6em .15em;font-size:.7em}
.todo-head .t-count{opacity:.55;font-size:.85em}
.todo-list{flex:1;overflow:auto;padding:0 .45em .4em}
.todo-list::-webkit-scrollbar{width:3px}
.todo-list::-webkit-scrollbar-thumb{background:rgba(255,255,255,.18);border-radius:2px}
.todo-row{display:flex;align-items:flex-start;gap:.45em;padding:.32em .3em;border-radius:.3em;cursor:pointer;font-size:.66em;line-height:1.45}
.todo-row:hover{background:rgba(255,255,255,.07)}
.todo-check{width:1em;height:1em;border-radius:.25em;border:1px solid rgba(255,255,255,.4);flex:0 0 auto;margin-top:.15em;display:grid;place-items:center}
.todo-row.done .todo-check{background:var(--accent);border-color:var(--accent)}
.todo-check svg{width:.75em;height:.75em;color:#fff;opacity:0}
.todo-row.done .todo-check svg{opacity:1}
.todo-text{flex:1;word-break:break-word}
.todo-row.done .todo-text{text-decoration:line-through;opacity:.45}
.todo-add{display:flex;align-items:center;gap:.3em;padding:.3em .6em .5em;border-top:1px solid var(--line)}
.todo-add input{flex:1;background:none;border:0;outline:none;font-size:.66em;color:var(--text)}
.todo-add input::placeholder{color:var(--text-dim)}

/* ================= calculator ================= */
.w-calc{height:100%;display:flex;flex-direction:column;padding:.45em;gap:.35em}
.calc-disp{font-size:1.05em;text-align:right;padding:.2em .35em;overflow:hidden;white-space:nowrap;font-variant-numeric:tabular-nums;min-height:2.2em;display:flex;flex-direction:column;justify-content:flex-end}
.calc-hist{font-size:.55em;opacity:.45;line-height:1.2;min-height:1.2em}
.calc-keys{flex:1;display:grid;grid-template-columns:repeat(4,1fr);gap:.28em}
.calc-key{display:grid;place-items:center;border-radius:.4em;background:rgba(255,255,255,.09);font-size:.78em;cursor:pointer;transition:.12s;color:var(--text)}
html[data-theme="light"] .calc-key{background:rgba(0,0,0,.05)}
.calc-key:hover{background:rgba(255,255,255,.18)}
.calc-key:active{transform:scale(.96)}
.calc-key.op{color:var(--accent)}
.calc-key.eq{background:var(--accent);color:#fff}
.calc-key.eq:hover{filter:brightness(1.08)}

/* ================= forex ================= */
.w-fx{height:100%;display:flex;flex-direction:column;padding:.55em .6em;gap:.4em}
.fx-row{display:flex;align-items:center;gap:.4em}
.fx-amt{flex:1;min-width:0;background:rgba(255,255,255,.08);border:1px solid var(--line);border-radius:.4em;padding:.25em .45em;font-size:.8em;color:inherit;outline:none}
html[data-theme="light"] .fx-amt{background:rgba(0,0,0,.03)}
.fx-sel{background:rgba(255,255,255,.08);border:1px solid var(--line);border-radius:.4em;padding:.28em .35em;font-size:.68em;color:inherit;outline:none;cursor:pointer}
html[data-theme="light"] .fx-sel{background:rgba(0,0,0,.03)}
.fx-sel option{background:var(--panel-solid);color:var(--text)}
.fx-swap{width:1.6em;height:1.6em;display:grid;place-items:center;opacity:.6;cursor:pointer;border-radius:.35em;flex:0 0 auto}
.fx-swap:hover{opacity:1;background:rgba(255,255,255,.1)}
.fx-out{font-size:1.15em;font-variant-numeric:tabular-nums;margin-top:auto}
.fx-out small{font-size:.5em;opacity:.6;margin-left:.4em}
.fx-rate{font-size:.58em;opacity:.55}

/* ================= stock ================= */
.w-stock{height:100%;display:flex;flex-direction:column}
.stk-head{display:flex;align-items:center;justify-content:space-between;padding:.5em .55em .2em;font-size:.66em}
.stk-hint{opacity:.4;font-size:.9em}
.stk-row.has-kl:hover .stk-name{text-decoration:underline;text-decoration-style:dotted;text-underline-offset:2px}
.stk-list{flex:1;overflow:auto;padding:0 .35em .3em}
.stk-list::-webkit-scrollbar{width:3px}
.stk-list::-webkit-scrollbar-thumb{background:rgba(255,255,255,.18);border-radius:2px}
.stk-row{display:flex;align-items:center;justify-content:space-between;gap:.4em;padding:.24em .3em;border-radius:.28em;font-size:.66em;cursor:pointer}
.stk-row:hover{background:rgba(255,255,255,.07)}
.stk-name{flex:1;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.stk-price{font-variant-numeric:tabular-nums}
.stk-chg{font-variant-numeric:tabular-nums;width:4.2em;text-align:right}
.up{color:#ff5f5f}
.down{color:#31c48d}

/* ================= world clock ================= */
.w-clock{height:100%;display:flex;flex-direction:column;padding:.5em .6em;gap:.1em}
.wc-row{display:flex;align-items:center;justify-content:space-between;gap:.5em;font-size:.66em;padding:.15em 0}
.wc-city{opacity:.75;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.wc-time{font-family:"HarmonyOS_Sans",var(--font);font-variant-numeric:tabular-nums;font-size:1.1em}
.wc-diff{font-size:.85em;opacity:.45;margin-left:.4em}

/* ================= translate ================= */
.w-tr{height:100%;display:flex;flex-direction:column;padding:.5em .55em;gap:.35em}
.tr-bar{display:flex;align-items:center;gap:.35em;font-size:.6em;opacity:.8}
.tr-bar .fx-sel{font-size:1em}
.tr-in{flex:1;resize:none;background:rgba(255,255,255,.07);border:1px solid var(--line);border-radius:.4em;padding:.35em .45em;font-size:.7em;line-height:1.45;outline:none;color:inherit}
.tr-in::placeholder{color:var(--text-dim)}
.tr-out{flex:1;overflow:auto;font-size:.7em;line-height:1.5;padding:.3em .45em;border-radius:.4em;background:rgba(255,255,255,.04);word-break:break-word;color:var(--text-dim)}
.tr-out.has{color:var(--text)}

/* ================= folder widget (media toolbox) ================= */
.w-folder{height:100%;display:flex;flex-direction:column;padding:.5em .55em;gap:.35em}
.wf-title{font-size:.64em;opacity:.7;display:flex;justify-content:space-between;align-items:center}
.wf-grid{flex:1;display:grid;grid-template-columns:1fr 1fr;grid-template-rows:1fr 1fr;gap:.35em}
.wf-tile{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:.2em;border-radius:.4em;background:rgba(255,255,255,.09);cursor:pointer;font-size:.58em;padding:.2em}
.wf-tile:hover{background:rgba(255,255,255,.16)}
.wf-tile .wf-ico{width:1.5em;height:1.5em;display:grid;place-items:center}
.wf-tile .wf-ico svg{width:1.4em;height:1.4em}
.wf-tile span{max-width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}

/* 浅色主题下高亮数值改用主题色，避免浅底黄字 */
html[data-theme="light"] .ann-row.past .ann-num,
html[data-theme="light"] .cd-money b{color:var(--accent)}
html[data-theme="light"] .w-cal .cal-body,
html[data-theme="light"] .w-cal{color:#fff}
