body.app-shell {
    font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background-color: #f8fafc;
    color: #0f172a;
    overflow-x: hidden;
}

body.support-page,
body.ai-chat-page {
    height: 100vh;
    overflow: hidden;
}

.app-brand-text {
    display: inline-block;
    max-width: min(56vw, 24rem);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-weight: 800;
    line-height: 1.2;
}

.fluid-bg {
    position: fixed;
    inset: 0;
    width: 100vw;
    height: 100vh;
    z-index: -1;
    background: #fff;
    overflow: hidden;
    transform: translateZ(0);
}

/* 页面使用桌面端 67% 缩放时，背景按反向尺寸铺满整个可视区域。 */
@media (min-width: 769px) {
    body.page-scale-75 .fluid-bg {
        right: auto;
        bottom: auto;
        width: 149.2537vw;
        height: 149.2537vh;
        transform: translateZ(0);
    }

    body.page-scale-75 .fluid-bg .blob-1 {
        width: 89.5522vw;
        height: 89.5522vw;
    }

    body.page-scale-75 .fluid-bg .blob-2 {
        width: 104.4776vw;
        height: 104.4776vw;
    }

    body.page-scale-75 .fluid-bg .blob-3 {
        width: 74.6269vw;
        height: 74.6269vw;
    }
}

.fluid-blob {
    position: absolute;
    opacity: .5;
    will-change: transform;
    border-radius: 50%;
    pointer-events: none;
}

.blob-1 {
    top: -20%;
    left: -10%;
    width: 60vw;
    height: 60vw;
    background: radial-gradient(circle, rgba(129, 140, 248, .6) 0%, rgba(59, 130, 246, .2) 40%, transparent 70%);
    animation: moveBlob1 20s infinite alternate linear;
}

.blob-2 {
    bottom: -20%;
    right: -10%;
    width: 70vw;
    height: 70vw;
    background: radial-gradient(circle, rgba(192, 132, 252, .6) 0%, rgba(236, 72, 153, .2) 40%, transparent 70%);
    animation: moveBlob2 25s infinite alternate linear;
}

.blob-3 {
    top: 20%;
    left: 30%;
    width: 50vw;
    height: 50vw;
    background: radial-gradient(circle, rgba(56, 189, 248, .5) 0%, rgba(129, 140, 248, .2) 40%, transparent 70%);
    animation: moveBlob3 22s infinite alternate linear;
}

body.auth-pink .blob-1 {
    background: radial-gradient(circle, rgba(236, 72, 153, .42) 0%, rgba(192, 132, 252, .12) 40%, transparent 70%);
}

body.auth-pink .blob-2 {
    background: radial-gradient(circle, rgba(99, 102, 241, .42) 0%, rgba(56, 189, 248, .12) 40%, transparent 70%);
}

@keyframes moveBlob1 {
    0% { transform: translate(0, 0) scale(1) rotate(0deg); }
    33% { transform: translate(30%, 20%) scale(1.2) rotate(60deg); }
    66% { transform: translate(-10%, 40%) scale(.8) rotate(120deg); }
    100% { transform: translate(40%, -10%) scale(1.1) rotate(180deg); }
}

@keyframes moveBlob2 {
    0% { transform: translate(0, 0) scale(1) rotate(0deg); }
    33% { transform: translate(-40%, -20%) scale(.8) rotate(-60deg); }
    66% { transform: translate(20%, -40%) scale(1.2) rotate(-120deg); }
    100% { transform: translate(-30%, 20%) scale(1) rotate(-180deg); }
}

@keyframes moveBlob3 {
    0% { transform: translate(0, 0) scale(1) rotate(0deg); }
    33% { transform: translate(40%, -40%) scale(1.3) rotate(90deg); }
    66% { transform: translate(-30%, 30%) scale(.8) rotate(180deg); }
    100% { transform: translate(-20%, -30%) scale(1.1) rotate(270deg); }
}

.glass-panel {
    background: rgba(255, 255, 255, .85);
    border: 1px solid rgba(255, 255, 255, .8);
    box-shadow: 0 8px 32px rgba(31, 38, 135, .05);
    border-radius: 24px;
}

.inner-panel {
    background: rgba(255, 255, 255, .7);
    border: 1px solid rgba(255, 255, 255, .9);
    border-radius: 16px;
}

.card-3d,
.card-3d-hover {
    transition: all .45s cubic-bezier(.25, .8, .25, 1);
}

