/* 基础样式重置与变量 */
:root{
    --green:#8cc215; /* 主按钮绿色 */
    --green-dark:#76a70f;
    --text:#333;
    --muted:#999;
    --card:#fff;
    --shadow:0 12px 28px rgba(0,0,0,.08);
    --bg-main:#8cc215; /* 背景主色，可由方块切换 */
    --bg-dark:#76a70f;  /* 背景主色的深色，用于悬停等 */
    --reg-input-w:220px; /* 注册弹窗统一输入宽度 */
}
*{box-sizing:border-box;}
html,body{height:100%;}
body{
    margin:0;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, 'PingFang SC', 'Noto Sans CJK SC', 'Microsoft YaHei', sans-serif;
    color:var(--text);
    background:#ffffff;
}

/* 防复制选择（对输入控件放开） */
.no-copy{ -webkit-user-select:none; user-select:none; }
.no-copy input, .no-copy textarea { -webkit-user-select:text; user-select:text; }
.no-copy a, .no-copy button { -webkit-user-select:none; user-select:none; }

/* 全局水印已移除，根据需求可重新开启 */

/* 右上角按钮 */
.install-btn{
    position:fixed;
    top:16px;
    right:16px;
    background:linear-gradient(135deg, #8e7df1 0%, #6f63d9 50%, #a18bff 100%);
    color:#fff;
    text-decoration:none;
    border-radius:8px;
    border:1px solid rgba(142,125,241,.55);
    padding:5px 8px;
    font-size:12px;
    box-shadow:0 6px 14px rgba(142,125,241,.25);
    transition:transform .15s ease, box-shadow .15s ease, filter .15s ease;
    overflow:hidden;
    z-index:6;
    pointer-events:auto;
    cursor:pointer;
}
.install-btn:hover{
    filter:brightness(1.08);
    transform:translateY(-3px) scale(1.06);
    border-color:rgba(142,125,241,.85);
    /* 外发光（扩散阴影）+ 提升主体阴影 */
    box-shadow:
        0 14px 28px rgba(142,125,241,.36),
        0 0 0 2px rgba(142,125,241,.28),
        0 0 18px 8px rgba(142,125,241,.4);
}
.install-btn:active{ box-shadow:0 4px 10px rgba(142,125,241,.22); transform:translateY(0); }

/* 镜面扫光 */
.install-btn::before{
    content:"";
    position:absolute; left:-130%; top:0; width:60%; height:100%;
    pointer-events:none;
    background:linear-gradient(120deg, rgba(255,255,255,0) 0%, rgba(255,255,255,.55) 50%, rgba(255,255,255,0) 100%);
    transform:skewX(-20deg);
    opacity:.6;
    animation:installSheen 1.6s linear infinite;
}
.install-btn:hover::before{ opacity:.95; animation-duration:1.2s; }

@keyframes installSheen{
    from{ left:-130%; }
    to{ left:160%; }
}

/* 背景网格（辐射淡绿方块） */
.bg-canvas{position:fixed;inset:0;z-index:0;display:block;background:transparent;}
/* 取消旧渐变覆盖层，使用 Canvas 动态绘制 */
.bg-gradient{display:none;}

/* 颜色选择弹层 */
.color-overlay{position:fixed;inset:0;background:rgba(0,0,0,.18);display:none;align-items:center;justify-content:center;z-index:3;}
.color-overlay.show{display:flex;}
.color-panel{background:#fff;border-radius:10px;box-shadow:0 20px 40px rgba(0,0,0,.18);padding:14px 14px 12px;min-width:320px;width:min(92vw, 360px);} 
.picker{display:flex;gap:12px;}
.sv-wrap{position:relative;width:220px;height:150px;background:#fff;border-radius:8px;overflow:hidden;box-shadow:inset 0 0 0 1px rgba(0,0,0,.06);} 
.sv{width:100%;height:100%;position:relative;}
.sv:after{content:"";position:absolute;inset:0;background:linear-gradient(90deg,#fff,rgba(255,255,255,0));}
.sv:before{content:"";position:absolute;inset:0;background:linear-gradient(0deg,#000,rgba(0,0,0,0));}
.sv-cursor{position:absolute;width:14px;height:14px;border:2px solid #fff;box-shadow:0 0 0 1px rgba(0,0,0,.4);border-radius:50%;left:0;top:0;transform:translate(-7px,-7px);}
.hue-wrap{position:relative;width:16px;height:150px;border-radius:8px;overflow:hidden;box-shadow:inset 0 0 0 1px rgba(0,0,0,.06);} 
.hue{position:absolute;inset:0;background:linear-gradient(180deg,red,#ff0,#0f0,#0ff,#00f,#f0f,red);} 
.hue-cursor{position:absolute;left:0;top:0;width:20px;height:12px;border:2px solid #fff;box-shadow:0 0 0 1px rgba(0,0,0,.4);border-radius:6px;transform:translate(-2px,-6px);}
.picker-footer{display:flex;align-items:center;gap:10px;margin-top:12px;}
.preview{width:28px;height:28px;border-radius:6px;box-shadow:inset 0 0 0 1px rgba(0,0,0,.06);} 
.hex-input{width:92px;height:30px;border:1px solid #e2e2e2;border-radius:6px;padding:0 8px;}
.spacer{flex:1;}
.picker-btn{min-width:68px;height:32px;border:none;border-radius:6px;cursor:pointer;background:#f2f2f2;}
.btn-ok{background:var(--green);color:#fff;}

/* 充值弹窗 */
.recharge-overlay{position:fixed;inset:0;background:rgba(0,0,0,.25);display:none;align-items:center;justify-content:center;z-index:4;}
.recharge-overlay.show{display:flex;}
.recharge-modal{width:min(92vw, 380px);background:#fff;border-radius:10px;box-shadow:0 20px 40px rgba(0,0,0,.18);} 
.recharge-header{display:flex;align-items:center;justify-content:space-between;padding:12px 14px;border-bottom:1px solid #eee;}
.recharge-header h3{margin:0;font-size:16px;color:#333;}
.recharge-close{border:none;background:transparent;font-size:18px;line-height:1;cursor:pointer;color:#999;}
.recharge-body{padding:10px 16px 0;}
.recharge-tip{color:#ff6b6b;font-size:12px;margin-bottom:8px;}
.recharge-row{display:flex;align-items:center;margin:10px 0;}
.recharge-label{width:64px;color:#666;font-size:13px;text-align:right;white-space:nowrap;}
.recharge-input{flex:1;height:36px;border:1px solid #e2e2e2;border-radius:6px;padding:0 10px;background:#fff;}
.recharge-input:focus{border-color:var(--bg-main);outline:none;box-shadow:0 0 0 3px color-mix(in srgb, var(--bg-main) 28%, transparent);}
.recharge-input.invalid{border-color:#ff5a4a;box-shadow:0 0 0 3px rgba(255,90,74,.18);} 
.recharge-footer{display:flex;justify-content:flex-end;gap:10px;padding:12px 14px 14px;}
.btn-ghost{min-width:86px;height:34px;border:1px solid #e2e2e2;border-radius:6px;background:#fff;color:#333;cursor:pointer;}
.btn-primary{min-width:86px;height:34px;border:none;border-radius:6px;background:var(--bg-main);color:#fff;cursor:pointer;}
.btn-primary:hover{background:var(--bg-dark);}
.btn-danger{min-width:108px;height:34px;border:none;border-radius:6px;background:var(--bg-main);color:#fff;cursor:pointer;box-shadow:0 6px 14px color-mix(in srgb, var(--bg-main) 25%, transparent);} 
.btn-danger:hover{background:var(--bg-dark);} 
/* 注册按钮内的进度条 */
.btn-primary .reg-loader{ display:none; width:14px; height:14px; border-radius:50%; border:2px solid rgba(255,255,255,.55); border-top-color:#fff; animation:spin 1s linear infinite; vertical-align:middle; margin-right:6px; }
.btn-primary.loading .reg-loader{ display:inline-block; }

/* 简易提示弹窗 */
.msg-overlay{position:fixed;inset:0;background:rgba(0,0,0,.25);display:none;align-items:center;justify-content:center;z-index:5;}
.msg-overlay.show{display:flex;}
.msg-modal{background:#fff;border-radius:10px;box-shadow:0 20px 40px rgba(0,0,0,.18);padding:16px 18px;min-width:240px;width:min(92vw, 320px);} 
.msg-text{font-size:14px;color:#333;margin-bottom:12px;}
.msg-actions{display:flex;justify-content:flex-end;}

/* 注册弹窗内：缩短三个输入框宽度并更紧凑对齐 */
#register-overlay .recharge-row{ justify-content:flex-start; column-gap:10px; }
#register-overlay .recharge-input{ flex:initial; width:var(--reg-input-w); }
#register-overlay .password-field{ position:relative; flex:initial; width:var(--reg-input-w); }
#register-overlay .password-field .recharge-input{ width:100%; padding-right:34px; }
#register-overlay .recharge-label{ width:64px; }
#register-overlay .password-field .btn-eye{ position:absolute; right:6px; top:50%; transform:translateY(-50%); width:20px; height:20px; border:none; background:transparent; cursor:pointer; background-repeat:no-repeat; background-position:center; background-size:18px 18px; background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='%23999' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M1 12s4-7 11-7 11 7 11 7-4 7-11 7S1 12 1 12Z'/%3E%3Ccircle cx='12' cy='12' r='3'/%3E%3C/svg%3E"); }
#register-overlay .password-field .btn-eye.on{ background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='%23999' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M17.94 17.94A10.94 10.94 0 0 1 12 20c-7 0-11-8-11-8a21.77 21.77 0 0 1 5.06-6.94M9.9 4.24A10.94 10.94 0 0 1 12 4c7 0 11 8 11 8a21.83 21.83 0 0 1-3.22 4.49'/%3E%3Cline x1='1' y1='1' x2='23' y2='23'/%3E%3Cpath d='M14.12 14.12A3 3 0 0 1 9.88 9.88'/%3E%3C/svg%3E"); }

/* 忘记密码弹窗：与注册弹窗对齐规则一致 */
#forgot-overlay .recharge-row{ justify-content:flex-start; column-gap:10px; }
#forgot-overlay .recharge-input{ flex:initial; width:var(--reg-input-w); }
#forgot-overlay .password-field{ position:relative; flex:initial; width:var(--reg-input-w); }
#forgot-overlay .password-field .recharge-input{ width:100%; padding-right:34px; }
#forgot-overlay .recharge-label{ width:64px; }
#forgot-overlay .password-field .btn-eye{ position:absolute; right:6px; top:50%; transform:translateY(-50%); width:20px; height:20px; border:none; background:transparent; cursor:pointer; background-repeat:no-repeat; background-position:center; background-size:18px 18px; background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='%23999' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M1 12s4-7 11-7 11 7 11 7-4 7-11 7S1 12 1 12Z'/%3E%3Ccircle cx='12' cy='12' r='3'/%3E%3C/svg%3E"); }
#forgot-overlay .password-field .btn-eye.on{ background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='%23999' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M17.94 17.94A10.94 10.94 0 0 1 12 20c-7 0-11-8-11-8a21.77 21.77 0 0 1 5.06-6.94M9.9 4.24A10.94 10.94 0 0 1 12 4c7 0 11 8 11 8a21.83 21.83 0 0 1-3.22 4.49'/%3E%3Cline x1='1' y1='1' x2='23' y2='23'/%3E%3Cpath d='M14.12 14.12A3 3 0 0 1 9.88 9.88'/%3E%3C/svg%3E"); }

/* 居中容器 */
.login-wrap{
    min-height:100vh;
    display:flex;
    align-items:center;
    justify-content:center;
    padding:32px 16px 16px;
    position:relative;
    z-index:2;
}

.login-card{
    width:min(94vw, 420px);
    min-height:460px;
    background:#ffffff;
    border-radius:10px;
    box-shadow:var(--shadow);
    padding:36px 30px 24px;
    opacity:1;
    -webkit-backdrop-filter:none;
    backdrop-filter:none;
    font-size:13px;
    transform:translateY(4vh);
}

.login-header{
    display:flex;
    align-items:center;
    justify-content:space-between;
    margin-bottom:26px;
}
.login-header::before{content:"";display:block;width:44px;}
.title{
    margin:0;
    font-size:15px;
    font-weight:600;
    flex:1;
    text-align:center;
}
.header-icons{display:flex;gap:10px;width:44px;justify-content:flex-end;}
.icon-square{width:14px;height:14px;border-radius:3px;background:var(--bg-main);display:inline-block;}
.icon-monitor{width:18px;height:14px;border:2px solid #8e7df1;border-radius:2px;display:inline-block;position:relative;}
.icon-monitor:after{content:'';position:absolute;left:50%;transform:translateX(-50%);bottom:-4px;width:8px;height:2px;background:#8e7df1;border-radius:1px;}
.icon-monitor{ cursor:pointer; }

.login-form{margin-top:8px;display:flex;flex-direction:column;row-gap:12px;max-width:min(70vw, 260px);margin-left:auto;margin-right:auto;}
.form-row{display:flex;align-items:center;column-gap:8px;margin:0;}
.form-row > .input,.form-row > .password-field{flex:1;min-width:0;}
.form-row > .input{width:100%;}
.label{width:64px;color:#666;font-size:12px;text-align:right;}
.required{color:#ff5a4a;margin-right:4px;}
.field-tip{display:none;margin:-4px 0 0 64px;font-size:10px;line-height:1;color:#ff5a4a;}
.input{
    flex:1;
    height:30px;
    border:1px solid #e2e2e2;
    border-radius:6px;
    padding:0 10px;
    outline:none;
    background:#fff;
    color:#111;
    font-size:12.5px;
}
.input:focus{border-color:var(--bg-main);background:#fff;box-shadow:0 0 0 3px color-mix(in srgb, var(--bg-main) 30%, transparent);}

.password-field{position:relative;flex:1;}
.password-field .input{width:100%;padding-right:30px;}
.btn-eye{
    position:absolute;right:6px;top:50%;transform:translateY(-50%);
    width:20px;height:20px;border:none;background:transparent;cursor:pointer;
    background-repeat:no-repeat;
    background-position:center;
    background-size:18px 18px;
    background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='%23999' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M1 12s4-7 11-7 11 7 11 7-4 7-11 7S1 12 1 12Z'/%3E%3Ccircle cx='12' cy='12' r='3'/%3E%3C/svg%3E");
}
.btn-eye:before,.btn-eye.on:after{content:none;display:none;}
.btn-eye.on{
    background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='%23999' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M17.94 17.94A10.94 10.94 0 0 1 12 20c-7 0-11-8-11-8a21.77 21.77 0 0 1 5.06-6.94M9.9 4.24A10.94 10.94 0 0 1 12 4c7 0 11 8 11 8a21.83 21.83 0 0 1-3.22 4.49'/%3E%3Cline x1='1' y1='1' x2='23' y2='23'/%3E%3Cpath d='M14.12 14.12A3 3 0 0 1 9.88 9.88'/%3E%3C/svg%3E");
}

.remember-row{display:flex;align-items:center;gap:6px;margin:8px 0 2px 0;color:#666;flex-wrap:nowrap;}
.remember{display:flex;align-items:center;gap:8px;white-space:nowrap;}
.remember input{display:none;}
.checkbox{width:16px;height:16px;border:1px solid #cfd7c1;border-radius:4px;background:#fff;position:relative;display:none;}
.remember input:checked + .checkbox:after{content:'';position:absolute;left:3px;top:1px;width:9px;height:14px;border-right:2px solid #7db415;border-bottom:2px solid #7db415;transform:rotate(40deg);} 
.hint{color:#8a8a8a;font-size:11px;white-space:nowrap;}
.hint-checkbox{width:14px;height:14px;margin-right:6px;}

.btn-login{
    display:block;
    width:100%;
    height:40px;
    margin:12px 0 10px 0;
    background:var(--bg-main);
    border:none;
    color:#fff;
    border-radius:6px;
    font-size:14px;
    cursor:pointer;
    box-shadow:0 6px 14px color-mix(in srgb, var(--bg-main) 25%, transparent);
}
.btn-login:hover{background:var(--bg-dark);} 
/* 登录按钮内加载圈 */
.btn-login .login-loader{ display:none; width:14px; height:14px; border-radius:50%; border:2px solid rgba(255,255,255,.55); border-top-color:#fff; animation:spin 1s linear infinite; vertical-align:middle; margin-right:6px; }
.btn-login.loading .login-loader{ display:inline-block; }

.links-row{display:flex;justify-content:space-between;align-items:center;margin:6px 0 0 0;color:#666;font-size:clamp(10.5px, 2.4vw, 12px);} 
.links-row a{ text-decoration:none; }
.link-orange{color:#ff8a00;}
.link-red{color:#ff5a4a;}

.speed-test{ text-align:center; margin-top:36px; }
.speed-test a{ color:#666; text-decoration:none; font-size:clamp(11px, 2.8vw, 13px); }
.speed-test{ display:flex; align-items:center; justify-content:center; gap:8px; }
.loader{ width:18px; height:18px; border-radius:50%; border:2px solid rgba(0,0,0,.12); border-top-color: var(--bg-main); animation:spin 1s linear infinite; display:none; }
.loader.show{ display:inline-block; }
@keyframes spin { to { transform: rotate(360deg); } }
.top-notice{ position:fixed; top:0; left:0; right:0; height:auto; padding:10px 14px; background:#111; color:#fff; text-align:center; font-size:14px; transform:translateY(-100%); transition:transform .25s ease; z-index:4; }
.top-notice.show{ transform:translateY(0); }

/* 悬停在“测速”时的矩形强调色块（联动主题色） */
.speed-link{ position:relative; padding:2px 8px; border-radius:6px; }
.speed-link::before{
    content:""; position:absolute; inset:-2px -6px; border-radius:6px;
    background: color-mix(in srgb, var(--bg-main) 22%, white);
    opacity:0; transform:scale(.96); transition:opacity .18s ease, transform .18s ease;
    z-index:-1;
}
.speed-link:hover::before, .has-tooltip:hover .speed-link::before{ opacity:1; transform:scale(1); }
.has-tooltip{ position:relative; display:inline-block; }
.tooltip{ position:absolute; left:50%; transform:translateX(-50%); bottom:28px; width:280px; padding:10px 12px; background:#333; color:#fff; font-size:12px; line-height:1.5; border-radius:8px; box-shadow:0 6px 18px rgba(0,0,0,.2); opacity:0; visibility:hidden; transition:opacity .18s ease, transform .18s ease; transform-origin:50% 100%; }
.tooltip:after{ content:""; position:absolute; left:50%; bottom:-6px; transform:translateX(-50%); border:6px solid transparent; border-top-color:#333; }
.has-tooltip:hover .tooltip{ opacity:1; visibility:visible; transform:translateX(-50%) translateY(-4px); }

/* 测速结果弹窗美化 */
.speed-overlay{ position:fixed; inset:0; background:rgba(0,0,0,.28); display:none; align-items:center; justify-content:center; z-index:6; }
.speed-overlay.show{ display:flex; }
.speed-modal{ width:min(92vw, 380px); background:#fff; border-radius:12px; box-shadow:0 20px 44px rgba(0,0,0,.22); overflow:hidden; }
.speed-header{ display:flex; align-items:center; justify-content:space-between; padding:12px 14px; border-bottom:1px solid #eee; }
.speed-header h3{ margin:0; font-size:16px; color:#333; }
.speed-close{ border:none; background:transparent; font-size:18px; line-height:1; cursor:pointer; color:#999; }
.speed-body{ padding:16px; }
.speed-summary{ display:flex; align-items:baseline; gap:10px; margin-bottom:14px; }
.speed-value{ font-size:24px; font-weight:700; color:#333; }
.speed-tip{ font-size:12px; color:#666; }
.speed-bar-wrap{ position:relative; height:10px; background:#f1f2f3; border-radius:999px; overflow:hidden; box-shadow:inset 0 0 0 1px rgba(0,0,0,.04); }
.speed-bar{ position:absolute; left:0; top:0; height:100%; width:0%; transition:width .35s ease; background:linear-gradient(90deg, #8cc215, #6f63d9); }
.speed-bar[data-level="good"]{ background:linear-gradient(90deg, #45d483, #8cc215); }
.speed-bar[data-level="fair"]{ background:linear-gradient(90deg, #ffb020, #ff8a00); }
.speed-bar[data-level="bad"]{ background:linear-gradient(90deg, #ff6b6b, #ff3b3b); }
.speed-footer{ display:flex; justify-content:flex-end; padding:12px 14px 14px; border-top:1px solid #f3f3f3; }

/* 开发者工具提示遮罩与模糊效果 */
.devtools-mask{ position:fixed; inset:0; background:rgba(0,0,0,.28); display:none; align-items:center; justify-content:center; z-index:100; }
.devtools-mask.show{ display:flex; }
.devtools-box{ background:#fff; border-radius:12px; box-shadow:0 20px 44px rgba(0,0,0,.22); padding:16px 18px; min-width:280px; }
.devtools-title{ font-size:16px; font-weight:700; color:#333; margin-bottom:8px; }
.devtools-text{ font-size:13px; color:#666; }
.blur-when-devtools{ filter:blur(4px); pointer-events:none; user-select:none; }

@media (max-width:560px){
    .login-card{width:100%; padding:28px 18px 18px;}
    .title{ font-size:14px; }
    .label{width:56px;}
    .links-row{margin-left:56px;}
    .tooltip{ width:min(86vw, 300px); font-size:11px; }
    .recharge-modal{ width:min(94vw, 360px); }
    #register-overlay .recharge-input, #forgot-overlay .recharge-input{ width: min(60vw, var(--reg-input-w)); }
}

@media (max-width:360px){
    .login-card{ border-radius:8px; }
    .btn-login{ height:38px; font-size:13px; }
    .input{ height:28px; font-size:12px; }
}


