/* ==========================================================================
   导航站现代化主题 (Modern Navigation Theme) — 2026
   替代 2012 年 artDialog/雪碧图风格，采用 CSS 变量 + 玻璃拟态 + 响应式
   ========================================================================== */

:root {
    /* 品牌色板 */
    --c-bg-1: #0a1628;
    --c-bg-2: #0d2137;
    --c-bg-3: #123049;

    --c-primary: #22d3ee;
    --c-primary-dim: #0ea5b7;
    --c-accent: #a78bfa;
    --c-accent-2: #f472b6;
    --c-success: #34d399;
    --c-warn: #fbbf24;
    --c-danger: #f87171;

    --c-text: #e8f1fb;
    --c-text-dim: #94a9c2;
    --c-text-mute: #64798f;

    --c-glass: rgba(255, 255, 255, .06);
    --c-glass-2: rgba(255, 255, 255, .10);
    --c-border: rgba(255, 255, 255, .12);
    --c-border-hi: rgba(34, 211, 238, .45);

    --c-shadow: 0 18px 50px -12px rgba(0, 0, 0, .65);
    --c-shadow-sm: 0 6px 18px -6px rgba(0, 0, 0, .5);

    --r-sm: 10px;
    --r-md: 16px;
    --r-lg: 22px;
    --r-full: 999px;

    --font: "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", system-ui, -apple-system, sans-serif;
    --font-mono: "Cascadia Code", "JetBrains Mono", Consolas, "Courier New", monospace;

    --ease: cubic-bezier(.22, 1, .36, 1);
}

* { box-sizing: border-box; }

html, body {
    height: 100%;
    margin: 0;
    padding: 0;
}

body {
    font-family: var(--font);
    color: var(--c-text);
    background-color: var(--c-bg-1);
    background-image:
        radial-gradient(1100px 620px at 12% -12%, rgba(34, 211, 238, .22), transparent 62%),
        radial-gradient(940px 560px at 92% 8%, rgba(167, 139, 250, .20), transparent 60%),
        radial-gradient(760px 520px at 50% 118%, rgba(244, 114, 182, .14), transparent 62%),
        linear-gradient(165deg, var(--c-bg-1) 0%, var(--c-bg-2) 55%, var(--c-bg-3) 100%);
    background-attachment: fixed;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}

/* 动态网格光效 */
body::before {
    content: "";
    position: fixed;
    inset: -50%;
    background-image:
        linear-gradient(rgba(255, 255, 255, .035) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, .035) 1px, transparent 1px);
    background-size: 56px 56px;
    transform: translateY(0);
    animation: grid-drift 30s linear infinite;
    pointer-events: none;
    z-index: 0;
}

@keyframes grid-drift {
    from { transform: translateY(0); }
    to   { transform: translateY(56px); }
}

h1, h2, h3, h4, div, span, form, table, tr, td, img, button, a, p, ul, li {
    padding: 0;
    margin: 0;
    border: 0;
}

a, a:hover { text-decoration: none; }

input {
    margin: 0;
    font-family: inherit;
}

table { border-collapse: collapse; border-spacing: 0; }

.hidden { display: none !important; }
.clear { width: 1px; clear: both; }

/* ============================ 布局 ============================ */

#outer {
    position: relative;
    z-index: 2;
    width: 100%;
    min-height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 32px 20px 96px;
}

/* 顶部品牌条 */
.topbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 20;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 14px 24px;
    background: linear-gradient(180deg, rgba(10, 22, 40, .78), rgba(10, 22, 40, 0));
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
}

.topbar .brand {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 15px;
    font-weight: 600;
    letter-spacing: .04em;
    color: var(--c-text);
}

.topbar .brand .dot {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: var(--c-success);
    box-shadow: 0 0 0 4px rgba(52, 211, 153, .18);
    animation: pulse-dot 2.4s var(--ease) infinite;
}

@keyframes pulse-dot {
    0%, 100% { box-shadow: 0 0 0 3px rgba(52, 211, 153, .16); }
    50%      { box-shadow: 0 0 0 8px rgba(52, 211, 153, .04); }
}

.topbar .meta {
    font-family: var(--font-mono);
    font-size: 12px;
    color: var(--c-text-mute);
    letter-spacing: .06em;
}

/* ============================ 玻璃卡片 ============================ */

.glass {
    position: relative;
    background: var(--c-glass);
    border: 1px solid var(--c-border);
    border-radius: var(--r-lg);
    box-shadow: var(--c-shadow);
    backdrop-filter: blur(18px) saturate(140%);
    -webkit-backdrop-filter: blur(18px) saturate(140%);
    overflow: hidden;
}

.glass::after {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    background: linear-gradient(140deg, rgba(255, 255, 255, .10), transparent 42%);
}

