/* ============================================================
 * 绑定管理（教师/家长 ↔ 学生）—— 网页端唯一样式
 *
 * 由 index.html（主界面）与 game.html（游戏中心）共用。
 * 原先两个模板各内联一份 .bind-* 样式并已开始分叉（字号、圆角、
 * hover 动效都不同），且 bind.js 新增的 .bind-source-tag /
 * .bind-scan-video 两端都没有定义。抽到本文件后同一套类在两个
 * 页面表现完全一致。
 *
 * 依赖宿主页已定义的变量：--accent / --accent-light / --accent-glow
 *   --card-bg / --border / --text / --text-secondary / --bg
 *   --shadow / --wrong / --wrong-bg
 * ============================================================ */

/* ---------- 顶部操作区 ---------- */
.bind-actions {
    display: flex;
    gap: 8px;
    justify-content: center;
    flex-wrap: wrap;
    margin-top: 10px;
}
.bind-btn {
    border: none;
    border-radius: 999px;
    padding: 9px 18px;
    font-size: 13px;
    font-family: inherit;
    cursor: pointer;
    font-weight: 700;
    color: #fff;
    background: linear-gradient(135deg, var(--accent), var(--accent-light));
    box-shadow: var(--shadow);
    transition: transform 0.15s;
}
.bind-btn:hover { transform: translateY(-1px); }
.bind-btn:disabled { transform: none; }
.bind-btn.ghost {
    color: var(--accent);
    background: var(--card-bg);
    border: 1.5px solid var(--accent);
}

/* ---------- 我的待用代号（二维码 + 复制 + 倒计时） ---------- */
.bind-pending-card {
    background: var(--card-bg);
    border-radius: 12px;
    padding: 12px 14px;
    box-shadow: var(--shadow);
    margin-top: 10px;
    display: flex;
    align-items: center;
    gap: 12px;
}
.bind-pending-info { flex: 1; min-width: 0; }
.bind-code-text {
    font-family: 'Cascadia Mono', Consolas, 'Courier New', monospace;
    font-size: 17px;
    font-weight: 800;
    letter-spacing: 1px;
    color: var(--accent);
    cursor: pointer;
}
.bind-cd { font-size: 11px; color: var(--text-secondary); margin-top: 3px; }
.bind-cd.urgent { color: var(--wrong); font-weight: 700; }
.bind-qr {
    width: 74px; height: 74px;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: #fff;
    cursor: zoom-in;
    flex-shrink: 0;
}

/* ---------- 列表（我绑定的 / 绑定我的） ---------- */
.bind-subtabs {
    display: flex;
    gap: 6px;
    justify-content: center;
    margin-top: 12px;
}
.bind-list-card {
    background: var(--card-bg);
    border-radius: 12px;
    padding: 6px 12px;
    box-shadow: var(--shadow);
    margin-top: 10px;
}
.bind-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 4px;
    border-bottom: 1px solid var(--border);
    font-size: 13px;
}
.bind-row:last-child { border-bottom: none; }
.bind-avatar {
    width: 36px; height: 36px;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 14px; font-weight: 800; color: #fff;
    flex-shrink: 0;
}
.bind-info { flex: 1; min-width: 0; }
.bind-name {
    font-weight: 700;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    display: block;
}
.bind-role-tag {
    display: inline-block;
    font-size: 10px;
    padding: 1px 6px;
    border-radius: 8px;
    background: var(--accent-glow);
    color: var(--accent);
    margin-left: 6px;
    font-weight: 700;
}
/* 来源标签：标明这条关系是管理员配的（区别于自己扫码绑的）。
   仅是来历标注，不限制操作——两种来源都能自行解除。 */
.bind-source-tag {
    display: inline-block;
    font-size: 10px;
    padding: 1px 6px;
    border-radius: 8px;
    background: var(--bg);
    color: var(--text-secondary);
    border: 1px solid var(--border);
    margin-left: 5px;
    font-weight: 700;
}
.bind-meta { font-size: 11px; color: var(--text-secondary); margin-top: 2px; }
.bind-unbind {
    border: 1px solid var(--wrong);
    background: var(--wrong-bg);
    color: var(--wrong);
    border-radius: 999px;
    padding: 5px 12px;
    font-size: 12px;
    font-family: inherit;
    cursor: pointer;
    flex-shrink: 0;
}
.bind-unbind:hover { background: var(--wrong); color: #fff; }

/* ---------- 生成代号 / 输入代号弹窗 ---------- */
.bind-code-input {
    font-family: 'Cascadia Mono', Consolas, 'Courier New', monospace;
    font-size: 20px !important;
    letter-spacing: 3px;
    text-align: center;
    text-transform: uppercase;
}
.bind-gen-result { text-align: center; }
.bind-gen-code {
    font-family: 'Cascadia Mono', Consolas, 'Courier New', monospace;
    font-size: 30px;
    font-weight: 800;
    letter-spacing: 4px;
    color: var(--accent);
    margin: 8px 0 2px;
    cursor: pointer;
}
.bind-gen-qr {
    width: 190px; height: 190px;
    max-width: 100%;
    border-radius: 12px;
    border: 1px solid var(--border);
    margin: 12px auto 4px;
    display: block;
    background: #fff;
}
.bind-hint {
    font-size: 11px;
    color: var(--text-secondary);
    margin-top: 8px;
    line-height: 1.6;
}
.bind-scan-btn {
    width: 100%;
    border: 1.5px dashed var(--accent);
    background: var(--accent-glow);
    color: var(--accent);
    border-radius: 10px;
    padding: 10px;
    font-size: 13px;
    font-family: inherit;
    cursor: pointer;
    font-weight: 700;
}
/* 网页端扫码取景框 */
.bind-scan-video {
    width: 100%;
    max-width: 320px;
    border-radius: 12px;
    background: #000;
    display: block;
    margin: 0 auto;
}
