/* ----- 全局重置 ----- */
* { margin: 0; padding: 0; box-sizing: border-box; }
body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background: #f5f7fa;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
}

/* ----- 主容器 ----- */
.container {
    background: #ffffff;
    max-width: 380px;
    width: 100%;
    padding: 20px 16px 16px;
    border-radius: 20px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.04);
    border: 1px solid #eef2f6;
    text-align: center;
}
.title {
    font-size: 20px;
    font-weight: 600;
    color: #1a2634;
    letter-spacing: -0.2px;
}
.subtitle {
    font-size: 12px;
    color: #8b9bb0;
    margin-top: 2px;
}

/* ----- 用户信息栏 ----- */
.user-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #f8fafc;
    border-radius: 30px;
    padding: 4px 4px 4px 14px;
    margin-top: 14px;
    border: 1px solid #eef2f6;
}
.user-bar .username {
    font-size: 13px;
    font-weight: 500;
    color: #1a2634;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 100px;
}
.user-bar .btn-group { display: flex; gap: 4px; }
.user-bar .btn-group button {
    padding: 5px 12px;
    border: none;
    border-radius: 30px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: 0.2s;
    background: #e8f0fe;
    color: #1a73e8;
}
.user-bar .btn-group button:hover { background: #d2e0fc; }
.user-bar .btn-group button.primary {
    background: #1a73e8;
    color: white;
}
.user-bar .btn-group button.primary:hover { background: #1557b0; }

/* ----- 邮箱状态栏 ----- */
.email-status {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-size: 13px;
    color: #1a2634;
    background: #f8fafc;
    border-radius: 30px;
    padding: 6px 14px;
    border: 1px solid #eef2f6;
}
.email-status .email-label { font-weight: 600; }
.email-status .email-value { font-weight: 500; color: #1a73e8; }

/* ----- 状态标签 ----- */
.status-badge {
    display: inline-block;
    background: #e8f0fe;
    color: #1a73e8;
    padding: 3px 14px;
    border-radius: 30px;
    font-size: 12px;
    font-weight: 500;
    margin-top: 10px;
}

/* ----- 输入框组 ----- */
.input-group {
    display: flex;
    border-radius: 50px;
    overflow: hidden;
    border: 1.5px solid #dce3ec;
    background: white;
    margin-top: 12px;
}
.input-group input {
    flex: 1;
    padding: 10px 14px;
    border: none;
    font-size: 13px;
    background: transparent;
    font-family: monospace;
    outline: none;
}
.input-group input::placeholder { color: #b0c0d0; }
.copy-btn {
    background: #f0f4fa;
    border: none;
    padding: 0 16px;
    font-size: 13px;
    font-weight: 600;
    color: #1a2634;
    cursor: pointer;
    transition: 0.2s;
    border-left: 1px solid #dce3ec;
}
.copy-btn:hover { background: #e2eaf5; }

/* ----- 主按钮 ----- */
.btn-main {
    width: 100%;
    padding: 14px;
    border: none;
    border-radius: 50px;
    font-size: 16px;
    font-weight: 600;
    background: #1a73e8;
    color: white;
    cursor: pointer;
    transition: 0.2s;
    box-shadow: 0 3px 10px rgba(26, 115, 232, 0.15);
    margin-top: 18px;
}
.btn-main:hover { background: #1557b0; transform: translateY(-1px); }
.btn-main:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }

/* ----- 冷却倒计时 ----- */
.cooldown {
    text-align: center;
    font-size: 13px;
    color: #6b7a8f;
    margin-top: 14px;
    padding: 6px;
    background: #f5f8fc;
    border-radius: 30px;
    min-height: 32px;
}

/* ----- 历史记录按钮 ----- */
.history-btn {
    margin-top: 12px;
    padding: 8px;
    background: #f0f4fa;
    border: none;
    border-radius: 50px;
    font-size: 13px;
    font-weight: 600;
    color: #1a2634;
    cursor: pointer;
    transition: 0.2s;
    width: 100%;
}
.history-btn:hover { background: #e2eaf5; }

/* ----- 日志区域 ----- */
.log-area {
    margin-top: 16px;
    background: #f8fafc;
    border-radius: 14px;
    padding: 8px 12px;
    font-size: 11px;
    color: #2c3e50;
    max-height: 100px;
    overflow-y: auto;
    border: 1px solid #eef2f6;
    font-family: monospace;
    text-align: left;
}
.log-area .log-item { padding: 2px 0; border-bottom: 1px dashed #eef2f6; }
.log-area .log-item:last-child { border-bottom: none; }
.log-area .success { color: #1e7e34; }
.log-area .error { color: #c62828; }
.log-area .info { color: #1a73e8; }
.log-area .warn { color: #b7651a; }

/* ----- 悬浮球 ----- */
#floatContainer {
    position: fixed;
    right: 0;
    top: 0;
    width: 120px;
    height: 100vh;
    pointer-events: none;
    z-index: 9999;
}
.float-btn {
    position: absolute;
    right: 0;
    width: 120px;
    height: 42px;
    border-radius: 50px 0 0 50px;
    background: #1a73e8;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 600;
    text-align: center;
    box-shadow: 0 4px 12px rgba(26, 115, 232, 0.25);
    cursor: grab;
    text-decoration: none;
    transition: box-shadow 0.25s;
    border: none;
    padding: 0 12px 0 16px;
    user-select: none;
    touch-action: none;
    pointer-events: auto;
    z-index: 10000;
}
.float-btn:active { cursor: grabbing; }
.float-btn:hover { box-shadow: 0 6px 20px rgba(26, 115, 232, 0.35); }
.float-btn .text { white-space: nowrap; }

.float-btn.color-1 { background: #34a853; }
.float-btn.color-2 { background: #f9ab00; }
.float-btn.color-3 { background: #ea4335; }
.float-btn.color-4 { background: #8e44ad; }
.float-btn.color-5 { background: #00bcd4; }

@media (max-width: 480px) {
    #floatContainer { width: 100px; }
    .float-btn { width: 100px; height: 36px; font-size: 12px; padding: 0 10px 0 14px; }
}

/* ----- 模态框 ----- */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5);
    backdrop-filter: blur(4px);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    padding: 20px;
}
.modal-overlay.active { display: flex; }
.modal-box {
    background: white;
    max-width: 380px;
    width: 100%;
    padding: 24px 20px;
    border-radius: 28px;
    box-shadow: 0 30px 60px rgba(0,0,0,0.2);
    text-align: center;
    max-height: 90vh;
    overflow-y: auto;
}
.modal-box h2 {
    font-size: 18px;
    margin-bottom: 6px;
    color: #1a2634;
    font-weight: 600;
}
.modal-box .field { margin-top: 12px; text-align: left; }
.modal-box .field label {
    display: block;
    font-size: 12px;
    font-weight: 500;
    color: #3c4a5a;
    margin-bottom: 3px;
}
.modal-box .field input {
    width: 100%;
    padding: 10px 14px;
    border: 1.5px solid #dce3ec;
    border-radius: 30px;
    font-size: 13px;
    outline: none;
}
.modal-box .field input:focus {
    border-color: #1a73e8;
    box-shadow: 0 0 0 3px rgba(26,115,232,0.15);
}

/* 验证码行 */
.field-row {
    display: flex;
    gap: 8px;
    align-items: center;
}
.field-row input {
    flex: 2;
    min-width: 0;
}
.field-row button {
    flex: 1;
    min-width: 80px;
    padding: 10px 12px;
    font-size: 13px;
    white-space: nowrap;
    background: #1a73e8;
    color: white;
    border: none;
    border-radius: 30px;
    cursor: pointer;
    transition: 0.2s;
    font-weight: 600;
}
.field-row button:hover { background: #1557b0; }
.field-row button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.modal-box .btn {
    width: 100%;
    padding: 12px;
    border: none;
    border-radius: 50px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: 0.2s;
    margin-top: 14px;
}
.modal-box .btn-primary { background: #1a73e8; color: white; }
.modal-box .btn-primary:hover { background: #1557b0; }
.modal-box .btn-secondary { background: #ecf0f5; color: #1a2634; }
.modal-box .btn-secondary:hover { background: #dce3ec; }
.modal-box .link {
    color: #1a73e8;
    cursor: pointer;
    font-weight: 500;
    background: none;
    border: none;
    font-size: 13px;
    margin-top: 10px;
}
.modal-box .link:hover { text-decoration: underline; }

/* 历史记录列表 */
.history-item {
    background: #f8fafc;
    border-radius: 12px;
    padding: 10px 14px;
    margin-bottom: 8px;
    border: 1px solid #eef2f6;
    text-align: left;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.history-item .info .account { font-family: monospace; font-weight: 600; font-size: 13px; }
.history-item .info .time { color: #8b9bb0; font-size: 11px; }
.history-item .copy-btn-sm {
    padding: 4px 12px;
    border: none;
    border-radius: 20px;
    font-size: 12px;
    background: #e8f0fe;
    color: #1a73e8;
    cursor: pointer;
}
.history-item .copy-btn-sm:hover { background: #d2e0fc; }

/* Toast */
.toast {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: #1a2634;
    color: white;
    padding: 10px 20px;
    border-radius: 50px;
    font-size: 13px;
    font-weight: 500;
    box-shadow: 0 6px 20px rgba(0,0,0,0.15);
    opacity: 0;
    transition: opacity 0.3s;
    pointer-events: none;
    z-index: 2000;
}
.toast.show { opacity: 1; }
.toast.success { background: #1e7e34; }
.toast.error { background: #c62828; }
.toast.warning { background: #b7651a; }

/* 验证码弹窗 */
.modal-box .hint {
    background: #f0f4fa;
    padding: 8px 14px;
    border-radius: 16px;
    color: #3c4a5a;
    font-size: 13px;
    margin: 10px 0;
}
.modal-box img {
    max-width: 100%;
    max-height: 120px;
    border-radius: 10px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    margin: 10px 0;
}
.modal-input {
    width: 100%;
    padding: 12px;
    font-size: 18px;
    text-align: center;
    border: 2px solid #dce3ec;
    border-radius: 50px;
    margin: 10px 0 14px;
    font-family: monospace;
    outline: none;
}
.modal-input:focus { border-color: #1a73e8; box-shadow: 0 0 0 3px rgba(26,115,232,0.15); }
.modal-actions { display: flex; gap: 10px; }
.modal-actions .btn { flex: 1; margin-top: 0; }

.btn-sm { padding: 4px 12px; font-size: 12px; border-radius: 30px; }

/* ===================== 卡密验证门禁 ===================== */
.card-gate {
    position: fixed;
    inset: 0;
    z-index: 900;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: linear-gradient(160deg, #eef4ff 0%, #f7f9fc 55%, #eef7f1 100%);
    overflow-y: auto;
}
.card-gate-box {
    position: relative;
    width: 100%;
    max-width: 380px;
    background: #fff;
    border-radius: 22px;
    box-shadow: 0 12px 40px rgba(20, 40, 80, 0.12);
    padding: 28px 22px 22px;
    text-align: center;
}
.cg-icon { font-size: 34px; line-height: 1; }
.cg-title { font-size: 21px; margin: 10px 0 4px; color: #1a2634; }
.cg-sub { font-size: 13px; color: #6b7a8f; margin-bottom: 18px; }
.cg-field { margin-bottom: 12px; }
.cg-field input {
    width: 100%;
    padding: 13px 14px;
    font-size: 16px;
    letter-spacing: 1px;
    text-align: center;
    border: 2px solid #dce3ec;
    border-radius: 12px;
    outline: none;
    text-transform: uppercase;
}
.cg-field input:focus { border-color: #1a73e8; box-shadow: 0 0 0 3px rgba(26,115,232,0.14); }
.cg-btn {
    display: block;
    width: 100%;
    padding: 13px;
    font-size: 15px;
    font-weight: 600;
    line-height: 1.4;
    color: #fff;
    background: #1a73e8;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    box-sizing: border-box;
    text-align: center;
    text-decoration: none;
}
.cg-btn:hover { background: #1557b0; color: #fff; }
.cg-btn:disabled { opacity: .6; cursor: not-allowed; }

/* 购买卡密：与「验证卡密」按钮同尺寸，用描边样式区分主次操作 */
.cg-btn-buy {
    margin-top: 10px;
    padding: 11px;              /* 13px 内边距 - 2px 边框 = 与验证按钮等高 */
    color: #1a73e8;
    background: #fff;
    border: 2px solid #1a73e8;
}
.cg-btn-buy:hover { background: #eef4ff; color: #1557b0; border-color: #1557b0; }
.cg-msg { min-height: 18px; font-size: 13px; color: #c62828; margin-top: 10px; }
.cg-msg.ok { color: #1e7e34; }
.cg-links { margin-top: 12px; font-size: 13px; color: #6b7a8f; }
.cg-links a { color: #1a73e8; text-decoration: none; }
.cg-links a:hover { text-decoration: underline; }
.cg-sep { margin: 0 8px; color: #cfd8e3; }
.cg-link-btn {
    background: none;
    border: none;
    color: #1a73e8;
    font-size: 13px;
    cursor: pointer;
    padding: 0;
}
.cg-link-btn:hover { text-decoration: underline; }
.cg-types {
    margin-top: 16px;
    padding-top: 14px;
    border-top: 1px dashed #e2e8f0;
    font-size: 12px;
    color: #7b8a9c;
    text-align: left;
}
.cg-types .cg-type-item { padding: 3px 0; }
.cg-types .cg-type-name { color: #1a2634; font-weight: 600; }

/* 卡密门禁关闭按钮（混合模式显示；paid 模式由 JS 隐藏） */
.cg-close {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 32px;
    height: 32px;
    padding: 0;
    border: none;
    border-radius: 50%;
    background: #f0f4fa;
    color: #6b7a8f;
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: 0.2s;
    z-index: 1;
}
.cg-close:hover { background: #e2eaf5; color: #1a2634; }

/* 混合模式：免费额度栏 */
.free-quota-bar {
    margin-top: 8px;
    padding: 6px 12px;
    border-radius: 30px;
    background: #eef7f1;
    color: #1e7e34;
    font-size: 12px;
    line-height: 1.5;
    text-align: center;
    word-break: break-word;
}
.free-quota-bar.exhausted { background: #fff3e0; color: #b7651a; }

/* 混合模式：验证卡密（可继续获取）入口按钮 */
.open-card-gate-btn {
    display: block;
    width: 100%;
    margin-top: 10px;
    padding: 9px 12px;
    border: 1.5px solid #1a73e8;
    border-radius: 50px;
    background: #fff;
    color: #1a73e8;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: 0.2s;
}
.open-card-gate-btn:hover { background: #eef4ff; }
.open-card-gate-btn:active { background: #e0ebff; }

@media (max-width: 480px) {
    .free-quota-bar { font-size: 11px; padding: 6px 10px; }
    .open-card-gate-btn { font-size: 12px; }
}

/* 卡密信息栏 */
.card-info-bar {
    margin-top: 10px;
    padding: 8px 14px;
    border-radius: 30px;
    background: #eef4ff;
    color: #1557b0;
    font-size: 13px;
    text-align: center;
}
.card-info-bar.warn { background: #fff3e0; color: #b7651a; }

/* 公告弹窗 */
.notice-box { max-width: 420px; }
.notice-content {
    max-height: 320px;
    overflow-y: auto;
    text-align: left;
    font-size: 14px;
    line-height: 1.7;
    color: #3c4a5a;
    background: #f7f9fc;
    border-radius: 12px;
    padding: 12px 14px;
    margin: 10px 0 16px;
    white-space: pre-wrap;
    word-break: break-word;
}

/* ===== 有序点选验证码 ===== */
.click-captcha-prompt{font-size:14px;font-weight:600;color:#22314a;margin:10px 0 8px;text-align:center;}
.click-captcha-prompt b{display:inline-block;color:#007AFF;font-size:18px;margin:0 3px;}
.click-captcha-wrap{position:relative;display:block;max-width:420px;margin:0 auto;cursor:crosshair;border-radius:10px;overflow:hidden;box-shadow:0 2px 10px rgba(0,0,0,.08);}
.click-captcha-wrap img{display:block;width:100%;max-width:420px;height:auto;user-select:none;-webkit-user-drag:none;pointer-events:none;}
.click-captcha-markers{position:absolute;left:0;top:0;right:0;bottom:0;pointer-events:none;}
.click-marker{position:absolute;transform:translate(-50%,-50%);width:24px;height:24px;border-radius:50%;background:#007AFF;color:#fff;font-size:13px;line-height:24px;text-align:center;box-shadow:0 1px 5px rgba(0,0,0,.35);}
.click-captcha-tip{font-size:12px;color:#6b7a8f;text-align:center;margin-top:8px;line-height:1.5;}

/* ==== 点选验证码提示区：模仿商业验证码的小号字符 + 彩色乱线涂鸦 ==== */
.click-captcha-prompt{position:relative;display:flex;align-items:center;gap:10px;min-height:40px;margin:10px 0 8px;padding:2px 4px;font-size:13px;font-weight:600;color:#22314a;text-align:left;overflow:hidden;}
.click-captcha-prompt .cc-label{white-space:nowrap;flex:0 0 auto;opacity:.9;}
.click-captcha-prompt .cc-chars{position:relative;z-index:2;display:inline-flex;gap:12px;padding:2px 6px;flex:0 0 auto;}
.click-captcha-prompt .cc-char{font-size:17px;font-weight:700;color:#111a26;line-height:1;font-family:"SimHei","Microsoft YaHei",sans-serif;text-shadow:0 1px 0 rgba(255,255,255,.7);}
.click-captcha-prompt .cc-doodle{position:absolute;right:-4px;top:50%;transform:translateY(-50%);width:210px;max-width:72%;height:38px;z-index:1;pointer-events:none;opacity:.95;}

/* ==== 滑动拼图验证码 ==== */
#slideCaptchaArea{display:none;margin-top:4px;}
.slide-captcha-prompt{font-size:14px;font-weight:600;color:#22314a;text-align:center;margin:10px 0 8px;}
.slide-captcha-wrap{position:relative;display:block;max-width:420px;margin:0 auto;border-radius:10px;overflow:hidden;border:1px solid #e2e8f0;background:#0b1020;}
.slide-captcha-wrap img{display:block;width:100%;max-width:420px;height:auto;user-select:none;-webkit-user-drag:none;pointer-events:none;}
#slideCaptchaPiece{position:absolute;left:0;top:0;width:0;height:0;pointer-events:none;filter:drop-shadow(0 2px 4px rgba(0,0,0,.35));}
.slide-track{position:relative;max-width:420px;height:44px;margin:12px auto 4px;background:#eef2f7;border-radius:8px;border:1px solid #dbe4ef;overflow:hidden;}
.slide-track-fill{position:absolute;left:0;top:0;height:100%;width:0;background:#dbeafe;}
.slide-handle{position:absolute;left:0;top:0;width:44px;height:44px;display:flex;align-items:center;justify-content:center;background:#fff;border:1px solid #cbd5e1;border-radius:8px;cursor:grab;font-size:18px;color:#2563eb;user-select:none;touch-action:none;z-index:2;}
.slide-handle:active{cursor:grabbing;}
.slide-track-text{position:absolute;left:0;right:0;top:0;height:100%;display:flex;align-items:center;justify-content:center;font-size:12px;color:#94a3b8;pointer-events:none;}
/* 弹窗层级高于页面浮动按钮 */
.modal-overlay{z-index:100000 !important;}
.toast{z-index:100001 !important;}

/* 修复：全局 .modal-box img 的 max-height/margin/border 会把验证码图片压扁、导致拼块上下错位 */
.click-captcha-wrap img,
.slide-captcha-wrap img{
    margin:0 !important;
    border:none !important;
    border-radius:0 !important;
    max-height:none !important;
    background:transparent !important;
}
