/* 冒险岛世界账号管理器（PHP 版）样式 */

:root {
    --primary: #1976d2;
    --primary-dark: #1259a3;
    --danger: #c62828;
    --danger-dark: #a01f1f;
    --safe: #2e7d32;
    --banned: #c62828;
    --bg: #f4f6f9;
    --card: #ffffff;
    --border: #e0e4ea;
    --text: #26303a;
    --muted: #7a8794;
    --hover: #eef4fb;
}

* { box-sizing: border-box; }

html, body {
    margin: 0; padding: 0; height: 100%;
    background: var(--bg); color: var(--text);
    font-family: "Microsoft YaHei", "微软雅黑", "PingFang SC", "Helvetica Neue", Arial, sans-serif;
    font-size: 13px;
}

/* ── 顶栏 ───────────────────────────── */
.topbar {
    display: flex; align-items: center; justify-content: space-between;
    height: 52px; padding: 0 18px;
    background: linear-gradient(90deg, #1976d2, #2196f3);
    color: #fff;
    box-shadow: 0 2px 6px rgba(0,0,0,.12);
}
.brand { display: flex; align-items: center; gap: 8px; font-size: 16px; font-weight: 700; letter-spacing: .5px; }
.brand .logo { font-size: 18px; }
.brand .ver {
    font-size: 11px; font-weight: 500; padding: 2px 7px; border-radius: 10px;
    background: rgba(255,255,255,.22);
}
.topinfo { font-size: 12px; opacity: .95; }

/* ── 工具栏 ─────────────────────────── */
.toolbar {
    display: flex; align-items: center; justify-content: space-between;
    flex-wrap: wrap; gap: 8px;
    padding: 10px 14px; background: var(--card);
    border-bottom: 1px solid var(--border);
}
.toolbar .group { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.toolbar .group.right { margin-left: auto; }
.divider { width: 1px; height: 20px; background: var(--border); margin: 0 4px; }

.btn {
    padding: 6px 12px; border: 1px solid var(--border); border-radius: 5px;
    background: #fff; color: var(--text); cursor: pointer;
    font-family: inherit; font-size: 12.5px; transition: all .15s;
    white-space: nowrap;
}
.btn:hover { background: var(--hover); border-color: #b9c6d6; }
.btn:active { transform: translateY(1px); }
.btn.primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn.primary:hover { background: var(--primary-dark); border-color: var(--primary-dark); }
.btn.danger { background: #fff; border-color: #e6b8b8; color: var(--danger); }
.btn.danger:hover { background: #fdeaea; border-color: var(--danger); }
.btn.small { padding: 4px 9px; font-size: 12px; }
.btn.icon { padding: 6px 9px; font-size: 14px; line-height: 1; }

.search {
    padding: 6px 10px; width: 240px; border: 1px solid var(--border);
    border-radius: 5px; font-family: inherit; font-size: 12.5px; outline: none;
}
.search:focus { border-color: var(--primary); box-shadow: 0 0 0 2px rgba(25,118,210,.12); }
.select {
    padding: 6px 8px; min-width: 110px; border: 1px solid var(--border);
    border-radius: 5px; font-family: inherit; font-size: 12.5px; background: #fff; outline: none;
}
.ship { display: flex; align-items: center; gap: 4px; font-size: 12.5px; cursor: pointer; user-select: none; }
.ship input { cursor: pointer; }

/* ── 表格 ───────────────────────────── */
.table-wrap {
    margin: 12px; background: var(--card); border: 1px solid var(--border);
    border-radius: 7px; overflow: auto; box-shadow: 0 1px 3px rgba(0,0,0,.05);
    max-height: calc(100vh - 210px);
}
table { width: 100%; border-collapse: collapse; }
thead th {
    position: sticky; top: 0; z-index: 2;
    background: #eef2f7; color: #42505f; font-weight: 600; font-size: 12.5px;
    padding: 9px 8px; text-align: center; white-space: nowrap;
    border-bottom: 1px solid var(--border); cursor: pointer; user-select: none;
}
thead th:hover { background: #e3ebf5; }
thead th.col-check { width: 38px; cursor: default; }
tbody td {
    padding: 8px; text-align: center; border-bottom: 1px solid #f0f2f5;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 220px;
}
tbody tr:hover { background: var(--hover); }
tbody tr.selected { background: #e3f2fd; }
tbody tr.selected:hover { background: #d6ebfb; }
tbody td.mono { font-family: Consolas, "Courier New", monospace; font-size: 12.5px; }
td.secret { color: var(--muted); letter-spacing: 1px; cursor: pointer; }
td.secret.revealed { color: var(--text); letter-spacing: 0; }
td .copy-btn {
    margin-left: 5px; padding: 1px 5px; font-size: 11px; border-radius: 3px;
    border: 1px solid var(--border); background: #fff; cursor: pointer; color: var(--muted);
}
td .copy-btn:hover { color: var(--primary); border-color: var(--primary); }
td.remarks-cell { max-width: 200px; }
.empty { padding: 40px; text-align: center; color: var(--muted); }

/* 状态标签 */
.tag { display: inline-block; padding: 2px 9px; border-radius: 10px; font-size: 11.5px; font-weight: 600; }
.tag-normal { background: #e8eef5; color: #4a5b6d; }
.tag-safe   { background: #e6f4ea; color: var(--safe); }
.tag-banned { background: #fdeaea; color: var(--banned); }
/* 封号但解封时间已过 → 黄色“已解封” */
.tag-unbanned { background: #fff3cd; color: #8a5a00; border: 1px solid #f0d08a; }

/* ── 多用户：角色相关显隐 ─────────────── */
/* 仅管理员可见的列 / 按钮 / 表单项 */
body.is-user .col-admin { display: none !important; }
/* 仅普通用户可见的说明文字 */
body.is-admin .user-only { display: none !important; }

/* 顶栏用户信息 */
.userbar { display: flex; align-items: center; gap: 10px; font-size: 12.5px; color: #4a5b6d; }
.userbar .who b { color: var(--text); }
.userbar .stat { color: var(--muted); margin-right: 4px; }
.role-tag {
    display: inline-block; margin-left: 4px; padding: 1px 7px; border-radius: 9px;
    font-size: 11px; background: #e8eef5; color: #4a5b6d;
}
.role-tag.admin { background: #e8f0fe; color: var(--primary); font-weight: 700; }

/* 初始密码警告条 */
.warnbar {
    background: #fff4e5; border-bottom: 1px solid #f3d5a8; color: #8a5a00;
    padding: 8px 18px; font-size: 12.5px;
}

/* 用户管理 */
.user-add { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.user-add input, .user-add select {
    padding: 6px 9px; border: 1px solid var(--border); border-radius: 5px;
    font-family: inherit; font-size: 12.5px; outline: none; background: #fff;
}
.user-add input { flex: 1; min-width: 150px; }
.user-table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.user-table th {
    background: #eef2f7; color: #42505f; font-weight: 600; font-size: 12px;
    padding: 7px; border-bottom: 1px solid var(--border); text-align: center;
}
.user-table td { padding: 7px; border-bottom: 1px solid #f0f2f5; text-align: center; }
.user-table td:nth-child(7) { text-align: left; }

/* ── 登录页 ───────────────────────────── */
body.login-page {
    display: flex; align-items: center; justify-content: center;
    background: linear-gradient(135deg, #e9eff7 0%, #f6f8fb 100%);
}
.login-card {
    width: 360px; max-width: 92vw; background: #fff; border-radius: 12px;
    box-shadow: 0 14px 44px rgba(20,32,48,.16); padding: 30px 28px 22px;
}
.login-brand { text-align: center; margin-bottom: 22px; }
.login-brand .logo { font-size: 34px; }
.login-brand h1 { margin: 6px 0 4px; font-size: 17px; color: #2c3948; }
.login-brand p { margin: 0; font-size: 12px; }
.login-field { display: block; margin-bottom: 13px; }
.login-field span { display: block; margin-bottom: 5px; font-size: 12px; color: #5a6773; }
.login-field input {
    width: 100%; padding: 9px 11px; border: 1px solid var(--border); border-radius: 6px;
    font-family: inherit; font-size: 13.5px; outline: none; background: #fff;
}
.login-field input:focus { border-color: var(--primary); box-shadow: 0 0 0 2px rgba(25,118,210,.12); }
.login-card .err {
    min-height: 18px; margin-bottom: 8px; color: var(--danger);
    font-size: 12px; text-align: center;
}
.btn.block { width: 100%; padding: 10px; font-size: 14px; font-weight: 600; }
.btn:disabled { opacity: .6; cursor: not-allowed; }
.login-tip { margin: 16px 0 0; text-align: center; font-size: 11.5px; color: var(--muted); }

/* ── 状态栏 ─────────────────────────── */
.statusbar {
    position: fixed; left: 0; right: 0; bottom: 0; height: 28px;
    display: flex; align-items: center; justify-content: space-between;
    padding: 0 14px; background: #eef2f7; border-top: 1px solid var(--border);
    color: #55636f; font-size: 12px;
}
.statusbar .right { color: var(--muted); }

/* ── 弹窗 ───────────────────────────── */
.modal {
    position: fixed; inset: 0; background: rgba(20,28,38,.45);
    display: none; align-items: center; justify-content: center; z-index: 100;
}
.modal.show { display: flex; }
.modal-box {
    background: #fff; border-radius: 9px; width: 620px; max-width: 94vw;
    max-height: 88vh; display: flex; flex-direction: column;
    box-shadow: 0 12px 40px rgba(0,0,0,.25); animation: pop .16s ease-out;
}
.modal-box.wide { width: 780px; }
@keyframes pop { from { transform: scale(.97); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.modal-head {
    display: flex; align-items: center; justify-content: space-between;
    padding: 13px 16px; border-bottom: 1px solid var(--border);
    font-size: 14.5px; font-weight: 700; color: #2c3948;
}
.modal-head .close {
    border: none; background: none; font-size: 22px; line-height: 1;
    cursor: pointer; color: var(--muted); padding: 0 4px;
}
.modal-head .close:hover { color: var(--danger); }
.modal-body { padding: 16px; overflow: auto; }
.modal-foot {
    display: flex; justify-content: flex-end; gap: 8px;
    padding: 12px 16px; border-top: 1px solid var(--border); background: #fafbfc;
    border-radius: 0 0 9px 9px;
}

/* 表单 */
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 14px; }
.form-grid label { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: #5a6773; }
.form-grid label.full { grid-column: 1 / -1; }
.form-grid input, .form-grid select, .form-grid textarea {
    padding: 7px 9px; border: 1px solid var(--border); border-radius: 5px;
    font-family: inherit; font-size: 13px; color: var(--text); outline: none; background: #fff;
}
.form-grid input:focus, .form-grid select:focus, .form-grid textarea:focus {
    border-color: var(--primary); box-shadow: 0 0 0 2px rgba(25,118,210,.12);
}
.hint { margin: 0 0 12px; font-size: 12px; color: #61707e; line-height: 1.7; }
.hint.dim { color: var(--muted); font-size: 11.5px; }

/* 旧版迁移：文件上传区 */
.upload-grid { display: grid; grid-template-columns: 1fr; gap: 12px; margin-bottom: 12px; }
.upload-grid label {
    display: flex; flex-direction: column; gap: 5px;
    font-size: 12px; color: #5a6773;
    border: 1px dashed var(--border); border-radius: 7px; padding: 10px 12px; background: #fafbfd;
}
.upload-grid label span code { background: #eef2f7; padding: 1px 5px; border-radius: 3px; font-family: Consolas, monospace; }
.upload-grid input[type=file] {
    font-family: inherit; font-size: 12.5px; color: var(--text);
    padding: 4px 0; cursor: pointer;
}
.upload-grid input[type=file]::file-selector-button {
    margin-right: 10px; padding: 6px 12px; border: 1px solid var(--border); border-radius: 5px;
    background: #fff; color: #3d4a58; font-family: inherit; font-size: 12.5px; cursor: pointer;
}
.upload-grid input[type=file]::file-selector-button:hover { background: #eef3f9; border-color: var(--primary); }
.migrate-status {
    margin-top: 2px; min-height: 18px; font-size: 12px; color: #61707e;
    padding: 7px 10px; border-radius: 5px; background: #f4f7fa;
}
.migrate-status:empty { display: none; }
.migrate-status.err { background: #fdecec; color: var(--danger); }
.migrate-status.ok { background: #e9f7ee; color: #1b7a3d; }
.hint code { background: #f1f4f8; padding: 1px 5px; border-radius: 3px; font-family: Consolas, monospace; }
.dim { color: var(--muted); }
textarea {
    width: 100%; border: 1px solid var(--border); border-radius: 5px; padding: 9px;
    font-family: Consolas, "Courier New", monospace; font-size: 12.5px; resize: vertical; outline: none;
}
textarea:focus { border-color: var(--primary); }

/* 详情 */
.detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 16px; margin-bottom: 14px; }
.detail-item {
    display: flex; align-items: center; gap: 8px; padding: 7px 10px;
    background: #f7f9fb; border: 1px solid #eaeef3; border-radius: 5px; font-size: 12.5px;
}
.detail-item .k { color: var(--muted); min-width: 62px; }
.detail-item .v { flex: 1; word-break: break-all; font-weight: 600; }
.detail-item .v.mono { font-family: Consolas, monospace; font-weight: 500; }
.detail-item .cp {
    border: 1px solid var(--border); background: #fff; border-radius: 3px;
    padding: 2px 6px; font-size: 11px; cursor: pointer; color: var(--muted);
}
.detail-item .cp:hover { color: var(--primary); border-color: var(--primary); }

/* 2FA 令牌面板 */
.token-panel {
    border: 1px solid #d6e4f5; border-radius: 8px; background: linear-gradient(180deg, #f7fbff, #fff);
    overflow: hidden;
}
.token-head {
    display: flex; align-items: center; justify-content: space-between;
    padding: 8px 12px; background: #e9f2fc; border-bottom: 1px solid #d6e4f5;
    font-weight: 700; font-size: 13px; color: #1c5a99;
}
.badge-local {
    font-size: 11px; font-weight: 500; padding: 2px 8px; border-radius: 10px;
    background: #d5eccf; color: #2e7d32;
}
.token-body { padding: 14px; }
.token-code {
    font-family: Consolas, "Courier New", monospace; font-size: 46px; font-weight: 700;
    letter-spacing: 8px; color: var(--primary); text-align: center; padding: 6px 0 12px;
    user-select: all;
}
.token-meta { display: flex; align-items: center; justify-content: center; gap: 20px; }
.ring-wrap { position: relative; width: 56px; height: 56px; }
.ring { width: 56px; height: 56px; transform: rotate(-90deg); }
.ring-bg { fill: none; stroke: #e3ebf5; stroke-width: 4; }
.ring-fg {
    fill: none; stroke: var(--primary); stroke-width: 4; stroke-linecap: round;
    stroke-dasharray: 106.8; stroke-dashoffset: 0; transition: stroke-dashoffset .95s linear;
}
.ring-text {
    position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
    font-size: 15px; font-weight: 700; color: var(--primary);
}
.token-side { display: flex; flex-direction: column; gap: 7px; align-items: flex-start; }
.token-msg { font-size: 12px; color: #5a6773; }

/* 导入预览 */
.import-result { margin-top: 12px; max-height: 240px; overflow: auto; }
.import-result table { font-size: 12px; }
.import-result th, .import-result td { padding: 5px 7px; text-align: center; }
.err-list { color: var(--danger); font-size: 12px; margin-top: 8px; line-height: 1.7; }
.ok-line { color: var(--safe); font-size: 12.5px; margin-bottom: 8px; font-weight: 600; }

/* Toast */
.toast {
    position: fixed; left: 50%; bottom: 52px; transform: translateX(-50%) translateY(20px);
    background: rgba(38,48,58,.94); color: #fff; padding: 9px 20px; border-radius: 20px;
    font-size: 13px; opacity: 0; pointer-events: none; transition: all .22s; z-index: 300;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast.error { background: rgba(198,40,40,.95); }
.toast.success { background: rgba(46,125,50,.95); }