.card-3d:hover,
.card-3d-hover:hover {
    transform: translateY(-6px);
    box-shadow: 0 20px 40px -10px rgba(99, 102, 241, .15);
    background: rgba(255, 255, 255, .95);
}

.icon-glass {
    background: linear-gradient(135deg, rgba(255,255,255,.9), rgba(255,255,255,.4));
    box-shadow: 0 4px 15px rgba(0,0,0,.05), inset 0 0 0 1px rgba(255,255,255,.5);
}

.gallery-card {
    position: relative;
    overflow: hidden;
    border-radius: 24px;
    background: #fff;
    border: 1px solid rgba(255,255,255,.8);
    padding: 8px;
    box-shadow: 0 10px 30px rgba(0,0,0,.05);
    transition: all .6s cubic-bezier(.16, 1, .3, 1);
}

.gallery-card img {
    border-radius: 18px;
    transition: transform .8s cubic-bezier(.16, 1, .3, 1);
}

.gallery-card:hover {
    box-shadow: 0 20px 50px rgba(99,102,241,.15);
    transform: scale(1.02);
}

.gallery-card:hover img {
    transform: scale(1.03);
}

.title-underline {
    position: relative;
    display: inline-block;
}

.title-underline::after {
    content: "";
    position: absolute;
    width: 50px;
    height: 4px;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    background: linear-gradient(90deg, #6366f1, #c084fc);
    border-radius: 4px;
}

@keyframes pulse-glow {
    0%, 100% { opacity: 1; }
    50% { opacity: .6; }
}

.animate-pulse-glow {
    animation: pulse-glow 2s cubic-bezier(.4, 0, .6, 1) infinite;
}

.payment-method {
    transition: all .25s ease;
    border: 1px solid #e2e8f0;
}

.payment-method:hover {
    transform: translateY(-2px);
    box-shadow: 0 16px 30px -18px rgba(15, 23, 42, .35);
    border-color: rgba(99, 102, 241, .35);
}

.payment-method.selected {
    border-color: #6366f1;
    background: #f8faff;
    box-shadow: 0 18px 35px -20px rgba(79, 70, 229, .55);
}

.feature-item {
    background: rgba(255, 255, 255, .72);
    border: 1px solid rgba(226, 232, 240, .9);
}

.secure-qr-wrap,
.secure-qr-wrap * {
    -webkit-user-select: none;
    user-select: none;
    -webkit-touch-callout: none;
}

.secure-qr-image {
    pointer-events: none;
    -webkit-user-drag: none;
    user-drag: none;
}

.device-item {
    transition: all .3s cubic-bezier(.25, .8, .25, 1);
}

.device-item:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 25px -5px rgba(99,102,241,.15);
}

.modal-enter {
    animation: modalFadeIn .3s ease-out forwards;
}