/* ============================ 登录页 ============================ */

.login-card {
    width: min(460px, 100%);
    padding: 40px 34px 34px;
    animation: rise .7s var(--ease) both;
}

@keyframes rise {
    from { opacity: 0; transform: translateY(24px) scale(.985); }
    to   { opacity: 1; transform: none; }
}

.brand-hero {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
    margin-bottom: 28px;
}

.brand-hero .logo {
    width: 74px;
    height: 74px;
    object-fit: contain;
    filter: drop-shadow(0 8px 22px rgba(34, 211, 238, .45));
    animation: float 4.5s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50%      { transform: translateY(-7px); }
}

.brand-hero h1 {
    font-size: 21px;
    font-weight: 700;
    letter-spacing: .06em;
    background: linear-gradient(92deg, var(--c-primary), var(--c-accent) 55%, var(--c-accent-2));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.brand-hero p {
    font-size: 13px;
    color: var(--c-text-dim);
    letter-spacing: .05em;
}

/* 输入区 */
.field {
    position: relative;
    display: flex;
    align-items: center;
    gap: 10px;
    height: 54px;
    padding: 0 16px;
    border-radius: var(--r-md);
    background: rgba(255, 255, 255, .05);
    border: 1px solid var(--c-border);
    transition: border-color .25s, box-shadow .25s, background .25s;
}

.field:focus-within {
    border-color: var(--c-border-hi);
    background: rgba(255, 255, 255, .08);
    box-shadow: 0 0 0 4px rgba(34, 211, 238, .10);
}

.field .ico {
    flex: 0 0 auto;
    width: 18px;
    height: 18px;
    opacity: .75;
}

.field input {
    flex: 1 1 auto;
    min-width: 0;
    height: 100%;
    border: 0;
    outline: none;
    background: transparent;
    color: var(--c-text);
    font-size: 16px;
    letter-spacing: .12em;
}

.field input::placeholder { color: var(--c-text-mute); letter-spacing: .02em; }

.field .toggle {
    flex: 0 0 auto;
    cursor: pointer;
    border: 0;
    background: transparent;
    color: var(--c-text-mute);
    font-size: 12px;
    letter-spacing: .06em;
    transition: color .2s;
}

.field .toggle:hover { color: var(--c-primary); }

/* 主按钮 */
.btn {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    height: 52px;
    margin-top: 18px;
    border: 0;
    border-radius: var(--r-md);
    cursor: pointer;
    font-family: inherit;
    font-size: 16px;
    font-weight: 700;
    letter-spacing: .16em;
    color: #04202b;
    background: linear-gradient(94deg, var(--c-primary) 0%, #38bdf8 48%, var(--c-accent) 100%);
    box-shadow: 0 12px 30px -10px rgba(34, 211, 238, .65);
    overflow: hidden;
    transition: transform .18s var(--ease), box-shadow .25s, filter .25s;
}

.btn::before {
    content: "";
    position: absolute;
    top: 0;
    bottom: 0;
    width: 45%;
    left: -60%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .55), transparent);
    transform: skewX(-18deg);
    animation: sheen 3.6s var(--ease) infinite;
}

@keyframes sheen {
    0%, 62% { left: -60%; }
    100%    { left: 130%; }
}

.btn:hover { transform: translateY(-2px); box-shadow: 0 18px 40px -12px rgba(34, 211, 238, .8); filter: brightness(1.06); }
.btn:active { transform: translateY(0); }
.btn:disabled { opacity: .6; cursor: not-allowed; transform: none; }

.btn.ghost {
    color: var(--c-text);
    background: rgba(255, 255, 255, .06);
    border: 1px solid var(--c-border);
    box-shadow: none;
    font-weight: 500;
    letter-spacing: .08em;
}

.btn.ghost::before { display: none; }
.btn.ghost:hover { background: rgba(255, 255, 255, .11); border-color: var(--c-border-hi); }

/* 提示 */
.hint {
    margin-top: 16px;
    font-size: 12.5px;
    color: var(--c-text-mute);
    text-align: center;
    line-height: 1.7;
}

.hint .err { color: var(--c-danger); }

/* 浏览器建议 */
.browser-support {
    margin-top: 26px;
    padding-top: 20px;
    border-top: 1px dashed rgba(255, 255, 255, .12);
    display: flex;
    justify-content: center;
    gap: 10px;
    flex-wrap: wrap;
}

.browser-support a {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 13px;
    border-radius: var(--r-full);
    border: 1px solid var(--c-border);
    background: rgba(255, 255, 255, .04);
    color: var(--c-text-dim);
    font-size: 12.5px;
    transition: color .2s, border-color .2s, background .2s, transform .2s;
}

.browser-support a:hover {
    color: var(--c-text);
    border-color: var(--c-border-hi);
    background: rgba(34, 211, 238, .10);
    transform: translateY(-2px);
}

