/* 公共：变量、重置、氛围、顶栏、玻璃。字体用系统栈（见 --font） */

:root {
    color-scheme: light;
    --ink: #0b1220;
    --muted: rgba(11, 18, 32, 0.58);
    --line: rgba(255, 255, 255, 0.55);
    --glass: rgba(255, 255, 255, 0.42);
    --glass-strong: rgba(255, 255, 255, 0.62);
    --accent: #0071e3;
    --accent-deep: #005bb8;
    --accent-soft: rgba(0, 113, 227, 0.14);
    --accent-glow: rgba(0, 113, 227, 0.28);
    --shadow: 0 18px 50px rgba(40, 70, 110, 0.14);
    --radius: 24px;
    /* 优先本地思源黑体 SC 子集；缺字回退系统字体 */
    --font: "Noto Sans SC", -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB",
        "Microsoft YaHei UI", "Microsoft YaHei", "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }

html, body { min-height: 100%; }

body {
    margin: 0;
    font: 16px/1.5 var(--font);
    color: var(--ink);
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

.ambient {
    position: fixed;
    inset: 0;
    overflow: hidden;
    pointer-events: none;
    z-index: 0;
}

.orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(40px);
    opacity: 0.55;
    will-change: transform;
    transform: translateZ(0);
    animation: drift 18s ease-in-out infinite;
}

.orb-a {
    width: 320px;
    height: 320px;
    left: -60px;
    top: 12%;
}

.orb-b {
    width: 280px;
    height: 280px;
    right: -40px;
    top: 28%;
    animation-delay: -6s;
}

.orb-c {
    width: 360px;
    height: 360px;
    left: 30%;
    bottom: -120px;
    animation-delay: -11s;
}

@keyframes drift {
    0%, 100% { transform: translate3d(0, 0, 0) scale(1); }
    50% { transform: translate3d(24px, -30px, 0) scale(1.08); }
}

.top, main { position: relative; z-index: 1; }

.top {
    position: sticky;
    top: 0;
    z-index: 20;
    display: flex;
    align-items: center;
    gap: 14px;
    margin: 12px 12px 0;
    padding: 10px 12px 10px 14px;
    border-radius: 22px;
    background: var(--glass);
    border: 1px solid var(--line);
    box-shadow: var(--shadow);
    backdrop-filter: blur(28px) saturate(180%);
    -webkit-backdrop-filter: blur(28px) saturate(180%);
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: inherit;
    font-size: 17px;
    font-weight: 740;
    letter-spacing: -0.04em;
    text-decoration: none;
}

.brand-logo {
    width: 32px;
    height: 32px;
    border-radius: 10px;
    object-fit: cover;
    flex: 0 0 auto;
    box-shadow:
        0 1px 0 rgba(255, 255, 255, 0.5) inset,
        0 6px 14px rgba(40, 70, 120, 0.16);
}

.top-nav {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.28);
    border: 1px solid rgba(255, 255, 255, 0.5);
    box-shadow: 0 1px 0 rgba(255, 255, 255, 0.55) inset;
}

.nav-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-height: 34px;
    padding: 0 16px;
    border-radius: 999px;
    color: var(--muted);
    text-decoration: none;
    font-size: 14px;
    font-weight: 560;
    transition: background 0.25s ease, color 0.25s ease, box-shadow 0.25s ease, transform 0.25s ease;
}

.nav-ico {
    display: inline-block;
    width: 1em;
    font-size: 14px;
    line-height: 1;
    flex: 0 0 auto;
    text-align: center;
}

.nav-pill:hover {
    color: var(--ink);
    background: rgba(255, 255, 255, 0.45);
    transform: translateY(-1px);
}

.nav-pill[aria-current="page"] {
    color: #fff;
    font-weight: 650;
    background: linear-gradient(145deg, var(--accent) 0%, var(--accent-deep) 100%);
    box-shadow: 0 1px 0 rgba(255, 255, 255, 0.35) inset, 0 8px 18px var(--accent-glow);
}

.account {
    color: var(--muted);
    text-decoration: none;
    padding: 8px 12px;
    border-radius: 12px;
}
.account:hover { background: rgba(255, 255, 255, 0.45); color: var(--ink); }
.logout-form { margin: 0; }
.logout-form .account {
    border: 0;
    background: transparent;
    font: inherit;
    cursor: pointer;
}

.glass {
    background: var(--glass-strong);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    backdrop-filter: blur(36px) saturate(190%);
    -webkit-backdrop-filter: blur(36px) saturate(190%);
}

.rise {
    animation: rise 0.55s cubic-bezier(0.22, 1, 0.36, 1) both;
}
.rise.delay { animation-delay: 0.08s; }

@keyframes rise {
    from { opacity: 0; transform: translateY(14px); }
    to { opacity: 1; transform: translateY(0); }
}

@media (prefers-reduced-motion: reduce) {
    .orb, .rise, .glyph, .chat .msg { animation: none !important; }
}