@keyframes modalFadeIn {
    from { opacity: 0; transform: scale(.95) translateY(-10px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

.modal-bg-enter {
    animation: bgFadeIn .3s ease-out forwards;
}

@keyframes bgFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
}

.messages-wrapper {
    margin-top: auto;
}

.message {
    margin-bottom: 1.5rem;
    display: flex;
    align-items: flex-start;
    gap: 1rem;
}

.message.user {
    flex-direction: row-reverse;
}

.message-avatar {
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: .3rem;
}

.message-avatar .avatar-icon,
.typing-indicator .avatar-icon {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: linear-gradient(135deg, rgba(255,255,255,.9), rgba(255,255,255,.4));
    box-shadow: 0 4px 15px rgba(0,0,0,.05), inset 0 0 0 1px rgba(255,255,255,.8);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    backdrop-filter: blur(8px);
}

.message-avatar .avatar-name {
    font-size: .75rem;
    color: #64748b;
    font-weight: 500;
}

.message-bubble {
    max-width: 75%;
    padding: 1rem 1.25rem;
    border-radius: 16px;
    word-wrap: break-word;
    line-height: 1.6;
    font-size: .95rem;
    white-space: pre-wrap;
    box-shadow: 0 4px 15px rgba(0,0,0,.03);
}

.message.user .message-bubble {
    background: linear-gradient(135deg, #6366f1 0%, #c084fc 100%);
    color: #fff;
    border-bottom-right-radius: 4px;
    box-shadow: 0 10px 25px rgba(99, 102, 241, .2);
}

.message.assistant .message-bubble {
    background: rgba(255, 255, 255, .9);
    color: #1e293b;
    border: 1px solid rgba(255, 255, 255, .8);
    border-bottom-left-radius: 4px;
}

.message.assistant.transferred .message-bubble {
    position: relative;
    border-color: rgba(34, 197, 94, .28);
    box-shadow: 0 14px 35px rgba(34, 197, 94, .14), 0 4px 15px rgba(0,0,0,.03);
    animation: transfer-pop .42s ease-out;
}

.message.assistant.transferred .message-bubble::after {
    content: '';
    position: absolute;
    inset: -2px;
    border-radius: inherit;
    border: 2px solid rgba(34, 197, 94, .38);
    opacity: 0;
    animation: transfer-ring 1.15s ease-out;
    pointer-events: none;
}

.transfer-success-mark {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: 10px;
    padding: 6px 10px;
    border-radius: 999px;
    background: #ecfdf5;
    color: #047857;
    border: 1px solid #bbf7d0;
    font-size: 12px;
    font-weight: 700;
}

.transfer-check {
    width: 18px;
    height: 18px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: #22c55e;
    color: #fff;
    font-size: 12px;
    line-height: 1;
}

@keyframes transfer-pop {
    0% { transform: scale(.97); }
    60% { transform: scale(1.015); }
    100% { transform: scale(1); }
}

@keyframes transfer-ring {
    0% { transform: scale(.98); opacity: .9; }
    100% { transform: scale(1.08); opacity: 0; }
}

.message.system .message-bubble { background: #fffbeb; color: #92400e; border: 1px solid #fde68a; max-width: 100%; }
.message.success .message-bubble { background: #f0fdf4; color: #166534; border: 1px solid #bbf7d0; max-width: 100%; }
.message.error .message-bubble { background: #fef2f2; color: #991b1b; border: 1px solid #fecaca; max-width: 100%; }

.typing-indicator {
    display: none;
    margin-bottom: 1.5rem;
    align-items: flex-start;
    gap: 1rem;
}

.typing-indicator .dots {
    background: rgba(255, 255, 255, .9);
    padding: 1rem 1.25rem;
    border-radius: 16px;
    border-bottom-left-radius: 4px;
    display: flex;
    align-items: center;
    border: 1px solid rgba(255, 255, 255, .8);
}

.typing-indicator .dots span {
    display: inline-block;
    width: 8px;
    height: 8px;
    background: #6366f1;
    border-radius: 50%;
    margin: 0 3px;
    animation: typing 1.4s infinite;
}

.typing-indicator .dots span:nth-child(2) { animation-delay: .2s; }
.typing-indicator .dots span:nth-child(3) { animation-delay: .4s; }

@keyframes typing {
    0%, 60%, 100% { transform: translateY(0); }
    30% { transform: translateY(-6px); }
}

.chat-messages::-webkit-scrollbar { width: 6px; }
.chat-messages::-webkit-scrollbar-track { background: transparent; }
.chat-messages::-webkit-scrollbar-thumb { background: rgba(148, 163, 184, .3); border-radius: 10px; }
.chat-messages::-webkit-scrollbar-thumb:hover { background: rgba(148, 163, 184, .5); }

.history-list::-webkit-scrollbar { width: 6px; }
.history-list::-webkit-scrollbar-track { background: transparent; }
.history-list::-webkit-scrollbar-thumb { background: rgba(100, 116, 139, .3); border-radius: 10px; }
.history-list::-webkit-scrollbar-thumb:hover { background: rgba(100, 116, 139, .5); }

::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: #94a3b8; }

.animate-on-scroll {
    opacity: 0;
    transform: translateY(40px) scale(.95);
    transition: opacity .8s cubic-bezier(.16, 1, .3, 1), transform .8s cubic-bezier(.16, 1, .3, 1);
}

.animate-on-scroll.is-visible {
    opacity: 1;
    transform: translateY(0) scale(1);
}

.nav-scrolled {
    background: rgba(255,255,255,.95);
    border-bottom: 1px solid rgba(255,255,255,.5);
    box-shadow: 0 4px 30px rgba(0,0,0,.03);
}

.app-footer {
    background: #0f172a;
    color: #fff;
    padding: 1.5rem 0;
    position: relative;
    z-index: 10;
    border-radius: 1.5rem 1.5rem 0 0;
    margin-top: 1.5rem;
}

.app-footer a {
    color: rgb(203 213 225);
    text-decoration: none;
    transition: color .2s ease;
}

.app-footer a:hover {
    color: #fff;
}

.static-page-main {
    width: 100%;
    max-width: 960px;
    margin: 0 auto;
    padding: 8rem 1rem 3rem;
}

.static-page-card {
    background: rgba(255,255,255,.86);
    border: 1px solid rgba(255,255,255,.9);
    box-shadow: 0 24px 70px rgba(15,23,42,.08);
    border-radius: 24px;
    padding: 2.5rem;
}

.static-page-card h1,
.static-page-card .page-title {
    color: #0f172a;
    font-size: clamp(1.75rem, 3vw, 2.25rem);
    font-weight: 800;
    letter-spacing: 0;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #e2e8f0;
}

.static-page-card h2,
.static-page-card .section h2 {
    color: #4f46e5;
    font-size: 1.1rem;
    font-weight: 800;
    margin: 1.8rem 0 .8rem;
    padding: 0;
    border: 0;
}

.static-page-card p,
.static-page-card li {
    color: #475569;
    line-height: 1.8;
    font-size: .96rem;
}

.static-page-card ul {
    color: #475569;
    margin: .8rem 0 .8rem 1.4rem;
    padding-left: 1rem;
}

.static-page-card li {
    margin-bottom: .45rem;
}

.static-page-card .update-date {
    color: #64748b;
    font-size: .9rem;
    margin-bottom: 1.5rem;
}

.static-page-card .warning-box,
.static-page-card .danger-box,
.static-page-card .highlight {
    border-radius: 14px;
    margin: 1rem 0;
    padding: 1rem;
    border-left: 4px solid #6366f1;
    background: #eef2ff;
    color: #475569;
}

.static-page-card .danger-box {
    border-left-color: #ef4444;
    background: #fef2f2;
}

.static-page-card .warning-box {
    border-left-color: #f59e0b;
    background: #fffbeb;
}

.static-page-card .footer-note {
    margin-top: 2rem;
    padding-top: 1rem;
    border-top: 1px solid #e2e8f0;
    color: #4f46e5;
    font-weight: 700;
    text-align: center;
}

.static-page-card .back-btn,
.static-page-card .back-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-top: 1.5rem;
    color: #4f46e5;
    font-weight: 700;
    text-decoration: none;
}

.auth-card {
    background: rgba(255,255,255,.85);
    border: 1px solid rgba(255,255,255,.9);
    box-shadow: 0 10px 40px -10px rgba(31,38,135,.05);
    border-radius: 24px;
    animation: slideInUp .6s cubic-bezier(.16, 1, .3, 1);
}

.auth-card h2 {
    color: #0f172a;
    font-size: 1.7rem;
    line-height: 1.2;
    font-weight: 800;
    margin-bottom: .75rem;
}

.auth-card > p {
    color: #64748b;
    line-height: 1.7;
    margin-bottom: 1.5rem;
}

.auth-card small,
.auth-card .form-hint {
    display: block;
    color: #64748b;
    margin-top: .45rem;
    font-size: .78rem;
    line-height: 1.5;
}

.auth-card a {
    font-weight: 700;
    text-decoration: none;
}

body.auth-indigo .auth-card a {
    color: #4f46e5;
}

body.auth-indigo .auth-card a:hover {
    color: #6366f1;
}

body.auth-pink .auth-card a {
    color: #db2777;
}

body.auth-pink .auth-card a:hover {
    color: #ec4899;
}

@keyframes slideInUp {
    from { opacity: 0; transform: translateY(30px) scale(.95); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.input-field {
    width: 100%;
    padding: 1rem 1.2rem;
    background: rgba(248,250,252,.8);
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    font-size: 1rem;
    color: #334155;
    transition: all .3s ease;
}

.input-field:focus {
    outline: none;
    background: #fff;
    transform: translateY(-1px);
}

body.auth-indigo .input-field:focus {
    border-color: #818cf8;
    box-shadow: 0 0 0 4px rgba(129,140,248,.15);
}

body.auth-pink .input-field:focus {
    border-color: #ec4899;
    box-shadow: 0 0 0 4px rgba(236,72,153,.15);
}

.btn-gradient {
    background-size: 200% 100%;
    transition: all .4s cubic-bezier(.4, 0, .2, 1);
}

.btn-gradient:hover {
    background-position: 100% 0;
    transform: translateY(-2px);
}

body.auth-indigo .btn-gradient {
    background-image: linear-gradient(135deg, #6366f1 0%, #a855f7 100%);
}

body.auth-indigo .btn-gradient:hover {
    box-shadow: 0 10px 25px rgba(99,102,241,.4);
}

body.auth-pink .btn-gradient {
    background-image: linear-gradient(135deg, #ec4899 0%, #8b5cf6 100%);
}

body.auth-pink .btn-gradient:hover {
    box-shadow: 0 10px 25px rgba(236,72,153,.4);
}

@media (prefers-reduced-motion: reduce) {
    .fluid-blob,
    .animate-on-scroll,
    .auth-card {
        animation: none !important;
        transition: none !important;
    }
}

@media (max-width: 640px) {
    .fluid-blob { opacity: .35; }
    .blob-1, .blob-2, .blob-3 { width: 90vw; height: 90vw; }
    .static-page-card { padding: 1.5rem; }
}

@media (max-width: 768px) {
    body.app-shell {
        min-width: 0;
    }

    #navbar {
        height: 4.25rem !important;
    }

    #navbar > div,
    nav.absolute > div {
        padding-left: 1rem !important;
        padding-right: 1rem !important;
        gap: .75rem;
    }

    #navbar a.text-2xl,
    nav.absolute a.text-2xl {
        font-size: 1rem !important;
        min-width: 0;
        flex: 1 1 auto;
    }

    #navbar a.text-2xl > div,
    nav.absolute a.text-2xl > div {
        width: 2.25rem !important;
        height: 2.25rem !important;
        flex: 0 0 2.25rem;
    }

    .app-brand-text {
        max-width: 42vw;
        font-size: 1rem;
    }

    .app-nav-links {
        gap: .5rem !important;
        column-gap: .5rem !important;
        flex-shrink: 0;
        white-space: nowrap;
    }

    .app-nav-links a {
        font-size: 0 !important;
    }

    .app-nav-links a i {
        font-size: 1rem !important;
        margin: 0 !important;
    }

    .app-nav-links a > div {
        padding: .55rem .75rem !important;
        gap: 0 !important;
    }

    .app-nav-links a[onclick="addBookmark()"] {
        display: none !important;
    }

    .glass-panel {
        border-radius: 18px;
    }

    .inner-panel,
    .feature-item,
    .payment-method,
    .device-item {
        border-radius: 14px;
    }

    .message {
        gap: .6rem;
        margin-bottom: 1rem;
    }

    .message-avatar .avatar-icon,
    .typing-indicator .avatar-icon {
        width: 34px;
        height: 34px;
        font-size: 1rem;
    }

    .message-avatar .avatar-name {
        display: none;
    }

    .message-bubble {
        max-width: calc(100vw - 5.5rem);
        padding: .8rem 1rem;
        font-size: .9rem;
        line-height: 1.55;
    }

    .chat-messages {
        padding: 1rem;
    }

    body.support-page,
    body.ai-chat-page {
        height: 100dvh;
        min-height: 100dvh;
    }

    body.support-page > .flex-1,
    body.ai-chat-page > .flex-1 {
        padding-top: 4.75rem !important;
        padding-bottom: .75rem !important;
        padding-left: .75rem !important;
        padding-right: .75rem !important;
    }

    body.support-page .glass-panel,
    body.ai-chat-page .glass-panel {
        border-radius: 18px !important;
        min-height: 0;
    }

    body.support-page textarea,
    body.ai-chat-page textarea {
        font-size: 16px !important;
    }

    body.support-page form button[type="submit"],
    body.ai-chat-page form button[type="submit"] {
        width: 52px;
        padding-left: 0 !important;
        padding-right: 0 !important;
        flex: 0 0 52px;
    }

    body.support-page form button[type="submit"] span,
    body.ai-chat-page form button[type="submit"] span {
        display: none;
    }

    .static-page-main {
        padding-top: 5.5rem;
    }
}

@media (max-width: 420px) {
    .app-brand-text {
        max-width: 34vw;
    }

    .app-nav-links a > div {
        padding: .5rem .62rem !important;
    }

    .app-nav-links {
        gap: .35rem !important;
    }

    .static-page-card {
        padding: 1.1rem;
        border-radius: 16px;
    }
}


/* AI chat layout fixes */
body.ai-chat-page > .flex-1 {
    min-height: 0;
}

body.ai-chat-page .glass-panel {
    height: 100%;
    min-height: 0;
}

body.ai-chat-page aside {
    min-height: 0;
}

body.ai-chat-page .history-item.active {
    background: rgba(255, 255, 255, 0.72);
    border-color: rgba(99, 102, 241, 0.35);
    box-shadow: 0 8px 20px rgba(99, 102, 241, 0.08);
}

body.ai-chat-page .ai-model-row {
    justify-content: flex-start;
}

body.ai-chat-page .ai-model-select {
    width: auto;
    max-width: 100%;
    min-width: 10rem;
}