/* ============================ 入口选择页 ============================ */

.entry-card {
    width: min(760px, 100%);
    padding: 38px 30px 30px;
    animation: rise .7s var(--ease) both;
}

.entry-card .head {
    text-align: center;
    margin-bottom: 28px;
}

.entry-card .head .logo {
    width: 62px;
    height: 62px;
    object-fit: contain;
    filter: drop-shadow(0 8px 20px rgba(34, 211, 238, .4));
    margin-bottom: 12px;
    animation: float 4.5s ease-in-out infinite;
}

.entry-card .head h1 {
    font-size: 20px;
    font-weight: 700;
    letter-spacing: .08em;
    margin-bottom: 6px;
}

.entry-card .head p { font-size: 13px; color: var(--c-text-dim); }

.entry-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
    gap: 14px;
}

.entry-item {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 20px 18px;
    border-radius: var(--r-md);
    border: 1px solid var(--c-border);
    background: rgba(255, 255, 255, .04);
    color: var(--c-text);
    transition: transform .25s var(--ease), border-color .25s, background .25s, box-shadow .25s;
}

.entry-item:hover {
    transform: translateY(-4px);
    border-color: var(--c-border-hi);
    background: rgba(34, 211, 238, .09);
    box-shadow: 0 16px 34px -18px rgba(34, 211, 238, .8);
}

.entry-item .ic {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    background: linear-gradient(140deg, rgba(34, 211, 238, .25), rgba(167, 139, 250, .22));
    border: 1px solid var(--c-border);
}

.entry-item .t {
    font-size: 15.5px;
    font-weight: 600;
    letter-spacing: .04em;
}

.entry-item .d {
    font-size: 12.5px;
    color: var(--c-text-dim);
    line-height: 1.65;
}

.entry-item .go {
    margin-top: 2px;
    font-size: 12px;
    letter-spacing: .12em;
    color: var(--c-primary);
}

.entry-item .go::after { content: " →"; }

/* ============================ 测速页 ============================ */

.speed-card {
    width: min(880px, 100%);
    padding: 34px 28px 28px;
    animation: rise .7s var(--ease) both;
}

.speed-head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
    padding-bottom: 18px;
    margin-bottom: 20px;
    border-bottom: 1px solid rgba(255, 255, 255, .10);
}

.speed-head .ttl { font-size: 19px; font-weight: 700; letter-spacing: .06em; }
.speed-head .ttl span { color: var(--c-primary); }

.speed-head .sub { font-size: 12.5px; color: var(--c-text-dim); margin-top: 5px; }

.speed-head .actions { display: flex; gap: 10px; align-items: center; }

.mini-btn {
    height: 34px;
    padding: 0 15px;
    border-radius: var(--r-full);
    border: 1px solid var(--c-border);
    background: rgba(255, 255, 255, .05);
    color: var(--c-text-dim);
    font-family: inherit;
    font-size: 12.5px;
    cursor: pointer;
    letter-spacing: .06em;
    transition: color .2s, border-color .2s, background .2s;
}

.mini-btn:hover { color: var(--c-text); border-color: var(--c-border-hi); background: rgba(34, 211, 238, .10); }
.mini-btn.on { color: #04202b; background: linear-gradient(94deg, var(--c-primary), var(--c-accent)); border-color: transparent; font-weight: 700; }

/* 线路网格 */
.lines {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(168px, 1fr));
    gap: 12px;
}

.line {
    position: relative;
    padding: 15px 14px;
    border-radius: var(--r-md);
    border: 1px solid var(--c-border);
    background: rgba(255, 255, 255, .04);
    overflow: hidden;
    transition: border-color .25s, background .25s, transform .25s var(--ease);
}

.line:hover { transform: translateY(-3px); border-color: var(--c-border-hi); }

