/* ==========================================================================
   独立手机端（/mobile/）的壳样式
   只有启动屏与登录屏，业务页面仍在 /m 下用自己的 mobile.css。
   ========================================================================== */

:root {
    --ink: #e9eff6;
    --ink-2: #9fb0c3;
    --ink-3: #6b7d91;
    --line: rgba(148, 163, 184, .18);
    --brand: #14b8a6;
    --brand-2: #0d9488;
    --bg: #0b1119;
    --bg-2: #101a25;
    --danger: #f87171;
    --radius: 16px;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body {
    margin: 0;
    padding: 0;
    min-height: 100%;
}

body {
    background: radial-gradient(120% 80% at 50% 0%, #16303a 0%, var(--bg) 46%, #070c12 100%) fixed;
    color: var(--ink);
    font: 15px/1.6 -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Segoe UI", sans-serif;
    -webkit-font-smoothing: antialiased;
    padding: env(safe-area-inset-top, 0px) env(safe-area-inset-right, 0px) env(safe-area-inset-bottom, 0px) env(safe-area-inset-left, 0px);
    overscroll-behavior-y: none;
}

/* ---------------------------------------------------------------- 启动屏 */
.boot {
    position: fixed;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 24px;
    text-align: center;
    animation: boot-in .35s ease both;
}

@keyframes boot-in {
    from { opacity: 0; transform: scale(.985); }
    to { opacity: 1; transform: none; }
}

.boot-glow {
    position: absolute;
    width: 320px;
    height: 320px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(20, 184, 166, .22), transparent 68%);
    filter: blur(10px);
    animation: glow 3.2s ease-in-out infinite;
}

@keyframes glow {
    0%, 100% { opacity: .75; transform: scale(1); }
    50% { opacity: 1; transform: scale(1.06); }
}

.boot-mark {
    position: relative;
    width: 104px;
    height: 104px;
    border-radius: 26px;
    overflow: hidden;
    box-shadow: 0 18px 46px rgba(0, 0, 0, .46), 0 0 0 1px rgba(255, 255, 255, .07);
    animation: mark-in .6s cubic-bezier(.2, .9, .3, 1.05) both;
}

.boot-mark img { display: block; width: 100%; height: 100%; }

@keyframes mark-in {
    from { opacity: 0; transform: translateY(14px) scale(.9); }
    to { opacity: 1; transform: none; }
}

.boot-name {
    position: relative;
    margin-top: 14px;
    font-size: 20px;
    font-weight: 700;
    letter-spacing: .5px;
}

.boot-sub {
    position: relative;
    color: var(--ink-2);
    font-size: 13px;
}

.boot-bar {
    position: relative;
    width: 132px;
    height: 3px;
    margin-top: 18px;
    border-radius: 99px;
    background: rgba(148, 163, 184, .18);
    overflow: hidden;
}

.boot-bar i {
    display: block;
    width: 42%;
    height: 100%;
    border-radius: 99px;
    background: linear-gradient(90deg, var(--brand-2), var(--brand));
    animation: bar 1.25s cubic-bezier(.6, 0, .4, 1) infinite;
}

@keyframes bar {
    0% { transform: translateX(-110%); }
    100% { transform: translateX(340%); }
}

.boot-tip {
    position: relative;
    margin-top: 10px;
    color: var(--ink-3);
    font-size: 12px;
}

/* 离线时把启动屏让出来 */
body.is-offline .boot { opacity: .2; filter: blur(2px); pointer-events: none; }

.offline-card {
    position: fixed;
    left: 18px;
    right: 18px;
    top: 50%;
    transform: translateY(-50%);
    z-index: 5;
    padding: 20px;
    border-radius: 18px;
    background: rgba(23, 33, 45, .96);
    border: 1px solid var(--line);
    box-shadow: 0 22px 60px rgba(0, 0, 0, .5);
    animation: boot-in .3s ease both;
}

.offline-card[hidden] { display: none; }
.offline-card b { display: block; font-size: 16px; margin-bottom: 6px; }
.offline-card p { margin: 0 0 12px; color: var(--ink-2); font-size: 13px; }
.offline-card .oc-num { font-size: 12.5px; color: #fbbf24; margin-bottom: 14px; }

/* 离线卡片默认不显示，只有断网时才由 body.is-offline 打开 */
body.is-offline .offline-card { display: block !important; }

/* ---------------------------------------------------------------- 登录 */
.login {
    max-width: 480px;
    margin: 0 auto;
    padding: 34px 20px calc(28px + env(safe-area-inset-bottom, 0px));
    animation: boot-in .4s ease both;
}

.login-head {
    display: flex;
    align-items: center;
    gap: 13px;
    margin-bottom: 14px;
}

.login-mark {
    width: 62px;
    height: 62px;
    border-radius: 17px;
    overflow: hidden;
    flex: 0 0 auto;
    box-shadow: 0 12px 30px rgba(0, 0, 0, .38), 0 0 0 1px rgba(255, 255, 255, .07);
}

.login-mark img { display: block; width: 100%; height: 100%; }

.login-head h1 {
    margin: 0;
    font-size: 21px;
    font-weight: 700;
    letter-spacing: .3px;
}

.login-head p {
    margin: 2px 0 0;
    color: var(--ink-2);
    font-size: 12.5px;
}

.login-slogan {
    margin: 0 0 20px;
    color: var(--ink-2);
    font-size: 13.5px;
    line-height: 1.7;
}

.login-err {
    margin-bottom: 14px;
    padding: 10px 13px;
    border-radius: 11px;
    background: rgba(248, 113, 113, .12);
    border: 1px solid rgba(248, 113, 113, .34);
    color: #fca5a5;
    font-size: 13px;
}

.login-form {
    display: grid;
    gap: 12px;
    margin-bottom: 20px;
}

.lf { display: grid; gap: 6px; }

.lf span {
    font-size: 12px;
    color: var(--ink-3);
    padding-left: 2px;
}

.lf input {
    height: 50px;
    padding: 0 15px;
    border-radius: 13px;
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, .04);
    color: var(--ink);
    font-size: 16px;          /* ≥16px 才不会在 iOS 上自动放大 */
    outline: none;
    transition: border-color .16s, box-shadow .16s, background .16s;
}

.lf input::placeholder { color: #5b6c80; }

.lf input:focus {
    border-color: var(--brand);
    background: rgba(20, 184, 166, .07);
    box-shadow: 0 0 0 3px rgba(20, 184, 166, .16);
}

.btn-primary,
.btn-ghost {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 50px;
    border-radius: 13px;
    border: 0;
    font-size: 15.5px;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    font-family: inherit;
}

.btn-primary {
    margin-top: 4px;
    background: linear-gradient(135deg, var(--brand-2), var(--brand));
    color: #041412;
    box-shadow: 0 10px 26px rgba(20, 184, 166, .3);
}

.btn-primary:active { transform: scale(.985); }

.btn-ghost {
    margin-top: 10px;
    background: transparent;
    border: 1px solid var(--line);
    color: var(--ink-2);
    font-size: 13.5px;
    font-weight: 500;
    height: 44px;
}

.btn-lg { width: 100%; }

/* 演示账号 */
.demo {
    padding: 15px 14px 13px;
    border-radius: var(--radius);
    background: rgba(255, 255, 255, .035);
    border: 1px solid var(--line);
    margin-bottom: 18px;
}

.demo-title {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 11px;
    font-size: 12.5px;
    color: var(--ink-2);
    flex-wrap: wrap;
}

.demo-title span { color: var(--ink-3); font-size: 11.5px; }

.demo-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
    margin: 0;
}

.demo-grid button {
    display: grid;
    gap: 1px;
    padding: 9px 10px;
    text-align: left;
    border-radius: 11px;
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, .045);
    color: var(--ink);
    font-family: inherit;
    cursor: pointer;
    transition: border-color .15s, background .15s;
}

