/* poolshare 矿池分成台样式 —— 复用 rigmgr 深色主题，少量新增导航/对话框/图表样式 */

:root {
    --bg: #0f1115;
    --panel: #161a21;
    --panel-2: #1b2029;
    --border: #262c38;
    --border-hi: #333b4a;
    --text: #e6e8ee;
    --muted: #8b93a5;
    --accent: #3d8bfd;
    --green: #34c759;
    --red: #ff453a;
    --amber: #ffd60a;
    --radius: 10px;
}

* { box-sizing: border-box; }

html, body {
    margin: 0; padding: 0;
    background: var(--bg); color: var(--text);
    font-family: system-ui, -apple-system, "Segoe UI", "Microsoft YaHei", sans-serif;
    font-size: 14px; line-height: 1.6;
}
body { min-height: 100vh; }

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ---------------- 顶栏 + 导航 ---------------- */
.top {
    display: flex; align-items: center; gap: 14px;
    padding: 12px 20px;
    background: var(--panel);
    border-bottom: 1px solid var(--border);
    position: sticky; top: 0; z-index: 20;
}
.top h1 { font-size: 16px; margin: 0; font-weight: 600; letter-spacing: .3px; white-space: nowrap; }
.top > .sm { white-space: nowrap; flex: none; }
.top .spacer { flex: 1; }
.top .who { color: var(--muted); font-size: 13px; }

