/* ============================================================
   登录验证机制演示 · 样式
   ============================================================ */
:root {
    --blue: #3973ff;
    --blue-d: #2a5fe0;
    --ink: #16203a;
    --muted: #6a7a99;
    --line: #e3e9f4;
    --bg: #eef3fb;
    --ok: #22a06b;
    --err: #e5534b;
}

* { box-sizing: border-box; }

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

body {
    font: 14px/1.6 -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
    color: var(--ink);
    background:
        radial-gradient(1200px 600px at 10% -10%, #dbe8ff 0%, rgba(219, 232, 255, 0) 60%),
        radial-gradient(900px 500px at 100% 0%, #e6f0ff 0%, rgba(230, 240, 255, 0) 55%),
        var(--bg);
    -webkit-font-smoothing: antialiased;
}

a { color: var(--blue); text-decoration: none; }

/* ------------------------------ 顶部品牌条 ------------------------------ */
.topbar {
    position: sticky;
    top: 0;
    z-index: 20;
    display: flex;
    align-items: center;
    gap: 12px;
    height: 56px;
    padding: 0 28px;
    background: rgba(255, 255, 255, .82);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(227, 233, 244, .9);
}

.topbar .mark {
    display: grid;
    place-items: center;
    width: 30px;
    height: 30px;
    border-radius: 9px;
    background: linear-gradient(140deg, #4b86ff, #2a5fe0);
    color: #fff;
    font-weight: 700;
    font-size: 13px;
    letter-spacing: .5px;
    box-shadow: 0 6px 14px rgba(57, 115, 255, .35);
}

.topbar .name { font-weight: 600; letter-spacing: .2px; }
.topbar .spacer { flex: 1; }
.topbar .tag {
    font-size: 12px;
    color: var(--muted);
    border: 1px solid var(--line);
    border-radius: 999px;
    padding: 3px 10px;
    background: #fff;
}

/* ------------------------------ 主体布局 ------------------------------ */
.wrap {
    max-width: 1120px;
    margin: 0 auto;
    padding: 36px 24px 80px;
}

.hero {
    display: grid;
    grid-template-columns: 1.05fr .95fr;
    gap: 28px;
    align-items: stretch;
}

/* 左侧介绍 */
.intro {
    position: relative;
    overflow: hidden;
    border-radius: 20px;
    padding: 34px 34px 30px;
    color: #eaf1ff;
    background:
        radial-gradient(600px 300px at 90% -10%, rgba(93, 140, 255, .55), transparent 60%),
        linear-gradient(150deg, #101a33 0%, #16264a 55%, #12203c 100%);
    box-shadow: 0 20px 50px rgba(16, 30, 60, .18);
}

.intro::after {
    content: "yx2";
    position: absolute;
    right: -6px;
    bottom: -38px;
    font-size: 150px;
    font-weight: 800;
    letter-spacing: -6px;
    color: rgba(255, 255, 255, .045);
    pointer-events: none;
}

.intro h1 {
    margin: 6px 0 10px;
    font-size: 26px;
    line-height: 1.35;
    letter-spacing: .3px;
}

.intro p.lead {
    margin: 0 0 22px;
    color: #9fb3d8;
    font-size: 13.5px;
}

.intro .kicker {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: #9ec0ff;
    border: 1px solid rgba(120, 165, 255, .35);
    background: rgba(70, 120, 230, .12);
    padding: 4px 10px;
    border-radius: 999px;
}

.feats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-top: 6px;
}

.feat {
    border: 1px solid rgba(140, 175, 255, .18);
    background: rgba(255, 255, 255, .04);
    border-radius: 12px;
    padding: 12px 12px 11px;
}

.feat b { display: block; font-size: 13px; color: #dbe7ff; font-weight: 600; }
.feat span { font-size: 12px; color: #8ba3c9; }

.intro .foot {
    margin-top: 22px;
    padding-top: 16px;
    border-top: 1px dashed rgba(140, 175, 255, .2);
    font-size: 12px;
    color: #8399bd;
    display: flex;
    gap: 14px;
    flex-wrap: wrap;
}

/* 右侧登录卡 */
.card {
    background: #fff;
    border-radius: 20px;
    padding: 30px 30px 26px;
    box-shadow: 0 18px 45px rgba(23, 43, 84, .10);
    border: 1px solid rgba(227, 233, 244, .8);
    display: flex;
    flex-direction: column;
}

.card h2 { margin: 0 0 4px; font-size: 19px; }
.card .sub { margin: 0 0 22px; color: var(--muted); font-size: 12.5px; }

.field { margin-bottom: 14px; }
.field label { display: block; font-size: 12px; color: var(--muted); margin-bottom: 6px; }

.input {
    display: flex;
    align-items: center;
    gap: 10px;
    height: 44px;
    padding: 0 12px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: #fbfcfe;
    transition: border-color .15s, box-shadow .15s, background .15s;
}

.input:focus-within {
    border-color: var(--blue);
    background: #fff;
    box-shadow: 0 0 0 3px rgba(57, 115, 255, .12);
}

.input input {
    flex: 1;
    border: 0;
    outline: 0;
    background: transparent;
    font-size: 14px;
    color: var(--ink);
}

.input .ico { color: #9dabc4; display: flex; }
.input .eye {
    border: 0;
    background: transparent;
    cursor: pointer;
    color: #9dabc4;
    font-size: 12px;
    padding: 4px;
}

#captcha-slot { margin: 6px 0 16px; min-height: 44px; }

.btn {
    height: 44px;
    border: 0;
    border-radius: 10px;
    background: linear-gradient(180deg, #4b86ff, #3973ff);
    color: #fff;
    font-size: 15px;
    font-weight: 600;
    letter-spacing: 2px;
    cursor: pointer;
    box-shadow: 0 10px 22px rgba(57, 115, 255, .28);
    transition: transform .12s, box-shadow .12s, filter .12s;
}

.btn:hover { filter: brightness(1.04); }
.btn:active { transform: translateY(1px); }
.btn[disabled] { background: #c3cfe4; box-shadow: none; cursor: not-allowed; }

.form-msg {
    min-height: 20px;
    margin-top: 10px;
    font-size: 12.5px;
    color: var(--err);
}
.form-msg.ok { color: var(--ok); }

.hintline {
    margin-top: auto;
    padding-top: 16px;
    border-top: 1px dashed var(--line);
    font-size: 12px;
    color: var(--muted);
    display: flex;
    justify-content: space-between;
    gap: 10px;
    flex-wrap: wrap;
}

.hintline code {
    background: #f2f6fd;
    border: 1px solid var(--line);
    border-radius: 6px;
    padding: 1px 6px;
    color: #2f4a7a;
}

/* ------------------------------ 流程 & 日志 ------------------------------ */
.section-title {
    display: flex;
    align-items: baseline;
    gap: 10px;
    margin: 44px 0 16px;
}

.section-title h3 { margin: 0; font-size: 16px; }
.section-title span { color: var(--muted); font-size: 12px; }

.flow {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 10px;
}

.step {
    position: relative;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 14px;
    padding: 14px 13px 12px;
    min-height: 104px;
}

.step em {
    font-style: normal;
    display: inline-grid;
    place-items: center;
    width: 22px;
    height: 22px;
    border-radius: 7px;
    background: #eef4ff;
    color: var(--blue);
    font-size: 12px;
    font-weight: 700;
    margin-bottom: 8px;
}

.step b { display: block; font-size: 13px; margin-bottom: 4px; }
.step span { font-size: 11.5px; color: var(--muted); line-height: 1.5; display: block; }

/* 协议日志 */
.console {
    background: #0d1729;
    border-radius: 16px;
    border: 1px solid #1c2b45;
    overflow: hidden;
    box-shadow: 0 16px 40px rgba(12, 24, 45, .18);
}

.console .bar {
    display: flex;
    align-items: center;
    gap: 8px;
    height: 38px;
    padding: 0 14px;
    background: #101d33;
    border-bottom: 1px solid #1c2b45;
    color: #7f95b5;
    font-size: 12px;
}

.console .dot { width: 9px; height: 9px; border-radius: 50%; background: #334a6d; }
.console .dot.r { background: #ff5f57; }
.console .dot.y { background: #febc2e; }
.console .dot.g { background: #28c840; }
.console .bar .spacer { flex: 1; }

.console pre {
    margin: 0;
    padding: 14px 16px;
    height: 230px;
    overflow: auto;
    font: 12px/1.7 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    color: #b9c9e3;
    white-space: pre-wrap;
    word-break: break-all;
}

.console pre .t { color: #5d7396; }
.console pre .out { color: #7fb2ff; }
.console pre .in { color: #6fd39a; }
.console pre .err { color: #ff8f86; }
.console pre .k { color: #d8b4ff; }

/* ------------------------------ 验证组件（gt-*） ------------------------------ */
.gt-root {
    position: relative;
    width: 100%;
    max-width: 362px;
    user-select: none;
}

.gt-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    height: 44px;
    padding: 0 14px;
    border-radius: 8px;
    background: linear-gradient(180deg, #eef2f8, #e4eaf4);
    border: 1px solid #dde5f1;
    cursor: pointer;
    color: #4b5b78;
    font-size: 13.5px;
    transition: border-color .15s, background .15s;
}

.gt-bar:hover { border-color: #c9d6ea; background: linear-gradient(180deg, #f2f6fc, #e9eff8); }

.gt-bar-ico { color: #7d90b0; display: flex; }
.gt-bar-text { flex: 1; }
.gt-bar-logo {
    font-size: 11px;
    color: #9fb0c9;
    letter-spacing: 1px;
    font-weight: 700;
}

.gt-root[data-state="success"] .gt-bar {
    background: #ecf9f2;
    border-color: #bfe8d4;
    color: #1d8f5f;
}

.gt-root[data-state="success"] .gt-bar-ico { color: #22a06b; }

/* 展开面板 */
.gt-box {
    overflow: hidden;
    max-height: 0;
    transition: max-height .28s ease, margin .28s ease;
    margin-top: 0;
}

.gt-root.gt-open .gt-box {
    max-height: 420px;
    margin-top: 10px;
}

.gt-panel {
    border: 1px solid #e1e8f3;
    border-radius: 10px;
    background: #fff;
    box-shadow: 0 10px 28px rgba(25, 45, 85, .10);
    padding: 10px;
}

.gt-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 2px 2px 8px;
}

.gt-title { font-size: 12.5px; color: #4c5c78; }

.gt-head-btns { display: flex; gap: 2px; }

.gt-refresh {
    border: 0;
    background: transparent;
    color: #8fa1bd;
    cursor: pointer;
    padding: 3px;
    border-radius: 6px;
    display: grid;
    place-items: center;
}

.gt-refresh:hover { background: #f1f5fb; color: var(--blue); }

.gt-stage {
    position: relative;
    width: 340px;
    max-width: 100%;
    aspect-ratio: 340 / 212;
    height: auto;
    border-radius: 8px;
    overflow: hidden;
    background: #eef2f8;
}

.gt-bg { display: block; width: 100%; height: 100%; }

.gt-piece {
    position: absolute;
    left: 0;
    display: none;
    width: 70px;
    height: 60px;
    filter: drop-shadow(0 6px 10px rgba(20, 40, 80, .35));
    pointer-events: none;
    will-change: transform;
}

.gt-marks {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.gt-foot { padding-top: 10px; }

.gt-slider {
    position: relative;
    display: none;
    align-items: center;
    height: 40px;
    border-radius: 8px;
    background: #f4f7fc;
    border: 1px solid #e2e9f4;
    overflow: hidden;
}

.gt-slider-tip {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    font-size: 12px;
    color: #9aa9c1;
    pointer-events: none;
}

.gt-slider-fill {
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 22px;
    background: rgba(57, 115, 255, .12);
    pointer-events: none;
}

.gt-thumb {
    position: relative;
    z-index: 2;
    width: 42px;
    height: 38px;
    margin-left: 1px;
    display: grid;
    place-items: center;
    border-radius: 7px;
    background: #fff;
    border: 1px solid #dfe6f2;
    box-shadow: 0 2px 6px rgba(30, 55, 100, .14);
    color: #4c5c78;
    cursor: grab;
    touch-action: none;
}

.gt-thumb:active { cursor: grabbing; }
.gt-thumb-ico { font-size: 15px; }

.gt-msg {
    min-height: 18px;
    padding-top: 6px;
    font-size: 12px;
    color: #8fa1bd;
}

.gt-msg-error { color: var(--err); }
.gt-msg-ok { color: var(--ok); }

.gt-root.gt-busy .gt-bar { opacity: .75; }

@keyframes gt-shake {
    0%, 100% { transform: translateX(0); }
    20% { transform: translateX(-6px); }
    40% { transform: translateX(6px); }
    60% { transform: translateX(-4px); }
    80% { transform: translateX(4px); }
}

.gt-root.gt-shake { animation: gt-shake .45s ease; }

.gt-root.gt-floating {
    position: fixed;
    right: 24px;
    bottom: 24px;
    z-index: 999;
}

/* 题型切换（演示用） */
.type-switch {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin: 2px 0 14px;
}

.type-switch button {
    border: 1px solid var(--line);
    background: #fff;
    color: #5b6b88;
    border-radius: 999px;
    padding: 4px 11px;
    font-size: 12px;
    cursor: pointer;
    transition: all .15s;
}

.type-switch button:hover { border-color: #c9d6ea; }

.type-switch button.on {
    background: #eef4ff;
    border-color: #b9cdf8;
    color: var(--blue);
    font-weight: 600;
}

/* 登录后的欢迎页 */
.welcome {
    max-width: 720px;
    margin: 60px auto;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 18px;
    padding: 32px;
    box-shadow: 0 18px 45px rgba(23, 43, 84, .08);
}

.welcome h1 { margin: 0 0 6px; font-size: 22px; }
.welcome .muted { color: var(--muted); font-size: 13px; }

.kv {
    margin: 22px 0;
    border: 1px solid var(--line);
    border-radius: 12px;
    overflow: hidden;
}

.kv div {
    display: grid;
    grid-template-columns: 160px 1fr;
    gap: 12px;
    padding: 10px 14px;
    font-size: 13px;
    border-bottom: 1px solid var(--line);
}

.kv div:last-child { border-bottom: 0; }
.kv div > span:first-child { color: var(--muted); }
.kv code { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 12px; color: #2f4a7a; }

@media (max-width: 900px) {
    .hero { grid-template-columns: 1fr; }
    .flow { grid-template-columns: repeat(2, 1fr); }
    .intro::after { display: none; }
}

@media (max-width: 480px) {
    .wrap { padding: 20px 14px 60px; }
    .card, .intro { padding: 22px 18px; }
    .hero { gap: 16px; }
    .gt-root { max-width: 100%; }
    .gt-stage { width: 100%; }
    .feats { grid-template-columns: 1fr; }
}
