:root {
    --bg: #0a0f1e;
    --text: #e9eefb;
    --muted: #94a2bf;
    --border: rgba(255, 255, 255, .12);
    --accent: #4f8cff;
    --accent-2: #22d3ee;
    --radius: 14px;
}

* { box-sizing: border-box; }

html, body { height: 100%; }

body {
    margin: 0;
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 32px 20px;
    color: var(--text);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
                 "Hiragino Sans GB", "Microsoft YaHei", Roboto, Helvetica, Arial, sans-serif;
    background:
        radial-gradient(900px 520px at 12% -12%, rgba(79, 140, 255, .28), transparent 62%),
        radial-gradient(820px 520px at 112% 112%, rgba(34, 211, 238, .20), transparent 62%),
        var(--bg);
    -webkit-font-smoothing: antialiased;
}

/* 背景网格纹理 */
body::before {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    background-image:
        linear-gradient(rgba(255, 255, 255, .04) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, .04) 1px, transparent 1px);
    background-size: 44px 44px;
    -webkit-mask-image: radial-gradient(circle at 50% 38%, #000, transparent 72%);
    mask-image: radial-gradient(circle at 50% 38%, #000, transparent 72%);
}

::selection { background: rgba(79, 140, 255, .38); }

/* ---------- 卡片 ---------- */
.card {
    position: relative;
    width: 100%;
    max-width: 720px;
    padding: 34px 32px 26px;
    border-radius: 22px;
    border: 1px solid var(--border);
    background: linear-gradient(180deg, rgba(255, 255, 255, .075), rgba(255, 255, 255, .03));
    box-shadow:
        0 32px 70px -24px rgba(0, 0, 0, .85),
        inset 0 1px 0 rgba(255, 255, 255, .09);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    animation: rise .55s cubic-bezier(.22, 1, .36, 1) both;
}

@keyframes rise {
    from { opacity: 0; transform: translateY(14px); }
    to   { opacity: 1; transform: none; }
}

/* ---------- 头部（改成左右分栏：标题 + 登录入口） ---------- */
.head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 26px;
    flex-wrap: wrap;
}

.logo {
    flex: none;
    width: 54px;
    height: 54px;
    display: grid;
    place-items: center;
    border-radius: 16px;
    font-size: 15px;
    font-weight: 800;
    letter-spacing: .5px;
    color: #fff;
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
    box-shadow: 0 12px 26px -10px rgba(79, 140, 255, .95);
}

h1 {
    margin: 0;
    font-size: 25px;
    font-weight: 700;
    letter-spacing: -.4px;
}

h1 .ok {
    background: linear-gradient(90deg, var(--accent), var(--accent-2));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.sub {
    margin: 5px 0 0;
    font-size: 13px;
    color: var(--muted);
}

/* ---------- 登录 / 注册入口按钮 ---------- */
.btn-login {
    flex: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 9px 16px;
    border-radius: 10px;
    border: 1px solid var(--border);
    background: rgba(255, 255, 255, .055);
    color: var(--text);
    font-size: 13.5px;
    font-weight: 600;
    text-decoration: none;
    white-space: nowrap;
    transition: transform .18s ease, background .18s ease,
                border-color .18s ease, box-shadow .18s ease;
}

.btn-login svg {
    flex: none;
    opacity: .85;
    transition: transform .18s ease, opacity .18s ease;
}

.btn-login:hover {
    transform: translateY(-2px);
    background: rgba(79, 140, 255, .14);
    border-color: rgba(79, 140, 255, .55);
    box-shadow: 0 12px 26px -16px rgba(79, 140, 255, .9);
}

.btn-login:hover svg {
    transform: translateX(2px);
    opacity: 1;
}

.btn-login:active {
    transform: translateY(0);
}

/* 已登录状态（后端接入后自动生效，JS 会加上这个类） */
.btn-login.is-logged {
    color: #d5f7e0;
    background: rgba(52, 211, 153, .12);
    border-color: rgba(52, 211, 153, .45);
}

.btn-login.is-logged:hover {
    background: rgba(52, 211, 153, .2);
    border-color: rgba(52, 211, 153, .7);
}

/* ---------- 按钮区域 ---------- */
.actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 13px;
    margin-top: 22px;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    padding: 14px 22px;
    border-radius: 12px;
    border: 1px solid transparent;
    font-size: 15px;
    font-weight: 600;
    text-decoration: none;
    white-space: nowrap;
    transition: transform .18s ease, box-shadow .18s ease,
                background .18s ease, border-color .18s ease;
}

.btn svg { flex: none; opacity: .9; }