.topnav {
    display: flex; gap: 4px; flex-wrap: wrap;
    padding: 8px 20px;
    background: var(--panel-2);
    border-bottom: 1px solid var(--border);
    position: sticky; top: 49px; z-index: 19;
}
.topnav a {
    color: var(--muted); padding: 5px 12px; border-radius: 7px; font-size: 13px;
}
.topnav a:hover { background: #232936; color: var(--text); text-decoration: none; }
.topnav a.active { background: #1c3a63; color: #cfe3ff; }

.wrap { max-width: 1280px; margin: 0 auto; padding: 20px; }
.muted { color: var(--muted); font-size: 13px; }

/* ---------------- 区块 / 卡片 ---------------- */
.sec { margin-bottom: 26px; }
.sec > h2 {
    font-size: 15px; font-weight: 600; margin: 0 0 12px;
    display: flex; align-items: center; gap: 10px;
}
.sec > h2 .cnt { color: var(--muted); font-weight: 400; font-size: 13px; }
.sec > h2 .spacer { flex: 1; }

.grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 14px;
}
.card {
    background: var(--panel); border: 1px solid var(--border);
    border-radius: var(--radius); padding: 14px;
}
.card h3 { margin: 0 0 10px; font-size: 14px; color: var(--muted); font-weight: 500; }
.card .big { font-size: 26px; font-weight: 700; letter-spacing: .3px; }
.card .sub { color: var(--muted); font-size: 12.5px; margin-top: 2px; }
.kv { display: grid; grid-template-columns: 84px 1fr; gap: 4px 10px; font-size: 13px; margin-top: 8px; }
.kv .k { color: var(--muted); }
.kv .v { overflow: hidden; text-overflow: ellipsis; word-break: break-all; }
.mono { font-family: ui-monospace, Consolas, monospace; font-size: 12.5px; }

/* ---------------- 按钮 / 输入 ---------------- */
button, .btn {
    font: inherit; cursor: pointer;
    border: 1px solid var(--border-hi); background: var(--panel-2); color: var(--text);
    border-radius: 7px; padding: 6px 12px;
    transition: background .12s, border-color .12s, opacity .12s; white-space: nowrap;
}
button:hover:not(:disabled), .btn:hover { background: #232936; border-color: #46506440; }
button:disabled { opacity: .45; cursor: not-allowed; }
button.primary { background: #1c3a63; border-color: #2c5c9c; color: #cfe3ff; }
button.primary:hover:not(:disabled) { background: #22466f; }
button.ok { background: #143d24; border-color: #246b3c; color: #b8f0c8; }
button.ok:hover:not(:disabled) { background: #18502f; }
button.danger { background: #3d1a19; border-color: #7a2b26; color: #ffc4c0; }
button.danger:hover:not(:disabled) { background: #4d201e; }
button.sm { padding: 4px 9px; font-size: 13px; border-radius: 6px; }
/* 顶栏「公开主页」入口：用锚点当小按钮（对齐 button.sm 的观感） */
a.sm {
    display: inline-block; padding: 4px 9px; font-size: 13px; border-radius: 6px;
    background: #1c2431; border: 1px solid var(--border-hi); color: var(--text);
}
a.sm:hover { background: #232936; border-color: #46506440; text-decoration: none; }

input[type=text], input[type=password], input[type=number], select, textarea {
    font: inherit; background: #0e1116; color: var(--text);
    border: 1px solid var(--border-hi); border-radius: 7px;
    padding: 7px 10px; width: 100%;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); }
textarea { resize: vertical; font-family: ui-monospace, Consolas, monospace; font-size: 12.5px; }
label { display: block; color: var(--muted); font-size: 13px; margin-bottom: 4px; }
.field { margin-bottom: 12px; }
.row { display: flex; gap: 10px; align-items: flex-end; flex-wrap: wrap; }
.row > .field { flex: 1; min-width: 140px; margin-bottom: 0; }

/* ---------------- 表格 ---------------- */
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { text-align: left; padding: 7px 10px; border-bottom: 1px solid var(--border); vertical-align: top; }
th { color: var(--muted); font-weight: 500; white-space: nowrap; }
tr:last-child td { border-bottom: none; }
.panel {
    background: var(--panel); border: 1px solid var(--border);
    border-radius: var(--radius); padding: 14px; overflow-x: auto;
}
.st { font-size: 12px; padding: 1px 7px; border-radius: 5px; }
.st.pending { background: #2a2f3a; color: #c3cad9; }
.st.paid    { background: #12351f; color: #7ee0a0; }
.st.taken   { background: #3a3312; color: #ffe066; }
.st.ok      { background: #12351f; color: #7ee0a0; }
.st.failed  { background: #3d1a19; color: #ff9d95; }
.st.rejected{ background: #33203d; color: #d9a6ff; }

/* 账号表里的「按币种分行」：一行里叠 PRL / QTC 两小行 */
.crow {
    display: flex; align-items: center; gap: 6px;
    line-height: 1.75; white-space: nowrap;
}
.crow + .crow { margin-top: 1px; }
.ctag {
    flex: none;
    font-size: 10px; font-weight: 600; letter-spacing: .4px;
    padding: 0 4px; border-radius: 4px;
    background: #222836; color: #93a0b8;
    border: 1px solid var(--border);
}

.badge { font-size: 12px; padding: 2px 8px; border-radius: 20px; border: 1px solid transparent; white-space: nowrap; }
.badge.on  { background: #12351f; color: #7ee0a0; border-color: #1f5c37; }
.badge.off { background: #2a2f3a; color: #9aa3b5; border-color: #3a4152; }
.badge.warn{ background: #3a3312; color: #ffe066; border-color: #6b5c1f; }

/* ---------------- 提示条 ---------------- */
#toast {
    position: fixed; right: 18px; bottom: 18px; z-index: 100;
    display: flex; flex-direction: column; gap: 8px; max-width: 420px;
}
#toast .t {
    background: var(--panel-2); border: 1px solid var(--border-hi);
    border-left-width: 3px; border-radius: 8px; padding: 9px 13px;
    font-size: 13px; box-shadow: 0 6px 22px rgba(0,0,0,.45);
    animation: tin .18s ease-out;
}
#toast .t.ok   { border-left-color: var(--green); }
#toast .t.err  { border-left-color: var(--red); }
#toast .t.info { border-left-color: var(--accent); }
@keyframes tin { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* ---------------- 登录页 ---------------- */
.login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 20px; }
.login-box { width: 100%; max-width: 360px; background: var(--panel); border: 1px solid var(--border); border-radius: 14px; padding: 26px; }
.login-box h1 { font-size: 18px; margin: 0 0 4px; }
.login-box .sub { color: var(--muted); font-size: 13px; margin-bottom: 20px; }
.login-box button { width: 100%; padding: 9px; margin-top: 6px; }
.login-err { color: #ff9d95; font-size: 13px; min-height: 20px; margin-top: 8px; }
.login-foot { text-align: center; color: var(--muted); font-size: 12.5px; margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--border); }

/* ---------------- 对话框 ---------------- */
dialog.dlg, dialog { background: var(--panel); color: var(--text); border: 1px solid var(--border-hi); border-radius: 12px; padding: 0; width: 94%; max-width: 560px; }
dialog::backdrop { background: rgba(0,0,0,.55); }
.dlg { padding: 18px 20px; }
.dlg h3 { margin: 0 0 14px; font-size: 16px; }
.dlg-foot { display: flex; gap: 8px; align-items: center; margin-top: 14px; }
.dlg-foot .spacer { flex: 1; }
.dlg-foot .err { color: #ff9d95; font-size: 13px; }

/* ---------------- 7 日收益柱状图 ---------------- */
.chart-bars { display: flex; align-items: flex-end; gap: 10px; height: 180px; padding-top: 10px; }
.chart-bars .bar { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; height: 100%; justify-content: flex-end; }
.chart-bars .bar .col { width: 70%; background: linear-gradient(180deg, var(--accent), #1c3a63); border-radius: 5px 5px 0 0; min-height: 2px; transition: height .3s; }
.chart-bars .bar .lab { color: var(--muted); font-size: 11px; }
.chart-bars .bar .val { color: var(--text); font-size: 11px; }

.empty { color: var(--muted); padding: 18px; text-align: center; }
.err { color: #ff9d95; }
code { background: #0e1116; padding: 1px 5px; border-radius: 4px; font-size: 12px; }

/* ---------------- 中转监控：两条中转并排 ---------------- */
.relay-coin { margin-bottom: 40px; }
.relay-coin + .relay-coin { border-top: 1px solid var(--border); padding-top: 30px; }
.relay-head {
    display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
    margin: 0 0 14px; font-size: 16px; font-weight: 600;
}
.relay-head .mono { font-size: 17px; letter-spacing: .2px; }
.relay-head .relay-src { margin-left: auto; font-size: 12px; font-family: ui-monospace, Menlo, Consolas, monospace; }
.relay-grid { margin-bottom: 4px; }
.relay-sub { margin: 24px 0 10px; font-size: 14px; font-weight: 600; color: var(--text); }
.relay-sub .cnt { font-weight: 400; color: var(--muted); font-size: 12.5px; margin-left: 6px; }
.relay-rej { margin: 14px 0 0; font-size: 12.5px; }

/* ---------------- 中转实时 JSON（终端风格） ---------------- */
.json-panel { margin-bottom: 24px; }
.json-head { display: flex; align-items: center; gap: 10px; margin: 0 0 8px; font-size: 13px; }
.json-head .spacer { flex: 1; }
.jsonbox {
    margin: 0; padding: 12px 14px; max-height: 340px; overflow: auto;
    background: #0b0e13; border: 1px solid var(--border); border-radius: 8px;
    font-family: ui-monospace, Menlo, Consolas, "Courier New", monospace;
    font-size: 12px; line-height: 1.55; color: #9fd0ff; white-space: pre;
    tab-size: 2;
}
.json-cmd {
    display: flex; align-items: center; gap: 10px; margin-top: 8px;
    background: var(--panel-2); border: 1px solid var(--border);
    border-radius: 8px; padding: 7px 12px;
}
.json-cmd code {
    flex: 1; background: transparent; color: var(--muted);
    font-size: 12px; white-space: nowrap; overflow-x: auto;
}

@media (max-width: 560px) {
    .grid { grid-template-columns: 1fr; }
    .wrap { padding: 14px; }
    .topnav { top: 49px; }
}


/* ---------- 公告 / 教程 管理页（/posts） ---------- */
#ps-table th:last-child, #ps-table td:last-child { white-space: nowrap; }
#ps-table td { vertical-align: middle; }
#ps-table td .sm + .sm, #ps-table td a.sm + .sm { margin-left: 4px; }


/* ================= 注册页（/register） ================= */
.reg-wrap {
    min-height: 100vh; display: flex; align-items: center; justify-content: center;
    padding: 40px 22px;
    background:
        radial-gradient(900px 520px at 8% -10%, rgba(61,139,253,.16), transparent 62%),
        radial-gradient(760px 480px at 96% 108%, rgba(61,139,253,.10), transparent 60%),
        var(--bg);
}
.reg-grid {
    width: 100%; max-width: 940px;
    display: grid; grid-template-columns: 1fr 396px; gap: 48px; align-items: center;
}

/* 左：品牌 */
.reg-brand .mark {
    width: 46px; height: 46px; border-radius: 13px;
    display: inline-flex; align-items: center; justify-content: center;
    font-size: 16px; font-weight: 700; letter-spacing: .5px; color: #cfe3ff;
    background: linear-gradient(140deg, #1c3a63, #12233d);
    border: 1px solid #2c5c9c; box-shadow: 0 8px 24px rgba(28,58,99,.45);
}
.reg-brand h1 { font-size: 26px; margin: 16px 0 6px; letter-spacing: .3px; }
.reg-brand .lead { color: var(--muted); font-size: 13.5px; margin: 0; }
.reg-feats { list-style: none; padding: 0; margin: 30px 0 0; display: grid; gap: 16px; }
.reg-feats li { display: flex; gap: 12px; align-items: flex-start; font-size: 13px; color: var(--muted); line-height: 1.65; }
.reg-feats li b { color: var(--text); font-weight: 600; }
.reg-feats .dot {
    flex: none; width: 24px; height: 24px; border-radius: 8px; margin-top: 1px;
    display: inline-flex; align-items: center; justify-content: center;
    font-size: 11px; color: var(--accent);
    background: var(--panel-2); border: 1px solid var(--border);
}
.reg-back { margin: 30px 0 0; font-size: 13px; }
.reg-back a { color: var(--muted); }
.reg-back a:hover { color: var(--accent); }

/* 右：表单卡片 */
.reg-box {
    background: var(--panel); border: 1px solid var(--border); border-radius: 16px;
    padding: 28px 26px; box-shadow: 0 20px 60px rgba(0,0,0,.42);
}
.reg-box h2 { margin: 0 0 5px; font-size: 19px; font-weight: 600; }
.reg-box .sub { color: var(--muted); font-size: 12.5px; margin-bottom: 20px; }
.reg-box .hint { color: var(--muted); font-size: 11.5px; margin-top: 5px; line-height: 1.55; }
.reg-box .opt {
    font-size: 11px; font-weight: 400; color: var(--muted);
    border: 1px solid var(--border-hi); border-radius: 5px; padding: 0 5px; margin-left: 4px;
}
.reg-box code { background: #0e1116; color: #b9c4d6; }
.reg-box button.primary { width: 100%; padding: 10px; margin-top: 4px; font-size: 14px; }
.reg-err { color: #ff9d95; font-size: 12.5px; min-height: 18px; margin-top: 10px; opacity: 0; transition: opacity .15s; }
.reg-err.on { opacity: 1; }
.reg-foot { text-align: center; color: var(--muted); font-size: 13px; margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--border); }

@media (max-width: 880px) {
    /* minmax(0,1fr) 是关键：默认 1fr 的 min-width 是 auto，
       输入框/长标题的 min-content 会把网格撑出视口，右侧被裁掉。 */
    .reg-grid { grid-template-columns: minmax(0, 1fr); width: 100%; max-width: 420px; gap: 24px; }
    .reg-brand { text-align: center; }
    .reg-brand h1 { font-size: 22px; margin-top: 12px; }
    .reg-feats, .reg-back { display: none; }
    .reg-box { padding: 24px 20px; max-width: 100%; }
}
