*{margin:0;padding:0;box-sizing:border-box}
html,body{height:100%}
body{font-family:"Microsoft YaHei UI","Microsoft YaHei","PingFang SC","Noto Sans CJK SC",system-ui,sans-serif;
  background:#F3F6F4;display:flex;flex-direction:column;min-height:100vh;color:#22312a}

/* ===== 顶栏：微信绿渐变 ===== */
.topbar{flex:none;background:linear-gradient(135deg,#07C160,#06AD56);color:#fff;padding:14px 16px 12px;
  box-shadow:0 2px 8px rgba(7,193,96,.25)}
.topbar-row{display:flex;align-items:center;justify-content:space-between;max-width:900px;margin:0 auto;width:100%}
.brand{font-size:16px;font-weight:700;letter-spacing:.5px}
.brand small{display:block;font-size:11px;font-weight:400;opacity:.85;margin-top:2px;letter-spacing:0}
.user-chip{background:rgba(255,255,255,.18);border:none;color:#fff;font-size:12px;padding:6px 12px;
  border-radius:20px;cursor:pointer;font-family:inherit;transition:.15s}
.user-chip:hover{background:rgba(255,255,255,.3)}

/* ===== 主体 ===== */
.main{flex:1;display:flex;flex-direction:column;padding:14px;max-width:900px;margin:0 auto;width:100%;gap:12px}

/* 积分卡 3×2 */
.points{display:grid;grid-template-columns:repeat(3,1fr);gap:9px}
.pt{background:#fff;border-radius:14px;padding:12px 6px 10px;text-align:center;
  box-shadow:0 1px 4px rgba(0,0,0,.05);border:1px solid #EDF2EE}
.pt .n{font-size:11px;color:#8a9691;margin-bottom:6px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.pt .v{font-size:17px;font-weight:700;color:#07C160}
.pt.miss .v{color:#E6503C}

.card{background:#fff;border-radius:14px;padding:14px;box-shadow:0 1px 4px rgba(0,0,0,.05);border:1px solid #EDF2EE}
.task-row{display:flex;align-items:center;gap:10px}
.task-dot{width:9px;height:9px;border-radius:50%;background:#C3CCC7;flex:none}
.task-dot.on{background:#07C160;box-shadow:0 0 0 3px rgba(7,193,96,.15)}
.task-txt{flex:1;font-size:13px;color:#3d4a44;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.btn-main{flex:none;border:none;border-radius:20px;padding:8px 22px;font-size:13px;font-weight:700;
  color:#fff;cursor:pointer;font-family:inherit;transition:.15s}
.btn-start{background:linear-gradient(135deg,#07C160,#06AD56);box-shadow:0 2px 6px rgba(7,193,96,.35)}
.btn-start:hover{filter:brightness(1.06)}
.btn-stop{background:#fff;color:#E6503C;border:1px solid #E6503C}
.hint{font-size:11px;color:#9aa5a0;margin-top:8px;line-height:1.6}

.card-title{font-size:12px;color:#8a9691;margin-bottom:8px;display:flex;justify-content:space-between;align-items:center}
.logbox{background:#0F1A14;border-radius:10px;padding:10px 12px;height:260px;overflow-y:auto;
  font-family:Consolas,"DejaVu Sans Mono",monospace;font-size:11px;line-height:1.75;color:#9fd8b4;
  white-space:pre-wrap;word-break:break-all}

/* ===== 底部状态栏 ===== */
.foot{flex:none;display:flex;align-items:center;gap:14px;padding:9px 14px;border-top:1px solid #E4EAE6;background:#FAFCFB;
  flex-wrap:wrap;max-width:900px;margin:0 auto;width:100%}
.foot a,.foot button{font-size:12px;color:#5a6762;background:none;border:none;cursor:pointer;font-family:inherit;
  text-decoration:none;padding:0}
.foot a:hover,.foot button:hover{color:#07C160}
.foot .meta{font-size:11px;color:#9aa5a0;margin-left:auto}
/* ===== 底栏更新进度条（设置 ↔ 关于 之间） ===== */
.foot .updbar{display:none;align-items:center;gap:8px;flex:0 1 auto;min-width:160px;max-width:320px}
.foot .updbar.on{display:flex}
.foot .updbar-t{font-size:11px;color:#5a6762;white-space:nowrap;flex:none}
.foot .updbar-track{position:relative;flex:1 1 auto;height:6px;min-width:52px;border-radius:3px;
  background:#E4EAE6;overflow:hidden}
.foot .updbar-track i{position:absolute;left:0;top:0;bottom:0;width:0;border-radius:3px;
  background:linear-gradient(90deg,#07C160,#22c07d);transition:width .25s ease}
.foot .updbar-p{font-size:11px;color:#5a6762;font-variant-numeric:tabular-nums;
  min-width:34px;text-align:right;flex:none}
/* 更新中：进度条挤占空间时让 meta 换行到下一行，避免被压扁 */
.foot .updbar.on ~ .meta{margin-left:auto}
html[data-theme="dark"] .foot .updbar-t,
html[data-theme="dark"] .foot .updbar-p{color:#9aa8a0}
html[data-theme="dark"] .foot .updbar-track{background:#243029}

/* ===== 登录视图 =====
   与 Windows 端同构：登录卡片固定（logo/标题/输入框/按钮保持可见），
   账号较多时「只有账号列表内部滚动」，整页不滚动。
   ❌ 历史 bug：把 .login-wrap 当整页滚动容器 → 滚动时 logo/标题被一起卷走。
   ❌ 也不能用 justify-content:center（unsafe 对齐）：溢出时会裁掉顶部。 */
.login-wrap{flex:1;min-height:0;display:flex;flex-direction:column;overflow:hidden}
.login-body{flex:1;min-height:0;display:flex;flex-direction:column;padding:16px 30px 12px;max-width:420px;
  margin:0 auto;width:100%;overflow-y:auto}
/* 无已保存账号：卡片垂直居中；有已保存账号：卡片贴顶，列表内部滚动 */
.login-card{flex:none;margin-block:auto}
.login-body.has-acc .login-card{margin-block:0}
.logo-circle{width:76px;height:76px;border-radius:18%;margin:0 auto 18px;
  display:flex;align-items:center;justify-content:center;
  box-shadow:0 6px 18px rgba(57,182,98,.35);overflow:hidden}
.logo-circle img{width:100%;height:100%;display:block}
.login-title{text-align:center;font-size:19px;font-weight:700;color:#22312a;margin-bottom:4px}
.login-sub{text-align:center;font-size:12px;color:#9aa5a0;margin-bottom:26px}
.input{width:100%;border:1.5px solid #DDE5E0;border-radius:12px;padding:12px 14px;font-size:14px;
  outline:none;font-family:inherit;background:#fff;transition:.15s}
.input:focus{border-color:#07C160;box-shadow:0 0 0 3px rgba(7,193,96,.12)}
.btn-green{width:100%;border:none;border-radius:12px;padding:12px;font-size:15px;font-weight:700;color:#fff;
  background:linear-gradient(135deg,#07C160,#06AD56);cursor:pointer;font-family:inherit;margin-top:14px;
  box-shadow:0 3px 8px rgba(7,193,96,.3);transition:.15s}
.btn-green:hover{filter:brightness(1.05)}
.btn-green:disabled{opacity:.6;cursor:not-allowed}
.login-err{font-size:12px;color:#E6503C;text-align:center;min-height:18px;margin-top:10px}
.login-foot{text-align:center;font-size:11px;color:#b0bab5;margin-top:22px;line-height:1.8}
.login-foot code{background:#EDF2EE;padding:1px 5px;border-radius:4px;font-size:10px;color:#5a6762}

/* ===== 弹窗 ===== */
.mask{position:fixed;inset:0;background:rgba(15,26,20,.45);display:none;align-items:center;justify-content:center;z-index:50}
.mask.on{display:flex}
.modal{background:#fff;border-radius:16px;width:86%;max-width:330px;padding:20px;box-shadow:0 12px 40px rgba(0,0,0,.2)}
.modal h3{font-size:15px;color:#22312a;margin-bottom:10px}
.modal .body{font-size:13px;color:#4d5a54;line-height:1.7;white-space:pre-wrap;max-height:260px;overflow-y:auto}
.modal .acts{display:flex;gap:10px;margin-top:18px}
.modal .acts button{flex:1;border-radius:10px;padding:9px;font-size:13px;cursor:pointer;font-family:inherit;border:none}
.btn-ok{background:#07C160;color:#fff;font-weight:700}
.btn-cancel{background:#F0F4F1;color:#5a6762}
.acc-item{display:flex;align-items:center;gap:8px;padding:9px 8px;border-radius:10px;cursor:pointer;
  font-size:13px;color:#3d4a44}
.acc-item:hover{background:#F0F7F2}
.acc-item.cur{color:#07C160;font-weight:700}
.acc-item .cur-tag{margin-left:auto;font-size:11px;color:#07C160}
.acc-item .del{margin-left:auto;color:#c2ccc7;font-size:15px;padding:0 6px;border-radius:6px}
.acc-item .del:hover{color:#E6503C;background:#FDF0EE}
.acc-empty{font-size:12px;color:#9aa5a0;text-align:center;padding:14px 0}
/* ---- 标题行「全部账号」开关 ---- */
.modal h3.acc-title{display:flex;align-items:center;gap:8px}
.modal h3.acc-title .acc-all{margin-left:auto;flex:none;display:flex;align-items:center;gap:6px;
  font-size:12px;font-weight:400;color:#8a9691}
/* 标题里的开关复用单账号 .tgl 的外观 */
.modal h3.acc-title .acc-all .tgl{flex:none;width:34px;height:20px;border-radius:10px;border:none;
  cursor:pointer;position:relative;padding:0;transition:background .18s;outline:none}
.modal h3.acc-title .acc-all .tgl:before{content:"";position:absolute;width:14px;height:14px;
  border-radius:50%;background:#fff;top:3px;transition:left .18s;box-shadow:0 1px 2px rgba(0,0,0,.25)}
.modal h3.acc-title .acc-all .tgl.on{background:#07C160}
.modal h3.acc-title .acc-all .tgl.on:before{left:17px}
.modal h3.acc-title .acc-all .tgl.off{background:#D6DEDA}
.modal h3.acc-title .acc-all .tgl.off:before{left:3px}
.modal h3.acc-title .acc-all .tgl:focus-visible{box-shadow:0 0 0 3px rgba(7,193,96,.25)}
/* ---- 登录页已保存账号快捷切换 ----
   账号多时「只有这个列表滚动」，标题与登录卡片固定。 */
.saved-acc{display:flex;flex-direction:column;flex:1 1 auto;min-height:0;margin-top:14px}
.saved-acc-t{flex:none;font-size:12px;color:#8a938e;margin-bottom:6px}
.saved-list{flex:1 1 auto;min-height:0;overflow-y:auto;overflow-x:hidden;padding-right:2px}
.saved-item{display:flex;align-items:center;justify-content:space-between;background:#fff;border:1px solid #e4e9e5;
  border-radius:10px;padding:10px 12px;margin-bottom:8px;font-size:14px;color:#111;cursor:pointer;transition:.15s}
.saved-item:hover{border-color:#2aae67;box-shadow:0 2px 8px rgba(42,174,103,.12)}
.saved-item b{font-weight:600;flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.saved-item .saved-login{color:#8a938e;font-size:12px;flex:none;margin-left:8px}
/* 行内删除：与「账号管理」弹窗的 ✕ 同款（stopPropagation 避免误触登录） */
.saved-item .saved-del{flex:none;margin-left:10px;color:#c2ccc7;font-size:15px;line-height:1;padding:2px 6px;border-radius:6px;cursor:pointer}
.saved-item .saved-del:hover{color:#E6503C;background:#FDF0EE}

/* toast 提示：垂直居中（原先 top:20% 离窗口顶部过近） */
#toast{position:fixed;top:50%;left:50%;transform:translate(-50%,-50%);background:rgba(15,26,20,.82);color:#fff;
  font-size:13px;padding:10px 18px;border-radius:10px;opacity:0;transition:.25s;pointer-events:none;z-index:99}
#toast.on{opacity:1}

/* ===== 设置弹窗 ===== */
/* 注意：必须写成 .modal .set-body 才能压过 .modal .body 的 white-space:pre-wrap
   （特异性同为 0,2,0，靠后定义者生效）。否则 HTML 源码里的换行/缩进会被
   当作真实空行渲染，弹窗行距会异常巨大。 */
.modal .set-body{white-space:normal}
.set-row{display:flex;align-items:center;justify-content:space-between;gap:10px;
  padding:8px 0;border-bottom:1px solid #F0F4F1;font-size:13px;color:#3d4a44}
.set-row:last-of-type{border-bottom:none}
.set-row input[type=time]{border:1.5px solid #DDE5E0;border-radius:8px;padding:5px 9px;
  font-size:13px;font-family:inherit;color:#3d4a44;outline:none;background:#fff}
.set-row input[type=time]:focus{border-color:#07C160}
.set-row input[type=time]:disabled{opacity:.45;cursor:not-allowed}
.set-hint{font-size:11px;color:#9aa5a0;line-height:1.6;margin-top:8px}
.switch{position:relative;display:inline-block;width:42px;height:24px;flex:none}
.switch input{opacity:0;width:0;height:0;position:absolute}
.switch i{position:absolute;inset:0;background:#D6DEDA;border-radius:12px;transition:background .2s;cursor:pointer}
.switch i:before{content:"";position:absolute;width:18px;height:18px;left:3px;top:3px;background:#fff;
  border-radius:50%;transition:transform .2s;box-shadow:0 1px 3px rgba(0,0,0,.22)}
.switch input:checked + i{background:#07C160}
.switch input:checked + i:before{transform:translateX(18px)}

/* 连接状态提示条 */
.banner-tip{max-width:900px;margin:0 auto;width:100%;padding:0 14px}
.banner-tip div{font-size:12px;padding:8px 12px;border-radius:10px;margin-top:10px}
.banner-tip .warn{background:#FFF6E5;color:#8a6100;border:1px solid #FFE3AC}
.banner-tip .err{background:#FDF0EE;color:#A83A28;border:1px solid #F8D3CC}

/* ===== 底部危险操作（退出登录） ===== */
.foot .foot-danger{color:#c07b6f}
.foot .foot-danger:hover{color:#E6503C}
/* 「关于」靠右（Linux 端信息条在更右，故用 margin-left:auto 推开） */
.foot .foot-right{margin-left:auto}
/* Linux：信息条紧随「关于」之后，不再独占一行 */
.foot .meta{margin-left:12px}

/* 账号行：启用 / 停用按钮
   注意：必须写成 .modal .acc-body 才能压过 .modal .body 的 white-space:pre-wrap
   （否则 HTML 源码换行被当空行渲染，标题与列表之间会出现大片空白）。 */
.modal .acc-body{white-space:normal;max-height:46vh}
.acc-hint{font-size:11px;color:#9aa5a0;line-height:1.6;margin-bottom:8px;
  background:#F6FAF7;border-radius:8px;padding:8px 10px}
.acc-item .acc-name{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.acc-item .acc-tags{display:flex;align-items:center;gap:6px;flex:none}
.acc-item.off .acc-name{color:#9aa5a0}
.acc-item .off-tag{font-size:10px;color:#8a9691;background:#EDF0EE;border-radius:6px;padding:2px 6px}
.acc-item .tgl{flex:none;width:34px;height:20px;border-radius:10px;border:none;cursor:pointer;
  position:relative;padding:0;transition:background .18s;outline:none}
.acc-item .tgl:before{content:"";position:absolute;width:14px;height:14px;border-radius:50%;
  background:#fff;top:3px;transition:left .18s;box-shadow:0 1px 2px rgba(0,0,0,.25)}
.acc-item .tgl.on{background:#07C160}
.acc-item .tgl.on:before{left:17px}
.acc-item .tgl.off{background:#D6DEDA}
.acc-item .tgl.off:before{left:3px}
.acc-item .tgl:focus-visible{box-shadow:0 0 0 3px rgba(7,193,96,.25)}

/* ===== 设置：分区与取值 ===== */
.set-sec{font-size:11px;color:#9aa5a0;margin:12px 0 0;letter-spacing:.5px}
.set-sec:first-child{margin-top:0}
.set-val{font-size:12px;color:#5a6762}
.set-link{color:#07C160;text-decoration:none}
.set-link:hover{text-decoration:underline}
.set-sel{border:1.5px solid #DDE5E0;border-radius:8px;padding:5px 9px;font-size:13px;
  font-family:inherit;color:#3d4a44;outline:none;background:#fff}
.set-sel:focus{border-color:#07C160}

/* ===== 关于弹窗 ===== */
/* 仅加 .modal 前缀以修掉 white-space:pre-wrap 的特异性覆盖（与设置弹窗同一处 bug），
   尺寸保持原样，不做压缩。 */
.modal .about-body{text-align:center;white-space:normal}
.about-logo img{width:56px;height:56px;border-radius:14px;display:block;margin:0 auto 10px}
.about-name{font-size:15px;font-weight:700;color:#22312a;margin-bottom:10px}
.about-lines{font-size:12px;color:#5a6762;line-height:1.9;white-space:pre-line;margin-bottom:10px}
.about-link a{font-size:12px;color:#07C160;text-decoration:none;cursor:pointer}
.about-link a:hover{text-decoration:underline}
.about-copy{font-size:11px;color:#b0bab5;margin-top:10px;line-height:1.6}

/* ===== 深色主题 ===== */
/* color-scheme 让浏览器原生控件（滚动条/下拉/时间选择器）跟着变暗。
   没有它时，深色背景上仍是白色滚动条。 */
html[data-theme="dark"]{color-scheme:dark}
html[data-theme="dark"] body{background:#0F1512;color:#D8E3DC}
/* Chromium 的滚动条需显式着色（color-scheme 不覆盖已渲染的滚动条） */
html[data-theme="dark"] ::-webkit-scrollbar{width:10px;height:10px}
html[data-theme="dark"] ::-webkit-scrollbar-track{background:#121814}
html[data-theme="dark"] ::-webkit-scrollbar-thumb{background:#38473F;border:2px solid #121814;border-radius:6px}
html[data-theme="dark"] ::-webkit-scrollbar-thumb:hover{background:#4A5C52}
html[data-theme="dark"] ::-webkit-scrollbar-corner{background:#121814}
html[data-theme="dark"] .topbar{background:linear-gradient(135deg,#0a8f47,#077138);box-shadow:0 2px 8px rgba(0,0,0,.4)}
html[data-theme="dark"] .pt{background:#18201B;border-color:#243029;box-shadow:none}
html[data-theme="dark"] .pt .n{color:#8fa096}
html[data-theme="dark"] .card{background:#18201B;border-color:#243029;box-shadow:none}
html[data-theme="dark"] .task-txt{color:#C3D2C9}
html[data-theme="dark"] .hint{color:#7d8c84}
html[data-theme="dark"] .card-title{color:#8fa096}
html[data-theme="dark"] .foot{background:#121814;border-top-color:#243029}
html[data-theme="dark"] .foot a,html[data-theme="dark"] .foot button{color:#9aa8a0}
html[data-theme="dark"] .foot a:hover,html[data-theme="dark"] .foot button:hover{color:#07C160}
html[data-theme="dark"] .foot .meta{color:#7d8c84}
html[data-theme="dark"] .login-title{color:#E4EEE8}
html[data-theme="dark"] .login-sub{color:#7d8c84}
html[data-theme="dark"] .input{background:#18201B;border-color:#2c3a32;color:#E4EEE8}
html[data-theme="dark"] .modal{background:#18201B}
html[data-theme="dark"] .modal h3{color:#E4EEE8}
html[data-theme="dark"] .modal h3.acc-title .acc-all{color:#8FA398}  /* 深色下提亮小字，保证对比度 */
html[data-theme="dark"] .modal .body{color:#C3D2C9}
html[data-theme="dark"] .btn-cancel{background:#243029;color:#9aa8a0}
html[data-theme="dark"] .acc-item:hover{background:#1F2A23}
html[data-theme="dark"] .acc-hint{background:#1C2620;color:#7d8c84}
html[data-theme="dark"] .acc-item .off-tag{background:#243029;color:#7d8c84}
html[data-theme="dark"] .set-row{border-bottom-color:#243029;color:#C3D2C9}
html[data-theme="dark"] .set-val{color:#9aa8a0}
html[data-theme="dark"] .set-sel{background:#18201B;border-color:#2c3a32;color:#E4EEE8}
html[data-theme="dark"] .set-row input[type=time]{background:#18201B;border-color:#2c3a32;color:#E4EEE8}
html[data-theme="dark"] .about-name{color:#E4EEE8}
html[data-theme="dark"] .about-lines{color:#9aa8a0}
html[data-theme="dark"] .about-copy{color:#6b7a72}
html[data-theme="dark"] .saved-item{background:#18201B;border-color:#2c3a32;color:#E4EEE8}
html[data-theme="dark"] .saved-item .saved-login{color:#7d8c84}
html[data-theme="dark"] .saved-item .saved-del{color:#6d7d74}
html[data-theme="dark"] .saved-item .saved-del:hover{color:#E6503C;background:#3A2420}
html[data-theme="dark"] .login-foot code{background:#243029;color:#9aa8a0}
html[data-theme="dark"] .banner-tip .warn{background:#3a2f14;color:#e8c97a;border-color:#5a4a1e}
html[data-theme="dark"] .banner-tip .err{background:#3a1f1a;color:#eb9a8a;border-color:#5a2f27}

@media (max-width:520px){
  .foot .meta{margin-left:0;width:100%}
  .logbox{height:180px}
}