.btn-primary {
    color: #fff;
    background: linear-gradient(135deg, #4f8cff, #2563eb);
    box-shadow: 0 14px 28px -14px rgba(79, 140, 255, 1);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 20px 34px -14px rgba(79, 140, 255, 1);
}

.btn-ghost {
    color: var(--text);
    background: rgba(255, 255, 255, .055);
    border-color: var(--border);
}

.btn-ghost:hover {
    transform: translateY(-2px);
    background: rgba(255, 255, 255, .1);
    border-color: rgba(255, 255, 255, .22);
}

.btn:active { transform: translateY(0); }

/* ---------- 推流地址 ---------- */
.publish {
    margin: 0;
    padding: 18px;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    background: rgba(0, 0, 0, .28);
}

.label {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 11px;
    font-size: 11.5px;
    font-weight: 700;
    letter-spacing: .1em;
    text-transform: uppercase;
    color: var(--muted);
}

.label::before {
    content: "";
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--accent-2);
    box-shadow: 0 0 10px var(--accent-2);
}

.code-wrap {
    display: flex;
    align-items: stretch;
    gap: 10px;
}

.code {
    flex: 1 1 auto;
    margin: 0;
    padding: 14px 16px;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, .09);
    background: #060a15;
    color: #7fe3ff;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
    font-size: 13.5px;
    line-height: 1.5;
    white-space: pre;
    overflow-x: auto;
}

.code::-webkit-scrollbar { height: 8px; }
.code::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, .16);
    border-radius: 4px;
}

.copy {
    flex: none;
    min-width: 84px;
    padding: 0 16px;
    border-radius: 10px;
    border: 1px solid var(--border);
    background: rgba(255, 255, 255, .06);
    color: var(--text);
    font-family: inherit;
    font-size: 13.5px;
    font-weight: 600;
    cursor: pointer;
    transition: background .18s ease, color .18s ease, border-color .18s ease;
}

.copy:hover { background: rgba(255, 255, 255, .12); }

.copy.copied {
    color: #06210f;
    background: #34d399;
    border-color: #34d399;
}

.hint {
    margin: 13px 0 0;
    font-size: 13px;
    line-height: 1.75;
    color: var(--muted);
}

.hint a {
    color: var(--accent-2);
    text-decoration: none;
    border-bottom: 1px solid rgba(34, 211, 238, .35);
    transition: border-color .18s ease;
}

.hint a:hover { border-bottom-color: var(--accent-2); }

/* ---------- 页脚 ---------- */
footer {
    margin-top: 26px;
    padding-top: 18px;
    border-top: 1px solid var(--border);
    text-align: center;
    font-size: 13px;
    color: var(--muted);
}

footer a {
    color: var(--muted);
    text-decoration: none;
    transition: color .18s ease;
}

footer a:hover { color: var(--text); }

/* ---------- 商标SRS底部 ---------- */
.footer-brand {
    display: inline-block;
    margin-top: 17px;
    font-size: 12px;
    color: var(--muted);
    text-decoration: none;
    transition: color .18s ease;
}
.footer-brand:hover { color: var(--text); }

/* 版本号：小字号、低对比度，不抢视线 */
.version {
    margin-top: 8px;
    font-size: 11px;
    line-height: 1.4;
    letter-spacing: .3px;
    color: rgba(148, 162, 191, .55);
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    user-select: text;
}

/* ---------- 备案信息 ---------- */
.beian {
    margin-top: 14px;
    padding-top: 14px;
    border-top: 1px solid var(--border);
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 10px 20px;
    font-size: 12px;
    color: var(--muted);
}

.beian a {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--muted);
    text-decoration: none;
    transition: color .18s ease;
}

.beian a:hover { color: var(--text); }

.beian img {
    display: block;
    width: 20.67px;
    height: 16.75px;
    object-fit: contain;
}

/* ---------- 响应式 ---------- */
@media (max-width: 560px) {
    .card { padding: 26px 20px 20px; border-radius: 18px; }
    .head { gap: 13px; margin-bottom: 22px; }
    .logo { width: 46px; height: 46px; border-radius: 13px; font-size: 13px; }
    h1 { font-size: 21px; }
    .btn-login { font-size: 12.5px; padding: 8px 13px; }
    .actions { flex-direction: column; }
    .btn { width: 100%; }
    .code-wrap { flex-direction: column; }
    .copy { padding: 11px 16px; }
    .code { font-size: 12.5px; }
}

@media (prefers-reduced-motion: reduce) {
    * { animation: none !important; transition: none !important; }
}