.demo-grid button:active {
    border-color: var(--brand);
    background: rgba(20, 184, 166, .12);
}

.demo-grid b { font-size: 12.5px; font-weight: 600; }
.demo-grid small { color: var(--ink-3); font-size: 10.5px; line-height: 1.45; }

.login-foot {
    display: flex;
    justify-content: center;
    gap: 18px;
    padding-top: 4px;
}

.login-foot a {
    color: var(--ink-3);
    font-size: 12.5px;
    text-decoration: none;
}

.login-foot a:active { color: var(--brand); }

.login-tip {
    margin: 16px 0 0;
    text-align: center;
    color: #4d5d70;
    font-size: 11.5px;
    line-height: 1.6;
}

/* 桌面浏览器打开时给一句提示（不拦着，只是别说没提醒） */
@media (min-width: 820px) {
    body.is-login .login { padding-top: 8vh; }
    body::after {
        content: "这是手机端入口。电脑上看完整工作台请用桌面版 / 或把下面地址生成二维码用手机扫。";
        display: block;
        position: fixed;
        left: 0;
        right: 0;
        bottom: 0;
        padding: 9px 16px;
        background: #12202c;
        color: var(--ink-2);
        font-size: 12px;
        text-align: center;
        border-top: 1px solid var(--line);
    }
}
