:root {
    --bg: #0a0d12;
    --surface: #141922;
    --surface-2: #1b2230;
    --border: #262f3f;
    --text: #e8ecf3;
    --muted: #8d97a8;
    --muted-2: #626d7e;
    --green: #22c55e;
    --green-2: #16a34a;
    --green-bg: rgba(34, 197, 94, 0.12);
    --red: #ef4444;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
                 "Microsoft YaHei", "Hiragino Sans GB", sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

[data-icon] { display: inline-flex; align-items: center; justify-content: center; }
[data-icon] svg { width: 1em; height: 1em; display: block; }

.rm-page {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 28px 18px;
    position: relative;
    overflow: hidden;
}
.rm-glow {
    position: absolute;
    top: -180px;
    left: 50%;
    transform: translateX(-50%);
    width: 720px;
    height: 420px;
    background: radial-gradient(ellipse at center, rgba(34, 197, 94, 0.16), transparent 65%);
    pointer-events: none;
}

.rm-card {
    position: relative;
    width: 100%;
    max-width: 460px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 18px;
    padding: 32px 28px;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.45);
}

.rm-brand { display: flex; align-items: center; gap: 14px; margin-bottom: 26px; }
.rm-logo { width: 52px; height: 52px; border-radius: 13px; border: 1px solid var(--border); }
.rm-brand h1 { font-size: 18px; font-weight: 700; letter-spacing: 0.2px; }
.rm-sub { color: var(--muted); font-size: 12.5px; margin-top: 2px; }

.rm-label { display: block; font-size: 12.5px; color: var(--muted); margin-bottom: 8px; }

.rm-input-wrap {
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 0 16px;
    transition: border-color 0.15s, box-shadow 0.15s;
}
.rm-input-wrap:focus-within {
    border-color: var(--green);
    box-shadow: 0 0 0 3px var(--green-bg);
}
.rm-ico { color: var(--muted-2); font-size: 18px; }
.rm-input-wrap input {
    flex: 1;
    background: transparent;
    border: none;
    outline: none;
    color: var(--text);
    font-size: 19px;
    letter-spacing: 3px;
    padding: 15px 0;
    font-family: ui-monospace, "SF Mono", Consolas, monospace;
    text-transform: uppercase;
}
.rm-input-wrap input::placeholder { color: #3d4757; letter-spacing: 2px; }

.rm-btn {
    width: 100%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 16px;
    padding: 13px;
    border: none;
    border-radius: 12px;
    background: var(--green-2);
    color: #fff;
    font-size: 15.5px;
    font-weight: 700;
    cursor: pointer;
    font-family: inherit;
    transition: background 0.15s, transform 0.1s;
    position: relative;
    overflow: hidden;
}
.rm-btn::after {
    content: "";
    position: absolute;
    top: 0;
    left: -120%;
    width: 55%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.4), transparent);
    transform: skewX(-22deg);
    animation: rmShine 3.8s ease-in-out infinite;
    pointer-events: none;
}
@keyframes rmShine {
    0%, 55% { left: -120%; }
    78%, 100% { left: 150%; }
}

/* 成功粒子 */
.rm-particle {
    position: fixed;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    pointer-events: none;
    z-index: 300;
    animation: rmBurst 1.05s cubic-bezier(0.15, 0.7, 0.3, 1) forwards;
}
@keyframes rmBurst {
    0% { transform: translate(0, 0) scale(1); opacity: 1; }
    100% { transform: translate(var(--dx), var(--dy)) scale(0.2); opacity: 0; }
}

/* logo 呼吸 */
.rm-logo { animation: rmBreathe 4.5s ease-in-out infinite; }
@keyframes rmBreathe {
    0%, 100% { box-shadow: 0 0 0 0 rgba(34,197,94,0); }
    50% { box-shadow: 0 0 24px 3px rgba(34,197,94,0.38); }
}
.rm-btn:hover { background: var(--green); }
.rm-btn:active { transform: translateY(1px); }
.rm-btn:disabled { opacity: 0.6; cursor: not-allowed; }
.rm-btn [data-icon] { font-size: 17px; }
.rm-btn-ghost {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--muted);
    font-size: 13.5px;
    padding: 10px;
    margin-top: 18px;
}
.rm-btn-ghost:hover { background: var(--surface-2); color: var(--text); }

.rm-msg {
    min-height: 20px;
    margin-top: 10px;
    font-size: 13px;
    text-align: center;
    color: var(--red);
}
.rm-msg.ok { color: var(--green); }

/* 结果 */
.rm-result { animation: rmIn 0.3s ease; }
@keyframes rmIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

.rm-result-head { display: flex; align-items: center; gap: 12px; margin-bottom: 20px; }
.rm-ok-ico { color: var(--green); font-size: 30px; }
.rm-result-title { font-size: 17px; font-weight: 700; }
.rm-result-sub { color: var(--muted); font-size: 12.5px; }

.rm-acct {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 6px 16px;
}
.rm-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 11px 0;
    border-bottom: 1px solid var(--border);
}
.rm-row:last-child { border-bottom: none; }
.rm-key { color: var(--muted-2); font-size: 12.5px; width: 42px; flex-shrink: 0; }
.rm-val {
    flex: 1;
    font-family: ui-monospace, "SF Mono", Consolas, monospace;
    font-size: 15.5px;
    font-weight: 600;
    word-break: break-all;
}
.rm-copy {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    font-size: 12px;
    border: 1px solid var(--border);
    border-radius: 7px;
    background: var(--surface-2);
    color: var(--muted);
    cursor: pointer;
    font-family: inherit;
    transition: color 0.15s, border-color 0.15s, background 0.15s;
    flex-shrink: 0;
}
.rm-copy [data-icon] { font-size: 12px; }
.rm-copy:hover { color: var(--green); border-color: rgba(34, 197, 94, 0.4); background: var(--green-bg); }

.rm-tip {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    margin-top: 16px;
    padding: 11px 13px;
    background: var(--green-bg);
    border: 1px solid rgba(34, 197, 94, 0.25);
    border-radius: 10px;
    color: var(--muted);
    font-size: 12.5px;
}
.rm-tip [data-icon] { color: var(--green); font-size: 15px; margin-top: 1px; }

.rm-foot {
    position: relative;
    margin-top: 22px;
    color: var(--muted-2);
    font-size: 12px;
    text-align: center;
}

#toast {
    position: fixed;
    left: 50%;
    bottom: 40px;
    transform: translateX(-50%) translateY(20px);
    background: var(--surface-2);
    border: 1px solid #333c4d;
    color: var(--text);
    padding: 9px 18px;
    border-radius: 9px;
    font-size: 13px;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s, transform 0.25s;
    z-index: 200;
}
#toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

@media (max-width: 480px) {
    .rm-card { padding: 26px 20px; }
    .rm-brand h1 { font-size: 16.5px; }
    .rm-input-wrap input { font-size: 17px; letter-spacing: 2px; }
    .rm-logo { width: 46px; height: 46px; }
}