.line .nm {
    display: block;
    font-size: 13.5px;
    font-weight: 600;
    color: var(--c-text);
    letter-spacing: .04em;
    margin-bottom: 8px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.line .ms {
    display: inline-flex;
    align-items: baseline;
    gap: 3px;
    font-family: var(--font-mono);
    font-size: 21px;
    font-weight: 700;
    color: var(--c-text-mute);
    letter-spacing: .02em;
}

.line .ms i { font-style: normal; font-size: 11px; color: var(--c-text-mute); }

.line .bar {
    margin-top: 11px;
    height: 4px;
    border-radius: var(--r-full);
    background: rgba(255, 255, 255, .08);
    overflow: hidden;
}

.line .bar > i {
    display: block;
    height: 100%;
    width: 0;
    border-radius: var(--r-full);
    background: linear-gradient(90deg, var(--c-primary), var(--c-accent));
    transition: width .7s var(--ease);
}

.line.testing .ms { color: var(--c-warn); }
.line.fast { border-color: rgba(52, 211, 153, .55); background: rgba(52, 211, 153, .10); }
.line.fast .ms { color: var(--c-success); }
.line.fast .bar > i { background: linear-gradient(90deg, var(--c-success), #a7f3d0); }
.line.slow .ms { color: var(--c-warn); }
.line.dead { opacity: .55; }
.line.dead .ms { color: var(--c-danger); }

.line .tag {
    position: absolute;
    top: 11px;
    right: 11px;
    padding: 2px 8px;
    border-radius: var(--r-full);
    font-size: 10.5px;
    letter-spacing: .08em;
    background: rgba(52, 211, 153, .18);
    color: var(--c-success);
    border: 1px solid rgba(52, 211, 153, .35);
    opacity: 0;
    transform: scale(.8);
    transition: opacity .3s, transform .3s var(--ease);
}

.line.fast .tag { opacity: 1; transform: none; }

.line .fire {
    position: absolute;
    right: 10px;
    bottom: 10px;
    font-size: 15px;
    opacity: 0;
}

.line.fast .fire { opacity: .9; animation: flame 1.4s ease-in-out infinite; }

@keyframes flame {
    0%, 100% { transform: scale(1) rotate(-3deg); filter: brightness(1); }
    50%      { transform: scale(1.18) rotate(4deg); filter: brightness(1.35); }
}

/* 参考站点 */
.sample-zone {
    margin-top: 26px;
    padding-top: 20px;
    border-top: 1px dashed rgba(255, 255, 255, .12);
}

.sample-title {
    font-size: 12.5px;
    letter-spacing: .1em;
    color: var(--c-text-mute);
    margin-bottom: 12px;
    text-transform: uppercase;
}

.sample-list {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.sample {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    padding: 8px 14px;
    border-radius: var(--r-full);
    border: 1px solid var(--c-border);
    background: rgba(255, 255, 255, .04);
    font-size: 12.5px;
    color: var(--c-text-dim);
}

.sample b {
    font-family: var(--font-mono);
    font-weight: 600;
    color: var(--c-primary);
}

.client-ip {
    margin-top: 16px;
    font-size: 12px;
    font-family: var(--font-mono);
    color: var(--c-text-mute);
    letter-spacing: .05em;
}

/* 进度条 */
.progress {
    margin-top: 22px;
    height: 5px;
    border-radius: var(--r-full);
    background: rgba(255, 255, 255, .07);
    overflow: hidden;
}

.progress > i {
    display: block;
    height: 100%;
    width: 0;
    border-radius: var(--r-full);
    background: linear-gradient(90deg, var(--c-primary), var(--c-accent) 60%, var(--c-accent-2));
    transition: width .35s var(--ease);
}

.progress-label {
    margin-top: 9px;
    font-size: 12px;
    color: var(--c-text-mute);
    letter-spacing: .06em;
    text-align: center;
}

/* ============================ 页脚 ============================ */

.site-foot {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 15;
    padding: 12px 20px;
    text-align: center;
    font-size: 12px;
    letter-spacing: .08em;
    color: var(--c-text-mute);
    background: linear-gradient(0deg, rgba(10, 22, 40, .7), transparent);
    pointer-events: none;
}

.site-foot b { color: var(--c-primary); font-weight: 600; }

/* ============================ 横屏遮罩 ============================ */

.landscape-mask {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #0a1628;
    color: var(--c-text);
    font-size: 17px;
    padding: 24px;
    z-index: 100;
    align-items: center;
    justify-content: center;
    text-align: center;
}

/* ============================ 响应式 ============================ */

@media (max-width: 735px) {
    #outer { padding: 22px 16px 88px; justify-content: flex-start; }

    .topbar { padding: 12px 16px; }
    .topbar .meta { display: none; }

    .login-card { padding: 30px 22px 26px; }
    .entry-card { padding: 28px 18px 24px; }
    .speed-card { padding: 24px 16px 22px; }

    .brand-hero h1 { font-size: 18px; }
    .field { height: 50px; }
    .field input { font-size: 15px; }
    .btn { height: 48px; font-size: 15px; }

    .speed-head { flex-direction: column; align-items: flex-start; }
    .lines { grid-template-columns: repeat(auto-fill, minmax(132px, 1fr)); gap: 10px; }
    .line .ms { font-size: 18px; }
    .entry-grid { grid-template-columns: 1fr; }
}

@media (max-width: 360px) {
    .lines { grid-template-columns: 1fr 1fr; }
    .brand-hero .logo { width: 60px; height: 60px; }
}

@media (min-aspect-ratio: 13/9) and (max-width: 750px) and (min-width: 450px) {
    .landscape-mask { display: flex; }
}
