@import url("css/shared-login-stagger.css");

:root {
    --bg-color: #0f172a;
    --text-color: #f8fafc;
    --text-muted: #94a3b8;
    --card-bg: rgba(255, 255, 255, 0.05);
    --card-border: rgba(255, 255, 255, 0.1);
    --input-bg: transparent;
    --accent-color: #38bdf8;
    --accent-gradient: linear-gradient(135deg, #38bdf8 0%, #818cf8 100%);
    --success-color: #4ade80;
    --danger-color: #f87171;
    --font-main: 'Inter', sans-serif;
    --font-display: 'Outfit', sans-serif;
    --app-modal-backdrop: rgba(34, 41, 52, 0.48);
    --app-modal-backdrop-filter: blur(6px) saturate(106%);
    --public-light-modal-backdrop: var(--app-modal-backdrop);
    --public-light-modal-backdrop-filter: var(--app-modal-backdrop-filter);
}

html[data-theme="light"],
html:not([data-theme="dark"]) {
    --app-modal-backdrop: rgba(31, 76, 118, 0.20);
    --app-modal-backdrop-filter: blur(8px) saturate(108%);
}

/*
  Auth-sheet backdrop override:
  some pages load style.css after auth-sheet.css, and legacy .login-overlay
  rules here can otherwise re-darken the new login modal. Keep the shared
  login-overlay hooks, but force #loginModal back to the shared app modal
  backdrop material.
*/
#loginModal.auth-sheet-overlay,
#loginModal.auth-sheet-overlay.active,
#loginModal.auth-sheet-overlay.login-overlay,
#loginModal.auth-sheet-overlay.login-overlay.active {
    background: var(--app-modal-backdrop) !important;
    backdrop-filter: var(--app-modal-backdrop-filter) !important;
    -webkit-backdrop-filter: var(--app-modal-backdrop-filter) !important;
    overscroll-behavior: contain !important;
    overscroll-behavior-y: contain !important;
}

#loginModal.auth-sheet-overlay:not(.active):not(.closing),
#loginModal.auth-sheet-overlay.login-overlay:not(.active):not(.closing),
#loginModal.auth-sheet-overlay.closing,
#loginModal.auth-sheet-overlay.login-overlay.closing {
    background: transparent !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
}

#loginModal.auth-sheet-overlay .auth-sheet-backdrop,
#loginModal.auth-sheet-overlay.login-overlay .auth-sheet-backdrop {
    background: transparent !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    opacity: 0 !important;
}

@media (max-width: 768px) {
    body.guestbook-page #loginModal.auth-sheet-overlay,
    body.guestbook-page #loginModal.auth-sheet-overlay.active,
    body.guestbook-page #loginModal.auth-sheet-overlay.login-overlay,
    body.guestbook-page #loginModal.auth-sheet-overlay.login-overlay.active {
        align-items: flex-end !important;
        justify-content: center !important;
        height: 100dvh !important;
        min-height: 100svh !important;
        padding-left: 0 !important;
        padding-right: 0 !important;
        padding-bottom: var(--auth-sheet-mobile-bottom-inset) !important;
    }

    body.guestbook-page #loginModal.auth-sheet-overlay .auth-sheet-stage {
        align-items: flex-end !important;
        justify-content: center !important;
        width: 100% !important;
        min-height: 0 !important;
    }

    body.guestbook-page #loginModal.auth-sheet-overlay .auth-sheet {
        margin-top: auto !important;
        margin-bottom: 0 !important;
    }
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Base Styles */
html {
    background-color: #000000 !important;
    /* Pure black as requested */
    /* Fix for over-scroll background */
    position: relative;
    /* Create positioning context */
    min-height: 100%;
    overflow-x: hidden;
}

/* 简化body和html样式 */
html,
body {
    margin: 0;
    padding: 0;
    width: 100%;
    min-height: 100vh;
    overflow-x: hidden;
    scrollbar-width: none;
    scrollbar-gutter: auto;
    -ms-overflow-style: none;
}

/* 20260430_PUBLIC_ROOT_SCROLLBAR_FULL_HIDE_1
   Shared public fallback for pages that do not load framer_home.css early. */
html::-webkit-scrollbar,
body::-webkit-scrollbar {
    display: none !important;
    width: 0 !important;
    height: 0 !important;
    background: transparent !important;
}

html::-webkit-scrollbar-track,
html::-webkit-scrollbar-thumb,
html::-webkit-scrollbar-corner,
body::-webkit-scrollbar-track,
body::-webkit-scrollbar-thumb,
body::-webkit-scrollbar-corner {
    width: 0 !important;
    height: 0 !important;
    background: transparent !important;
    border: 0 !important;
}

body {
    font-family: var(--font-main);
    color: var(--text-color);
    background-color: transparent;
    line-height: 1.6;
    position: relative;
}

/* main-wrapper简化 */
.main-wrapper {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding-bottom: 120px;
    /* Space for absolute footer */
    page-break-after: always;
    /* Ensure proper print breaking if needed, but mostly for structure */
    width: 100%;
    gap: 0;
    /* Control gap via margins explicitly */
}

/* 移动端优化 */
@media (max-width: 768px) {
    .main-wrapper {
        align-items: flex-start;
        justify-content: flex-start;
        /* Force top alignment */
        padding-top: 8vh;
    }
}

/* Background Blobs - 统一为fixed定位 */
.background-blobs {
    position: fixed !important;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    pointer-events: none;
    overflow: hidden;
}

.blob {
    position: absolute !important;
    /* 使用absolute配合父级absolute定位 */
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.7;
    will-change: transform;
}

.blob-1 {
    top: 5%;
    /* Position within oversized container */
    left: -10%;
    width: 60vw;
    height: 80vh;
    /* Tall fixed height */
    background: linear-gradient(45deg, #7c3aed, #ec4899);
    animation: float1 15s ease-in-out infinite;
}

.blob-2 {
    bottom: 5%;
    /* Position within oversized container */
    right: -10%;
    width: 60vw;
    height: 80vh;
    /* Tall fixed height */
    background: linear-gradient(135deg, #2563eb, #06b6d4);
    animation: float2 18s ease-in-out infinite;
}

.blob-3 {
    top: 35%;
    left: 30%;
    width: 50vw;
    height: 70vh;
    /* Tall fixed height */
    background: linear-gradient(225deg, #db2777, #f59e0b);
    animation: float3 20s ease-in-out infinite;
}

@keyframes float1 {

    0%,
    100% {
        transform: translate(0, 0) rotate(0deg) scale(1);
    }

    33% {
        transform: translate(50px, -50px) rotate(10deg) scale(1.1);
    }

    66% {
        transform: translate(-20px, 20px) rotate(-5deg) scale(0.9);
    }
}

@keyframes float2 {

    0%,
    100% {
        transform: translate(0, 0) rotate(0deg) scale(1);
    }

    33% {
        transform: translate(-50px, 50px) rotate(-10deg) scale(1.1);
    }

    66% {
        transform: translate(20px, -20px) rotate(5deg) scale(0.9);
    }
}

@keyframes float3 {

    60% {
        transform: translate(100px, 100px) rotate(216deg) scale(1.1);
    }

    80% {
        transform: translate(-50px, 80px) rotate(288deg) scale(0.95);
    }
}

@keyframes aurora-spin {
    0% {
        transform: translate(-50%, -50%) rotate(0deg) scale(1);
    }

    50% {
        transform: translate(-50%, -50%) rotate(180deg) scale(1.1);
    }

    100% {
        transform: translate(-50%, -50%) rotate(360deg) scale(1);
    }
}

.container {
    width: 100%;
    max-width: 480px;
    padding: 20px;
    z-index: 1;
}

header {
    text-align: center;
    margin-bottom: 30px;
}

header h1 {
    font-family: var(--font-display);
    font-size: 2.5rem;
    font-weight: 700;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 10px;
}

header p {
    color: var(--text-muted);
    font-size: 1rem;
}

.calculator-card {
    background: var(--card-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--card-border);
    border-radius: 24px;
    padding: 30px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}

.input-group {
    margin-bottom: 20px;
}

.input-group label {
    display: block;
    margin-bottom: 8px;
    font-size: 0.9rem;
    color: var(--text-muted);
    font-weight: 500;
}

.input-group input {
    width: 100%;
    padding: 16px;
    background: var(--input-bg);
    border: 1px solid var(--card-border);
    border-radius: 12px;
    color: var(--text-color);
    font-size: 1.1rem;
    font-family: var(--font-main);
    transition: all 0.3s ease;
}

.input-group input:focus {
    outline: none;
    border-color: var(--accent-color);
    box-shadow: 0 0 0 2px rgba(56, 189, 248, 0.2);
}

/* Form focus states - UNIFIED PURPLE GLOW */
textarea:focus,
input[type="text"]:focus,
input[type="email"]:focus,
input[type="tel"]:focus {
    outline: none !important;
    border-color: rgba(139, 92, 246, 0.5) !important;
    /* Softer, unified opacity */
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.15) !important;
    /* Subtle glow */
}

/* Specific for comment textarea */
#commentContent:focus {
    outline: none !important;
    border-color: rgba(139, 92, 246, 0.5) !important;
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.15) !important;
}

/* Main guestbook modal textarea */
#guestbookModal textarea:focus,
#guestbookMessageInput:focus {
    outline: none !important;
    border-color: rgba(139, 92, 246, 0.5) !important;
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.15) !important;
}

.divider {
    height: 1px;
    background: var(--card-border);
    margin: 30px 0;
}

.results {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.result-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.result-item .label {
    color: var(--text-muted);
    font-size: 1rem;
}

.result-item .value {
    font-family: var(--font-display);
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-color);
}

#profit {
    color: var(--success-color);
    font-size: 2rem;
}

#profit.profit-negative {
    color: var(--danger-color);
}

#profit.profit-neutral {
    color: var(--text-color);
}

/* Mobile Optimization */
@media (max-width: 480px) {
    header h1 {
        font-size: 2rem;
    }

    .calculator-card {
        padding: 20px;
    }

    .date-time-compact {
        display: none;
    }
}

/* Navigation */
.main-nav {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-top: 20px;
}

.main-nav a {
    color: var(--text-muted);
    text-decoration: none;
    font-weight: 600;
    padding: 8px 16px;
    border-radius: 20px;
    transition: all 0.3s ease;
}

.main-nav a:hover {
    color: var(--text-color);
    background: rgba(255, 255, 255, 0.1);
}

.main-nav a.active {
    color: var(--bg-color);
    background: var(--accent-color);
}

/* Tabs */
.tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    border-bottom: 1px solid var(--card-border);
    padding-bottom: 10px;
}

.tab-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1rem;
    font-weight: 600;
    padding: 8px 16px;
    cursor: pointer;
    transition: all 0.3s ease;
    border-radius: 8px;
}

.tab-btn:hover {
    color: var(--text-color);
}

.tab-btn.active {
    color: var(--accent-color);
    background: rgba(56, 189, 248, 0.1);
}

.tab-content {
    display: none;
    animation: fadeIn 0.3s ease;
}

.tab-content.active {
    display: block;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(5px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Form Elements */
select {
    width: 100%;
    padding: 16px;
    background: var(--input-bg);
    border: 1px solid var(--card-border);
    border-radius: 12px;
    color: var(--text-color);
    font-size: 1.1rem;
    font-family: var(--font-main);
    appearance: none;
    /* Remove default arrow */
    background-image: url("data:image/svg+xml;charset=US-ASCII,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%22292.4%22%20height%3D%22292.4%22%3E%3Cpath%20fill%3D%22%2394a3b8%22%20d%3D%22M287%2069.4a17.6%2017.6%200%200%200-13-5.4H18.4c-5%200-9.3%201.8-12.9%205.4A17.6%2017.6%200%200%200%200%2082.2c0%205%201.8%209.3%205.4%2012.9l128%20127.9c3.6%203.6%207.8%205.4%2012.8%205.4s9.2-1.8%2012.8-5.4L287%2095c3.5-3.5%205.4-7.8%205.4-12.8%200-5-1.9-9.2-5.5-12.8z%22%2F%3E%3C%2Fsvg%3E");
    background-repeat: no-repeat;
    background-position: right 16px top 50%;
    background-size: 12px auto;
}

.action-btn {
    width: 100%;
    padding: 16px;
    background: var(--accent-gradient);
    border: none;
    border-radius: 12px;
    color: white;
    font-size: 1.1rem;
    font-weight: 700;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    margin-top: 10px;
}



.secondary-btn {
    width: 100%;
    padding: 12px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid var(--card-border);
    border-radius: 12px;
    color: var(--text-color);
    font-weight: 600;
    cursor: pointer;
    margin-top: 10px;
    transition: all 0.2s ease;
}

.secondary-btn:hover {
    background: rgba(255, 255, 255, 0.2);
}

textarea {
    width: 100%;
    height: 150px;
    padding: 16px;
    background: var(--input-bg);
    border: 1px solid var(--card-border);
    border-radius: 12px;
    color: var(--text-color);
    font-size: 1rem;
    font-family: var(--font-main);
    margin-top: 20px;
    resize: vertical;
}

/* Image Tool Styles */
.upload-label {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100px;
    border: 2px dashed var(--card-border);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.upload-label:hover {
    border-color: var(--accent-color);
    background: rgba(56, 189, 248, 0.05);
}

.upload-label input {
    display: none;
}

.canvas-container {
    width: 100%;
    overflow: hidden;
    border-radius: 12px;
    margin: 20px 0;
    border: 1px solid var(--card-border);
}

canvas {
    max-width: 100%;
    height: auto;
    display: block;
}

.row {
    display: flex;
    gap: 15px;
}

.half {
    flex: 1;
}

input[type="color"] {
    height: 50px;
    padding: 5px;
    cursor: pointer;
}

input[type="range"] {
    width: 100%;
    margin-top: 15px;
}

/* Premium Modal Styles (Shared) */
.premium-modal {
    text-align: center;
    max-width: 480px !important;
    padding: 40px !important;
    /* Match Guestbook/Gemini Guide Card Style */


    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    border-top: 1px solid rgba(255, 255, 255, 0.2) !important;
    border-radius: 24px !important;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5) !important;
}

.premium-modal .modal-title {
    font-size: 2rem;
    margin-bottom: 10px;
    font-weight: 700;
    letter-spacing: -0.5px;
    color: #ffffff;
    /* Ensure white text */
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
    /* Add shadow for contrast */
}

.modal-subtitle {
    color: rgba(255, 255, 255, 0.6);
    margin-bottom: 30px;
    font-size: 0.95rem;
    line-height: 1.5;
}

.premium-modal .input-group {
    margin-bottom: 20px;
}

.premium-modal input,
.premium-modal textarea {
    width: 100%;
    padding: 16px;
    /* Plush padding */
    background: rgba(255, 255, 255, 0.08);
    /* Softer background */
    border: 1px solid transparent;
    /* No visible border initially */
    border-radius: 16px;
    /* Rounder corners */
    color: white;
    font-size: 1rem;
    font-family: var(--font-main);
    transition: all 0.3s ease;
    resize: none;
}

.premium-modal input::placeholder,
.premium-modal textarea::placeholder {
    color: rgba(255, 255, 255, 0.3);
}

.premium-modal input:focus,
.premium-modal textarea:focus {
    outline: none;
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(255, 255, 255, 0.2);
    box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.05);
}

.submit-btn,
button.submit-btn,
input.submit-btn {
    width: 100%;
    padding: 16px;
    background: linear-gradient(135deg, #a855f7 0%, #f472b6 50%, #fb7185 100%);
    /* Unified Pink-Purple Gradient */
    border: none;
    border-radius: 16px;
    color: white;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer !important;
    transition: all 0.3s ease;
    /* Smooth transition */
    margin-top: 10px;
    margin-bottom: 20px;
    box-shadow: 0 6px 20px rgba(168, 85, 247, 0.4);
    position: relative;
    z-index: 100 !important;
    pointer-events: auto !important;
    -webkit-user-select: none;
    user-select: none;
}

.submit-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(168, 85, 247, 0.6);
    opacity: 0.95;
}

.submit-btn.card:hover {
    transform: translateY(-8px);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.6);
    /* Deeper black shadow */
}

/* Black shadow instead of purple */

.close-pill-btn {
    padding: 10px 30px;
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 50px;
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.close-pill-btn:hover {
    background: rgba(0, 0, 0, 0.6);
    color: white;
    border-color: rgba(255, 255, 255, 0.2);
}

/* =========================================
   Article / Guide Page Styles
   ========================================= */

.article-container {
    max-width: 800px;
    margin: 40px auto;
    padding: 0 20px 80px 20px;
    /* Added bottom padding for floating button */
}

.glass-card {
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(40px);
    -webkit-backdrop-filter: blur(40px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 24px;
    padding: 40px;
    margin-bottom: 20px;
    color: white;
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.3);

    /* Prevent twitching */
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
    transform: translate3d(0, 0, 0);
    will-change: transform, opacity;
    contain: layout paint;
}

/* Typography Enhancements */
.glass-card h1 {
    font-size: 2.5rem;
    margin-bottom: 20px;
    margin-top: 10px;
    background: linear-gradient(to right, #fff, #cbd5e1);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    font-weight: 700;
    letter-spacing: -0.5px;
    line-height: 1.2;
}

.glass-card h2 {
    font-size: 1.8rem;
    margin-top: 40px;
    margin-bottom: 20px;
    color: #fff;
    border-left: 4px solid #3b82f6;
    padding-left: 20px;
    font-weight: 600;
}

.glass-card p {
    line-height: 1.9;
    /* Improved readability */
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: 20px;
    font-size: 1.05rem;
}

.glass-card ul {
    padding-left: 20px;
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: 20px;
}

.glass-card li {
    margin-bottom: 12px;
    line-height: 1.8;
}

.glass-card a {
    color: #60a5fa;
    text-decoration: none;
    border-bottom: 1px dashed rgba(96, 165, 250, 0.5);
    transition: all 0.3s ease;
}

.glass-card a:hover {
    color: #93c5fd;
    border-bottom-style: solid;
}

/* Image Enhancements */
.notion-content img {
    max-width: 100%;
    border-radius: 12px;
    margin: 20px 0;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    transition: transform 0.4s ease-out, box-shadow 0.4s ease, filter 0.4s ease;
    /* Bouncy transition */
    cursor: zoom-in;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.notion-content img:hover {
    transform: scale(1.08) translateY(-5px);
    /* Stronger pop */
    box-shadow: 0 20px 40px -5px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(255, 255, 255, 0.2);
    filter: brightness(1.05);
    z-index: 10;
    position: relative;
}

.image-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin: 20px 0;
}

/* Floating Back Button */
.floating-back-btn {
    position: fixed;
    bottom: 30px;
    right: 30px;
    display: flex;
    align-items: center;
    gap: 10px;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    padding: 12px 24px;
    border-radius: 50px;
    color: white;
    text-decoration: none;
    font-weight: 600;
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.3);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 100;
    /* Always stay at bottom right */
    top: auto !important;
}

.floating-back-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-5px) scale(1.05);
    box-shadow: 0 20px 30px -10px rgba(0, 0, 0, 0.5);
    border-color: rgba(255, 255, 255, 0.4);
}

.floating-back-btn i {
    margin-right: 0;
    /* No margin since text is removed */
    font-size: 1.2rem;
}

/* Hide back button on mobile (can swipe back) */
@media (max-width: 768px) {
    .floating-back-btn {
        display: none;
    }
}

/* Step Box (for Binding Guide) */
.step-box {
    background: rgba(255, 255, 255, 0.03);
    border-radius: 16px;
    padding: 24px;
    margin-bottom: 20px;
    display: flex;
    gap: 20px;
    align-items: flex-start;
    border: 1px solid rgba(255, 255, 255, 0.05);
    transition: background 0.3s ease;
}

.step-box:hover {
    background: rgba(255, 255, 255, 0.06);
}

.step-number {
    background: linear-gradient(135deg, #ec4899, #8b5cf6);
    color: white;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    flex-shrink: 0;
    box-shadow: 0 4px 10px rgba(236, 72, 153, 0.3);
}

.step-content {
    flex-grow: 1;
}

.step-title {
    font-weight: 700;
    font-size: 1.2rem;
    margin-bottom: 8px;
    color: white;
}



.bento-container {
    width: 100%;
    max-width: 1000px;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    grid-template-rows: auto auto auto;
    gap: 20px;
    padding: 20px;
}

/* Glass Card Base with 3D Liquid Effect */
.glass-box {
    background: rgba(255, 255, 255, 0.03);
    /* Lighter background */
    backdrop-filter: blur(16px);
    /* Reduced blur for thinner feel */
    -webkit-backdrop-filter: blur(16px);

    /* 3D Border Effect: Thinner and more subtle */
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-top: 1px solid rgba(255, 255, 255, 0.15);
    border-left: 1px solid rgba(255, 255, 255, 0.15);

    border-radius: 32px;
    padding: 24px;

    /* Multi-layer Shadows for Depth & Inner Glow - Reduced Intensity */
    box-shadow:
        /* External Shadow (Depth) */
        0 20px 40px -10px rgba(0, 0, 0, 0.4),
        /* Inner Glow (Liquid Feel) - softer */
        inset 0 1px 0 rgba(255, 255, 255, 0.1),
        inset 0 0 20px rgba(255, 255, 255, 0.01);

    transition: transform 0.3s ease-out, box-shadow 0.3s ease-out, background-color 0.3s ease, border-color 0.3s ease;
    will-change: transform, box-shadow;
    transform: translateZ(0);

    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    color: #fff;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    text-decoration: none;
}



/* Only apply hover effects on devices with hover capability (not touch screens) */
@media (hover: hover) {
    .glass-box {
        position: relative;
        overflow: hidden;
    }

    /* Flow of light effect - Mouse Following (Enhanced) */
    .glass-box::before {
        content: '';
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        border-radius: 24px;
        background: radial-gradient(600px circle at var(--mouse-x, 50%) var(--mouse-y, 50%),
                rgba(255, 255, 255, 0.15),
                transparent 40%);
        opacity: 0;
        transition: opacity 0.3s ease;
        pointer-events: none;
        mix-blend-mode: overlay;
    }

    .glass-box:hover::before {
        opacity: 0.4;
        /* Significantly reduced from 1 to avoid 'flash' */
    }

    .glass-box:hover {
        background: rgba(255, 255, 255, 0.05);
        border-color: rgba(255, 255, 255, 0.15);
        /* Even softer border change */
        transform: translateY(-1px);
        /* Barely noticeable lift */
        /* Corrected Shadow: Slight expansion to match lift, but very subtle */
        box-shadow:
            0 22px 42px -10px rgba(0, 0, 0, 0.45),
            /* Slightly deeper than base */
            inset 0 1px 0 rgba(255, 255, 255, 0.15),
            inset 0 0 20px rgba(255, 255, 255, 0.05);
    }
}

/* Add hover lift effect for static cards (not using elastic press) */
@media (hover: hover) {

    .box-contact:hover,
    .box-taobao:hover {
        transform: translateY(-2px) scale(1.01);
    }

    .box-contact,
    .box-taobao {
        transition: transform 0.5s ease-out, background 0.3s ease, box-shadow 0.3s ease;
    }
}

/* Non-interactive card: disable all interaction effects */
.glass-box.non-interactive {
    cursor: default !important;
}

.glass-box.non-interactive:hover::before {
    opacity: 0 !important;
}

.glass-box.non-interactive:hover {
    transform: none !important;
    background: rgba(255, 255, 255, 0.03) !important;
    border-color: rgba(255, 255, 255, 0.15) !important;
    box-shadow: 0 12px 24px -8px rgba(0, 0, 0, 0.4) !important;
}

.glass-box.glass-box-runtime-ready {
    opacity: 1 !important;
    animation: none !important;
}

@media (hover: hover) {
    .glass-box.glass-box-magnetic-entering {
        transition: transform 0.2s ease-out, box-shadow 0.25s ease-out;
    }

    .glass-box.glass-box-magnetic-tracking {
        transition: transform 0.05s linear, box-shadow 0.25s ease-out;
    }
}

.glass-box:active {
    transform: scale(0.98);
}

/* Adjust text colors for dark background */
.shop-title {
    color: rgba(255, 255, 255, 0.6);
}

.shop-heading {
    background: linear-gradient(45deg, #fff, #ccc);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.date-display {
    color: rgba(255, 255, 255, 0.6);
}

.box-sub {
    color: rgba(255, 255, 255, 0.6);
}

.glass-box {
    color: #fff;
}

.box-profile {
    background: rgba(255, 255, 255, 0.05);
}

.box-contact {
    background: linear-gradient(135deg, rgba(168, 237, 234, 0.2) 0%, rgba(254, 214, 227, 0.2) 100%);
}

.box-taobao {
    background: linear-gradient(135deg, rgba(255, 154, 158, 0.2) 0%, rgba(254, 207, 239, 0.2) 100%);
}


/* Specific Grid Areas */
.box-profile {
    grid-column: span 2;
    grid-row: span 2;
    align-items: flex-start;
    text-align: left;
    justify-content: space-between;
}

.box-contact {
    grid-column: span 2;
}

.box-taobao {
    grid-column: span 2;
}

.box-taobao .icon-large {
    color: #fff;
}

.box-small {
    grid-column: span 1;
    aspect-ratio: 1;
}

.box-wide {
    grid-column: span 2;
}

/* Typography & Icons */
.shop-title {
    font-size: 1.2rem;
    font-weight: 600;
    color: #86868b;
    margin-bottom: 5px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.shop-heading {
    font-size: 2.5rem;
    font-weight: 700;
    letter-spacing: -0.5px;
    margin-bottom: 10px;
    background: linear-gradient(45deg, #1d1d1f, #434344);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.clock-display {
    font-size: 3.5rem;
    font-weight: 800;
    font-variant-numeric: tabular-nums;
    letter-spacing: -2px;
    margin-top: auto;
}

.date-display {
    font-size: 1.2rem;
    font-weight: 500;
    color: #86868b;
}

.icon-large {
    font-size: 3rem;
    margin-bottom: 15px;
    color: #007aff;
}

.box-label {
    font-size: 1.1rem;
    font-weight: 600;
}

.box-sub {
    font-size: 0.9rem;
    color: #86868b;
    margin-top: 5px;
}

/* Redesigned Profile Card Layout */
.box-profile {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: stretch;
    text-align: left;
}

.profile-header {
    display: flex;
    justify-content: flex-end;
    align-items: flex-start;
}

.date-time-compact {
    text-align: right;
    font-variant-numeric: tabular-nums;
}

.profile-main {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding: 20px 0;
    width: 100%;
}

.shop-heading-large {
    font-size: 3.2rem;
    font-weight: 800;
    letter-spacing: -1px;
    margin: 15px 0;
    background: linear-gradient(135deg, #fff 0%, #e0e0e0 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    line-height: 1.1;
    text-align: center;
    width: 100%;
}

/* Card Heading */
.card-title {
    font-size: 32px;
    font-weight: 700;
    text-align: center;
    margin-bottom: 12px;
    color: white;
    letter-spacing: 0.5px;
}

.card-subtitle {
    font-size: 15px;
    text-align: center;
    color: rgba(255, 255, 255, 0.65);
    margin-bottom: 32px;
    font-weight: 400;
    line-height: 1.5;
}

.shop-subtitle {
    font-size: 1rem;
    color: rgba(255, 255, 255, 0.5);
    font-weight: 400;
    letter-spacing: 0.5px;
}

/* Gemini Star Icon with Google Colors */
.gemini-star {
    /* Use mask to apply gradient to SVG */
    background: linear-gradient(135deg,
            #4285f4 0%,
            /* Google Blue */
            #34a853 25%,
            /* Google Green */
            #fbbc04 50%,
            /* Google Yellow */
            #ea4335 75%,
            /* Google Red */
            #4285f4 100%
            /* Back to Blue */
        );
    -webkit-mask: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M12 0L14.5 9.5L24 12L14.5 14.5L12 24L9.5 14.5L0 12L9.5 9.5L12 0Z'/%3E%3C/svg%3E") no-repeat center / contain;
    mask: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M12 0L14.5 9.5L24 12L14.5 14.5L12 24L9.5 14.5L0 12L9.5 9.5L12 0Z'/%3E%3C/svg%3E") no-repeat center / contain;

    /* Fallback for mask support */
    color: transparent;

    animation: gemini-pulse 3s ease-in-out infinite;
}

@keyframes gemini-pulse {

    0%,
    100% {
        filter: brightness(1) drop-shadow(0 0 8px rgba(66, 133, 244, 0.3));
    }

    50% {
        filter: brightness(1.2) drop-shadow(0 0 15px rgba(66, 133, 244, 0.6));
    }
}

/* Notion Content Styles */
.notion-content {
    color: rgba(255, 255, 255, 0.9);
    line-height: 1.8;
    font-size: 1.05rem;
}

.notion-content h1 {
    font-size: 1.6rem;
    margin-top: 40px;
    margin-bottom: 20px;
    background: linear-gradient(to right, #fff, #cbd5e1);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding-bottom: 12px;
    font-weight: 700;
    letter-spacing: -0.5px;
}

.notion-content h3 {
    font-size: 1.25rem;
    margin-top: 30px;
    margin-bottom: 15px;
    color: #fff;
    border-left: 3px solid #3b82f6;
    padding-left: 12px;
    font-weight: 600;
}

.notion-content p {
    margin-bottom: 16px;
    color: rgba(255, 255, 255, 0.85);
    line-height: 1.7;
    font-size: 1rem;
}

.notion-content img {
    max-width: 100%;
    height: auto;
    border-radius: 16px;
    margin: 20px 0;
    display: block;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 8px 20px -5px rgba(0, 0, 0, 0.3);
    transition: transform 0.3s ease;
}

.notion-content img:hover {
    transform: scale(1.01);
}

/* Image Grid for consecutive images */
.image-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 15px;
    margin: 25px 0;
}

.image-grid img {
    max-width: 100%;
    margin: 0;
    height: 100%;
    object-fit: cover;
    aspect-ratio: 16/9;
    /* Uniform aspect ratio */
}

.notion-content a {
    color: #60a5fa;
    text-decoration: none;
    border-bottom: 1px dashed rgba(96, 165, 250, 0.4);
    transition: all 0.3s;
    font-weight: 500;
}

.notion-content a:hover {
    color: #93c5fd;
    border-bottom-style: solid;
}

.notion-content ul {
    background: rgba(255, 255, 255, 0.03);
    border-radius: 16px;
    padding: 25px 25px 25px 45px;
    margin: 20px 0;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.notion-content li {
    margin-bottom: 12px;
}

.notion-content strong {
    color: #fff;
    font-weight: 600;
}

/* Modal Styles */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    /* Use bottom: 0 to ensure full coverage regardless of address bar */
    height: auto;
    background: var(--app-modal-backdrop);
    backdrop-filter: var(--app-modal-backdrop-filter);
    -webkit-backdrop-filter: var(--app-modal-backdrop-filter);
    z-index: 9999;
    /* Very high z-index to appear above mobile browser UI */
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    visibility: hidden;
    /* Start hidden */
    pointer-events: none;
    /* Transition opacity smoothly, delay visibility hide until opacity is done */
    transition: opacity 0.3s ease, visibility 0s linear 0.3s;
    will-change: opacity;
    /* Optimize animation */
    transform: translateZ(0);
    /* Hardware acceleration */
}


.modal-overlay.active {
    opacity: 1;
    visibility: visible;
    pointer-events: all !important;
    /* Show immediately */
    transition: opacity 0.3s ease, visibility 0s linear 0s;
}


.modal-content {
    background: rgba(255, 255, 255, 0.03) !important;
    /* Ultra light glassmorphism matching login card */
    padding: 50px;
    border-radius: 24px;
    text-align: center;
    max-width: 90%;
    width: 480px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    border-top: 1px solid rgba(255, 255, 255, 0.2) !important;
    backdrop-filter: blur(20px) saturate(150%) !important;
    /* Exact match: 20px blur + 150% saturation */
    -webkit-backdrop-filter: blur(20px) saturate(150%) !important;
    transform: scale(0.95);
    /* Unified with login modal */
    transition: transform 0.3s ease-out;
    /* Elastic easing */
    will-change: transform;
    /* Optimize animation */
    backface-visibility: hidden;
    /* Hardware acceleration */
    color: white;
    position: relative;
    z-index: 1;

    /* Dark-themed scrollbar */
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.15) transparent;
}

.modal-content::-webkit-scrollbar {
    width: 6px;
}

.modal-content::-webkit-scrollbar-track {
    background: transparent;
}

.modal-content::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.15);
    border-radius: 3px;
}

.modal-content::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.25);
}

/* Also style modal overlay scrollbar */
.modal-overlay::-webkit-scrollbar {
    width: 6px;
}

.modal-overlay::-webkit-scrollbar-track {
    background: transparent;
}

.modal-overlay::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.15);
    border-radius: 3px;
}

.modal-overlay::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.25);
}

.modal-overlay {
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.15) transparent;
}

.modal-overlay.active .modal-content {
    transform: scale(1);
    pointer-events: auto !important;
}

.modal-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-top: 30px;
}

.modal-link-card {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 24px;
    padding: 30px 20px;
    text-decoration: none;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: fit-content;
    max-width: 100%;
    margin: 0 auto;
    position: relative;
    /* Added for popup positioning */
    -webkit-backdrop-filter: blur(20px);
    backdrop-filter: blur(20px);
}

/* Contact Popup (Tooltip) */
.contact-popup {
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%) translateY(10px);
    background: rgba(12, 12, 12, 0.96);
    -webkit-backdrop-filter: blur(65px);
    backdrop-filter: blur(65px);
    padding: 15px;
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    pointer-events: none;
    z-index: 100;
    width: max-content;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

.modal-link-card:hover .contact-popup {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(-15px);
}

/* Arrow for popup */
.contact-popup::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border-width: 8px;
    border-style: solid;
    border-color: rgba(12, 12, 12, 0.96) transparent transparent transparent;
}

/* Ensure text is white on dark background */
.contact-popup .contact-detail {
    color: rgba(255, 255, 255, 0.95) !important;
}

.contact-popup .contact-hint {
    color: rgba(255, 255, 255, 0.7) !important;
}

/* Email popup needs higher opacity to match WeChat visual density */
.email-popup {
    background: rgba(12, 12, 12, 0.98) !important;
}

.email-popup::after {
    border-color: rgba(12, 12, 12, 0.98) transparent transparent transparent !important;
}

.qr-code {
    width: 140px;
    height: 140px;
    border-radius: 8px;
    display: block;
}

/* Flexbox Masonry Layout */
.message-container {
    display: flex;
    gap: 20px;
    align-items: flex-start;
    width: 100%;
    background: transparent !important;
}

.masonry-column {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 20px;
    min-width: 0;
    background: transparent !important;
}

@media (max-width: 1024px) {
    .message-container {
        gap: 15px;
    }

    .masonry-column {
        gap: 15px;
    }
}

.modal-content a {
    text-decoration: none;
    color: inherit;
}

.modal-link-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.3);
    border-color: rgba(255, 255, 255, 0.2);
    background: rgba(255, 255, 255, 0.08);
    /* Slight brightness increase */
}

.modal-link-card i {
    font-size: 4rem;
    margin-bottom: 15px;
    background: linear-gradient(135deg, #38bdf8 0%, #818cf8 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.link-title {
    font-size: 1.2rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.9);
}

.modal-title {
    font-size: 2rem;
    font-weight: 800;
    margin-bottom: 0;
    margin-top: 10px;
    /* 恢复纯色 */
    color: #ffffff;
    letter-spacing: -0.5px;
    flex-shrink: 0;
}

.modal-text {
    font-size: 1.2rem;
    color: rgba(255, 255, 255, 0.8);
    margin-bottom: 20px;
    padding: 15px;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 15px;
    word-break: break-all;
    cursor: pointer;
    /* Suggest copy */
}

.qr-placeholder {
    width: 200px;
    height: 200px;
    background: #fff;
    margin: 0 auto 20px;
    display: flex;
    justify-content: center;
    align-items: center;
    border-radius: 20px;
    border: 1px solid #e5e5ea;
}

.qr-placeholder i {
    font-size: 100px;
    color: #1aad19;
    /* WeChat Green */
}

.close-btn {
    background: rgba(255, 255, 255, 0.1);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 12px 30px;
    border-radius: 20px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.close-btn:hover {
    transform: scale(1.05);
    background: rgba(255, 255, 255, 0.2);
}

/* Contact Card Specific Styles */
.contact-card {
    cursor: pointer;
}

.contact-card:first-child i {
    background: linear-gradient(135deg, #ea4335 0%, #fbbc04 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.contact-card:last-child i {
    color: #1aad19;
    background: none;
    -webkit-text-fill-color: #1aad19;
}

.contact-detail {
    font-size: 0.95rem;
    color: rgba(255, 255, 255, 0.7);
    margin-top: 10px;
    font-weight: 500;
}

.contact-hint {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.5);
    margin-top: 5px;
}



/* Enhanced backdrop blur for glass effect */
.glass-box {
    backdrop-filter: blur(40px) saturate(150%);
    -webkit-backdrop-filter: blur(40px) saturate(150%);
}

/* Prevent page scroll when modal is open */
html.no-scroll,
body.no-scroll {
    overflow: hidden !important;
    overscroll-behavior: none !important;
    /* remove height: 100vh restriction which causes scroll jump on mobile */
}

body.ios-scroll-lock-fixed {
    position: fixed;
    left: 0;
    right: 0;
    width: 100%;
    top: var(--ios-scroll-lock-offset, 0px);
}

/* Prevent scroll chaining */
.modal-overlay {
    overscroll-behavior: contain;
    /* Ensure the overlay itself handles touch events properly */
    touch-action: pan-y;
}

.modal-content {
    overscroll-behavior: contain;
    /* Re-enable touch actions for the content */
    touch-action: pan-y;
}

@media (max-width: 768px) {

    /* Optimize Bento Grid for mobile: 2 columns, smaller padding */
    .bento-container {
        grid-template-columns: repeat(2, 1fr);
        grid-template-rows: auto;
        gap: 10px;
        padding: 10px;
        /* Add top margin to avoid overlapping with user avatar */
        margin-top: 35px;
    }

    /* Profile card spans full width */
    .box-profile {
        grid-column: span 2;
        grid-row: span 1;
        padding: 20px 16px !important;
        position: relative;
        min-height: 120px;
    }

    /* Hide empty profile-header on mobile */
    .box-profile .profile-header:empty {
        display: none;
    }

    .box-profile .profile-main {
        height: 100%;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    /* Reduce modal size on mobile to avoid "oppressive" feel - AGGRESSIVE OVERRIDE */
    div.modal-overlay .modal-content,
    div.modal-overlay.active .modal-content {
        width: 85vw !important;
        max-width: 320px !important;
        max-height: 75vh !important;
        /* Reduced to 75vh for better mobile fit */
        /* Reduced from 95vh to ensure bottom edge is visible */
        padding: 20px !important;
        padding-bottom: 20px !important;
        /* Reduced padding, relying on spacer now */
        border-radius: 20px !important;
        margin: auto !important;
        position: relative !important;
        top: auto !important;
        left: auto !important;
        transform: scale(0.95) !important;
        opacity: 0;
        transition: transform 0.3s ease-out, opacity 0.3s ease !important;
        overflow-y: scroll !important;
        -webkit-overflow-scrolling: touch !important;
    }

    div.modal-overlay.active .modal-content {
        transform: scale(1) !important;
        opacity: 1 !important;
    }

    /* --- Compact Guestbook Modal (Mobile) --- */
    .guestbook-content .modal-title {
        margin-bottom: 4px !important;
        font-size: 1.2rem !important;
    }

    .guestbook-content .modal-subtitle {
        margin-bottom: 12px !important;
        font-size: 0.75rem !important;
        line-height: 1.3;
    }

    .guestbook-content .input-group {
        margin-bottom: 8px !important;
    }

    .guestbook-content input,
    .guestbook-content textarea {
        padding: 10px 12px !important;
        padding-right: 50px !important;
        /* Prevent text overlap with camera icon */
        font-size: 16px !important;
        /* CRITICAL: iOS Safari zooms if < 16px */
        border-radius: 12px !important;
        background: rgba(0, 0, 0, 0.2) !important;
        border: 1px solid rgba(255, 255, 255, 0.1) !important;
        color: white !important;
    }

    .guestbook-content input:focus,
    .guestbook-content textarea:focus {
        border-color: #9b5de5 !important;
        background: rgba(0, 0, 0, 0.4) !important;
    }

    .guestbook-content textarea {
        height: 70px !important;
        /* Shorter textarea */
    }

    .guestbook-content .submit-btn {
        padding: 10px !important;
        margin-top: 5px !important;
        font-size: 0.9rem !important;
        border-radius: 10px !important;
    }



    /* Contact Modal: 2 columns side-by-side */
    .modal-grid {
        grid-template-columns: 1fr 1fr !important;
        gap: 10px !important;
        /* Tighter gap */
        margin-top: 15px !important;
    }

    /* Compact Contact Cards */
    .modal-link-card {
        padding: 12px 8px !important;
        /* Tighter padding */
        width: 100% !important;
        min-height: 100px;
        /* Slightly shorter */
    }

    .modal-link-card i {
        font-size: 1.8rem !important;
        /* Smaller icons */
        margin-bottom: 6px !important;
    }

    .link-title {
        font-size: 0.85rem !important;
    }

    .contact-detail {
        font-size: 0.75rem !important;
        word-break: break-all;
    }

    .contact-hint {
        font-size: 0.65rem !important;
    }

    /* Move time/date to top-right corner on mobile */
    .profile-header {
        position: absolute;
        top: 16px;
        right: 16px;
        text-align: right;
    }

    .date-time-compact {
        text-align: right;
    }

    /* Adjust main content alignment */
    .profile-main {
        text-align: center;
        margin-top: 10px !important;
        padding-top: 0;
    }

    .shop-heading-large {
        font-size: 1.8rem !important;
        margin-bottom: 6px !important;
    }

    .shop-subtitle {
        font-size: 0.9rem !important;
    }

    /* Contact and Taobao each take 1 column */
    .box-contact,
    .box-taobao {
        grid-column: span 1;
    }

    /* 三维设计 and 影视后期 each take 1 column (side by side) */
    .box-small {
        grid-column: span 1;
    }

    /* Guestbook, Gemini, and Google span full width */
    .box-wide {
        grid-column: span 2;
    }

    .clock-display {
        font-size: 2.5rem;
        margin-top: 20px;
    }

    /* Move "Back to Home" button to top-left on mobile */
    /* Move "Back to Home" button to top-left on mobile */
    .floating-back-btn {
        display: none !important;
    }

    /* Optimize modal size for mobile */
    .premium-modal {
        max-width: 95% !important;
        width: 95% !important;
        padding: 20px !important;
        margin: 10px;
        max-height: 90vh;
        overflow-y: auto;
    }

    .modal-title {
        font-size: 1.4rem !important;
    }

    .modal-subtitle {
        font-size: 0.85rem !important;
    }

    /* Single column layout for modal grid on mobile */
    .modal-grid {
        grid-template-columns: 1fr !important;
        gap: 15px !important;
        margin-top: 20px !important;
    }

    .modal-link-card {
        padding: 20px !important;
    }

    /* ========================================
       Mobile Optimizations for Article Pages
       ======================================== */

    /* Reduce container padding */
    .article-container {
        margin: 20px auto !important;
        padding: 0 12px 60px 12px !important;
    }

    /* Reduce glass card padding */
    .glass-box {
        padding: 16px 10px !important;
        margin-bottom: 0 !important;
        border-radius: 20px !important;
    }

    /* Optimize typography for mobile */
    .glass-card h1 {
        font-size: 1.6rem !important;
        margin-bottom: 12px !important;
        margin-top: 8px !important;
        line-height: 1.3 !important;
    }

    .glass-card h2 {
        font-size: 1.3rem !important;
        margin-top: 24px !important;
        margin-bottom: 12px !important;
        padding-left: 12px !important;
    }

    .glass-card h3 {
        font-size: 1.1rem !important;
        margin-top: 20px !important;
        margin-bottom: 10px !important;
    }

    .glass-card p {
        font-size: 0.95rem !important;
        line-height: 1.6 !important;
        margin-bottom: 12px !important;
    }

    .glass-card li {
        font-size: 0.95rem !important;
        margin-bottom: 8px !important;
        line-height: 1.6 !important;
    }

    .glass-card ul {
        padding-left: 16px !important;
        margin-bottom: 12px !important;
    }

    /* Optimize images for mobile */
    .notion-content img {
        margin: 12px 0 !important;
        border-radius: 8px !important;
        max-width: 100% !important;
        height: auto !important;
    }

    /* Disable hover effects on images for mobile */
    .notion-content img:hover {
        transform: none !important;
        box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1) !important;
        filter: none !important;
    }

    /* Optimize image grids for mobile */
    .image-grid {
        grid-template-columns: 1fr !important;
        gap: 10px !important;
        margin: 12px 0 !important;
    }

    .image-grid-2 {
        grid-template-columns: 1fr !important;
        gap: 10px !important;
    }

    .image-grid-3 {
        grid-template-columns: 1fr !important;
        gap: 10px !important;
    }

    /* Reduce code block padding */
    .glass-card pre {
        padding: 12px !important;
        margin: 12px 0 !important;
        font-size: 0.85rem !important;
    }

    .glass-card code {
        font-size: 0.85rem !important;
    }
}

/* Disable touch callout (long-press menu) on all interactive elements */
.glass-box,
.modal-link-card,
.floating-back-btn,
.icon-large,
.gemini-star,
img,
svg {
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
    /* Prevent text selection and callout menu */
}

/* Lightbox Styles */
.lightbox-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    z-index: 2000;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.lightbox-overlay[hidden] {
    display: none;
}

.lightbox-overlay.active {
    opacity: 1;
}

.lightbox-image {
    max-width: 90%;
    max-height: 90vh;
    border-radius: 8px;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.5);
    transform: scale(0.9);
    transition: transform 0.3s ease-out;
}

.lightbox-overlay.active .lightbox-image {
    transform: scale(1);
}

/* Contact Modal Specifics */
.modal-link-card .fa-weixin {
    font-size: 3.5rem;
    margin-bottom: 0;
    /* No text below */
    color: #07c160 !important;
    background: none !important;
    -webkit-text-fill-color: #07c160 !important;
}

.modal-link-card .fa-envelope {
    font-size: 3.2rem;
    margin-bottom: 0;
    /* No text below */
    background: linear-gradient(135deg, #facc15, #f59e0b);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.contact-hint {
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.9);
    /* Increased visibility */
    margin-top: 4px;
    font-weight: 500;
    letter-spacing: 0.5px;
}

/* Guestbook Message List Styles */
.message-list-container {
    margin-top: 30px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: 20px;
    text-align: left;
}

.message-list-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.9rem;
    font-weight: 600;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 8px;
}

.clear-btn {
    background: transparent;
    border: none;
    color: rgba(255, 255, 255, 0.5);
    font-size: 0.8rem;
    cursor: pointer;
    transition: color 0.2s ease;
    padding: 4px 8px;
    border-radius: 4px;
}

.clear-btn:hover {
    color: #ef4444;
    /* Red-500 */
    background: rgba(239, 68, 68, 0.1);
}

.message-count {
    background: rgba(255, 255, 255, 0.1);
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 0.8rem;
}

.message-list {
    max-height: 300px;
    overflow-y: auto;
    padding-right: 5px;
    /* Custom Scrollbar for Webkit */
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.2) transparent;
}

.message-list::-webkit-scrollbar {
    width: 4px;
}

.message-list::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 4px;
}

/* Message Card in Modal - Ultra Transparent Glass */
.message-card {
    background: rgba(255, 255, 255, 0.03);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-top: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 16px;
    padding: 20px;
    margin-bottom: 15px;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.message-card:hover {
    background: rgba(255, 255, 255, 0.06);
    transform: translateX(2px);
}

.msg-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 6px;
    font-size: 0.85rem;
}

.msg-name {
    font-weight: 700;
    color: #60a5fa;
    /* Blue-400 */
}

.msg-time {
    color: rgba(255, 255, 255, 0.4);
    font-size: 0.75rem;
}

.msg-content {
    color: rgba(255, 255, 255, 0.9);
    font-size: 0.95rem;
    line-height: 1.5;
    word-wrap: break-word;
}

.empty.no-comments {
    text-align: center;
    color: rgba(255, 255, 255, 0.5);
    padding: 30px 20px;
    font-size: 0.9rem;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ==================== Image Upload Styles ==================== */
.image-upload-wrapper {
    margin: 15px 0;
}

.upload-btn {
    width: 100%;
    padding: 14px 20px;
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.2), rgba(59, 130, 246, 0.2));
    border: 2px dashed rgba(139, 92, 246, 0.4);
    border-radius: 12px;
    color: rgba(255, 255, 255, 0.85);
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.card {
    background: linear-gradient(135deg,
            rgba(255, 255, 255, 0.05) 0%,
            rgba(255, 255, 255, 0.02) 100%);
    border: 1px solid var(--card-border);
    border-radius: 24px;
    padding: 25px;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    /* Slower box-shadow for visible lift animation, fast transform is handled by JS */
    transition: transform 0.3s ease-out, box-shadow 0.25s ease-out;
    cursor: pointer;
}

/* Card hover - DEEP BLACK SHADOW ONLY */
.card:hover {
    transform: translateY(-8px);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.7),
        0 12px 24px -8px rgba(0, 0, 0, 0.5);
}

.upload-btn:hover {
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.3), rgba(59, 130, 246, 0.3));
    border-color: rgba(139, 92, 246, 0.6);
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(139, 92, 246, 0.25);
}

.upload-btn i {
    font-size: 1.1rem;
}

/* Mac Window Controls - Red Only */
.mac-controls {
    position: absolute;
    top: 20px;
    left: 20px;
    display: flex;
    gap: 8px;
    z-index: 10;
}

.mac-dot {
    width: 16px;
    /* Larger size */
    height: 16px;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.mac-dot.red {
    background: #ff5f56;
    border: 1px solid #e0443e;
}

/* Hide others */
.mac-dot.yellow,
.mac-dot.green {
    display: none;
}

.mac-dot.red i {
    font-size: 10px;
    color: #4a0002;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.mac-controls:hover .mac-dot.red i {
    opacity: 1;
}

/* Hide mac controls on mobile */
@media (max-width: 768px) {
    .mac-controls {
        display: none !important;
    }
}

.relative-container {
    position: relative;
}

.upload-icon-wrapper {
    position: absolute;
    bottom: 12px;
    right: 12px;
}

.upload-icon-btn,
button.upload-icon-btn {
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    /* Rounded square */
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: rgba(255, 255, 255, 0.8);
    cursor: pointer !important;
    transition: all 0.3s ease;
    position: relative;
    z-index: 100 !important;
    pointer-events: auto !important;
    -webkit-user-select: none;
    user-select: none;
}

.upload-icon-btn:hover {
    background: rgba(56, 189, 248, 0.3);
    border-color: rgba(56, 189, 248, 0.5);
    color: #38bdf8;
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
}

.image-preview,
.image-preview-compact {
    margin-top: 15px;
    position: relative;
    border-radius: 12px;
    overflow: hidden;
    background: rgba(0, 0, 0, 0.3);
    animation: fadeIn 0.3s ease;
}

.image-preview img,
.image-preview-compact img {
    width: 100%;
    max-height: 120px;
    /* Strictly limit height */
    object-fit: cover;
    border-radius: 8px;
    display: block;
    margin-top: 0;
    /* Remove top margin as container handles it */
}

/* Responsive Column Layout - REMOVED (Replaced by Flexbox Masonry in guestbook.js) */
/* Old column-count styles deleted to prevent conflicts */



.message-footer-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 16px;
}

.author-info {
    display: flex;
    align-items: center;
    gap: 6px;
    color: rgba(255, 255, 255, 0.5);
    /* Dimmer */
    font-size: 0.8rem;
    /* Smaller */
}

.author-name {
    font-weight: 400;
    /* Normal weight */
    color: rgba(255, 255, 255, 0.6);
    /* Unified gray/white */
}

.message-time {
    font-size: 0.75rem;
    color: rgba(0, 0, 0, 0.35);
}

.comment-section {
    margin-top: 10px;
    background: rgba(0, 0, 0, 0.02);
    /* 极淡的背景 */
    border: 1px solid rgba(0, 0, 0, 0.03);
    /* 极淡的边框 */
    border-radius: 8px;
    padding: 12px;
    padding-top: 20px;
    /* 防止第一条评论抬起时被裁切 */
    overflow: visible;
    /* 允许抬起的评论完全显示 */
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.06);
    /* 极淡的内阴影 */
}

.comment-header-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.comment-count-group {
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.5);
    display: flex;
    align-items: center;
    gap: 5px;
}

.add-comment-trigger-btn {
    background: transparent;
    border: 1px solid #f59e0b;
    color: #f59e0b;
    padding: 6px 14px;
    border-radius: 8px;
    font-size: 0.85rem;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 6px;
}

.add-comment-trigger-btn:hover {
    background: rgba(245, 158, 11, 0.1);
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(245, 158, 11, 0.2);
}

.remove-image-btn {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(239, 68, 68, 0.9);
    border: none;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.remove-image-btn:hover {
    background: rgba(239, 68, 68, 1);
    transform: scale(1.1);
}

/* Standardized Button Gradient */
/* Standardized Button Gradient */
.submit-btn,
.floating-back-btn,
.login-submit-btn {
    background: linear-gradient(135deg, #9b5de5 0%, #f15bb5 100%);
    color: white;
    border: none;
    transition: opacity 0.2s, transform 0.2s;
    max-width: 200px;
    margin: 0 auto;
    display: block;
}

.submit-btn:hover,
.floating-back-btn:hover,
.login-submit-btn:hover {
    opacity: 0.9;
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(155, 93, 229, 0.4);
}



/* Ensure floating back button specific positioning remains */
.floating-back-btn {
    position: fixed;
    top: 30px;
    left: 30px;
    padding: 10px 20px;
    border-radius: 50px;
    text-decoration: none;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 8px;
    z-index: 100;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

/* Standardized Modal Backgrounds - Ultra Transparent Glass (Login Card Style) */
.modal-content,
.premium-modal,
.login-card {
    background: rgba(0, 0, 0, 0.1);
    /* Much lighter black transparent */
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-top: 1px solid rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(20px) saturate(150%);
    /* Added saturate for brighter glass effect */
    -webkit-backdrop-filter: blur(20px) saturate(150%);
    color: white;
    transform: scale(0.95);
    /* Reverted to scale */
    opacity: 0;
    transition: all 0.3s ease-out;
}

.modal-overlay.active .modal-content {
    transform: scale(1);
    opacity: 1;
}

.view-more-btn i {
    font-size: 1.1rem;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ==================== Guestbook Page Styles ==================== */
.guestbook-page {
    min-height: 100vh;
    background: transparent;
    /* Allow blobs to show through */
    position: relative;
    overflow-x: hidden;
}

body.guestbook-page #ambientCanvas,
body.guestbook-page #starryCanvas {
    transform: translateZ(0);
    -webkit-transform: translateZ(0);
    will-change: transform, opacity;
    pointer-events: none;
}

body.guestbook-page #ambientCanvas {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    opacity: 0.6;
    transition: opacity 0.5s ease;
}

[data-theme="dark"] body.guestbook-page #ambientCanvas {
    opacity: 0;
}

html.guestbook-document[data-theme="dark"],
html.guestbook-document[data-theme="dark"] body,
html.guestbook-document[data-theme="dark"] body.guestbook-page {
    background: #000000 !important;
    background-color: #000000 !important;
    color-scheme: dark;
}

body.guestbook-page #starryCanvas {
    position: fixed;
    top: -10vh;
    left: -10vw;
    width: 120vw;
    height: 120vh;
    z-index: 0;
    opacity: 0;
    transition: opacity 1.5s ease;
}

[data-theme="dark"] body.guestbook-page #starryCanvas {
    opacity: 1;
}

body.guestbook-page.auth-sheet-open #ambientCanvas {
    opacity: 0 !important;
    transition: none !important;
}

html[data-theme="dark"] body.guestbook-page.auth-sheet-open #starryCanvas {
    opacity: 1 !important;
    transition: none !important;
}

html[data-theme="dark"] body.guestbook-page.auth-sheet-open::before,
html[data-theme="dark"] body.guestbook-page.auth-sheet-open::after {
    content: none !important;
    display: none !important;
}

/* Floating Back Button */
.floating-back-btn {
    position: fixed;
    bottom: 30px;
    right: 30px;
    top: auto;
    left: auto;
    z-index: 1000;
    padding: 12px 24px;
    background: rgba(30, 41, 59, 0.6);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 50px;
    color: white;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    overflow: hidden;
    display: inline-flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    width: fit-content !important;
    /* Force fit content */
    min-width: unset;
    /* Remove min-width constraint */
    max-width: 140px;
    /* Prevent huge width */
    height: 44px;
    /* Fixed height for consistency */
    white-space: nowrap;

    /* Fix for scroll twitching - Robust Hardware Acceleration */
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
    transform: translate3d(0, 0, 0);
    /* Stronger GPU promotion */
    will-change: transform;
    contain: layout paint;
    /* Isolate rendering */
}

.floating-back-btn:hover {
    transform: translateY(-2px) translate3d(0, 0, 0);
    box-shadow: 0 8px 25px rgba(239, 68, 68, 0.2);
    /* More subtle shadow */
    background: rgba(30, 41, 59, 0.9);
    border-color: rgba(239, 68, 68, 0.4);
    color: #f87171;
}

/* Subtle Circular Flow Border Effect */
@keyframes borderRotate {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

.floating-back-btn::before {
    content: '';
    position: absolute;
    inset: -1px;
    /* Thinner border */
    border-radius: 50px;
    padding: 1px;
    /* Subtle gradient */
    background: conic-gradient(from 0deg, transparent 0%, rgba(255, 255, 255, 0.4) 15%, transparent 30%);
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.floating-back-btn:hover::before {
    opacity: 0;
    animation: none;
    /* Slower animation */
}


.guestbook-main {
    max-width: 1600px;
    margin: 80px auto 40px;
    padding: 0 40px;
}

.message-container {
    /* column-count is defined in responsive media queries above */
    column-gap: 20px;
    padding-top: 20px;
    /* 防止第一个卡片抬起时被裁切 */
    overflow: visible;
    /* 允许抬起的卡片完全显示 */
}

.message-container.message-container--single-column {
    display: block;
    width: 100%;
}

.message-container.message-container--masonry {
    display: flex;
    width: 100%;
}

.guestbook-loading-state {
    padding: 20px;
    text-align: center;
    color: rgba(255, 255, 255, 0.5);
    font-size: 0.9rem;
}

.guestbook-message-error {
    margin: 0;
    color: #ef4444;
    text-align: center;
}

/* Message Animation Wrapper - 防止白色闪烁 */
.message-anim-wrapper {
    --guestbook-stagger-delay: 0s;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
    transition-delay: var(--guestbook-stagger-delay);
}

.message-anim-wrapper.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Message Item Card - 半透明卡片，hover变全白 */
.message-item {
    background: #182634;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;

    border-radius: 16px;
    padding: 24px;
    margin-bottom: 20px;

    /* 细腻边框 */
    border: 1px solid rgba(255, 255, 255, 0.08);

    /* 柔和阴影 */
    box-shadow:
        0 10px 24px rgba(0, 0, 0, 0.18),
        inset 0 1px 0 rgba(255, 255, 255, 0.05);

    transition: all 0.5s ease-out;
    transform-origin: center;

    /* ⚡ PERF: GPU Acceleration & Rendering Optimization */
    transform: translateZ(0);
    will-change: transform;
}

.message-item:hover {
    background: #182634;
    border-color: rgba(255, 255, 255, 0.12);
    transform: translateY(-2px);

    box-shadow:
        0 14px 32px rgba(0, 0, 0, 0.24),
        inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.message-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.author-info {
    display: flex;
    align-items: center;
    gap: 8px;
}

.author-info i {
    font-size: 0.95rem;
    color: rgba(226, 232, 240, 0.5);
}

.author-name {
    font-weight: 600;
    font-size: 0.85rem;
    color: rgba(241, 245, 249, 0.9);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 150px;
}

.message-time {
    font-size: 0.8rem;
    color: rgba(203, 213, 225, 0.56);
}

.message-content {
    font-size: 0.95rem;
    line-height: 1.6;
    color: rgba(241, 245, 249, 0.92);
    margin-bottom: 8px;
    white-space: pre-wrap;
    word-wrap: break-word;
    overflow-wrap: break-word;
    word-break: break-word;
}

.message-image {
    margin: 15px 0;
    position: relative;
    display: block;
    width: 100%;
    aspect-ratio: 2 / 1;
    border-radius: 12px;
    overflow: hidden;
    background: linear-gradient(135deg, rgba(15, 23, 42, 0.6), rgba(30, 41, 59, 0.38));
    max-width: 100%;
    isolation: isolate;
}

.message-image::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(110deg,
            rgba(255, 255, 255, 0.02) 0%,
            rgba(255, 255, 255, 0.08) 22%,
            rgba(255, 255, 255, 0.02) 44%,
            rgba(255, 255, 255, 0.02) 100%);
    transform: translateX(-165%);
    animation: guestbookSkeletonShimmer 1.6s linear infinite;
    transition: opacity 0.2s ease;
    pointer-events: none;
}

.message-image.is-loaded::before {
    opacity: 0;
    animation: none;
}

.message-image img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
    object-position: center;
    cursor: pointer;
    pointer-events: none;
    opacity: 0;
    transform: scale(1.015);
    transition: opacity 0.24s ease, transform 0.3s ease;
}

.message-image img.is-loaded {
    pointer-events: auto;
    opacity: 1;
    transform: scale(1);
}

.message-image img:hover {
    transform: scale(1.02);
}

/* Comment Section */
.comment-section {
    margin-top: 0;
    padding-top: 8px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.comment-header-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.comment-count-group {
    display: flex;
    align-items: center;
    gap: 6px;
    font-weight: 600;
    color: rgba(0, 0, 0, 0.6);
    font-size: 0.85rem;
}

.comment-count-group i {
    color: #f59e0b;
}

.comment-list {
    margin-bottom: 15px;
}

.comment-item {
    background: transparent;
    border: none;
    /* Removed padding from container to fix nested alignment */
    padding: 0;
    margin-bottom: 12px;
    /* 渐进式圆角方案：主评论容器添加8px圆角，避免高亮启动时的"直角→圆角"闪烁 */
    border-radius: 8px;
}

.comment-item--depth-1 {
    margin-left: 10px;
}

.comment-item--depth-2 {
    margin-left: 20px;
}

.comment-row {
    display: flex;
    /* Flex layout for side-by-side content & like */
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    width: 100%;
    /* Moved styles from comment-item to comment-row */
    padding: 8px 12px;
    border-radius: 6px;
    /* 从 12px 改为 6px，配合容器的 8px 形成层次感 */
    transition:
        background 0.22s ease,
        border-color 0.22s ease,
        box-shadow 0.22s ease,
        transform 0.22s ease;
    position: relative;
}

/* Google Login Button - Transparent with icon + text only */
.google-login-btn {
    position: relative;
    z-index: 10;
    pointer-events: auto !important;
    width: 100%;
    padding: 14px 20px;
    border-radius: 14px;
    background: transparent;
    color: rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(255, 255, 255, 0.15);
    font-weight: 500;
    font-size: 15px;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 12px;
    cursor: pointer !important;
    transition: all 0.25s ease;
    margin-bottom: 28px;
    backdrop-filter: blur(10px);
}

.google-login-btn:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.25);
    transform: translateY(-1px);
}

#loginModal.auth-sheet-overlay .auth-sheet-google-btn.google-login-btn {
    width: 100% !important;
    min-height: 44px !important;
    padding: 10px 14px !important;
    margin: 4px 0 0 !important;
    border-radius: 15px !important;
    background: var(--auth-sheet-google-bg) !important;
    border: 1px solid var(--auth-sheet-google-border) !important;
    color: var(--auth-sheet-text) !important;
    font-size: 13px !important;
    font-weight: 600 !important;
    gap: 10px !important;
    box-shadow: none !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
}

#loginModal.auth-sheet-overlay .auth-sheet-google-btn.google-login-btn:hover {
    transform: translate3d(0, -1px, 0) !important;
    background: var(--auth-sheet-google-bg-hover) !important;
    border-color: var(--auth-sheet-google-border-hover) !important;
    color: var(--auth-sheet-text) !important;
    box-shadow: var(--auth-sheet-control-shadow-hover) !important;
}

html[data-theme="light"] #loginModal.auth-sheet-overlay .auth-sheet-google-btn.google-login-btn:hover,
html:not([data-theme="dark"]) #loginModal.auth-sheet-overlay .auth-sheet-google-btn.google-login-btn:hover {
    transform: none !important;
    background: rgba(255, 255, 255, 0.96) !important;
    border-color: rgba(107, 158, 206, 0.34) !important;
    color: var(--auth-sheet-text) !important;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.05) !important;
}

#loginModal.auth-sheet-overlay .auth-sheet-google-btn.google-login-btn span {
    color: inherit !important;
}

/* Divider */
.login-divider {
    margin: 0 0 28px 0;
    text-align: center;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.login-divider::before {
    display: none;
}

.login-divider::after {
    content: "";
    flex: 1;
    height: 1px;
    background: rgba(255, 255, 255, 0.3);
    margin-right: 14px;
    /* Subtle divider line */
}

.login-divider span {
    padding: 0 14px;
    color: rgba(255, 255, 255, 0.5);
    font-size: 14px;
    font-weight: 400;
}

/* Forgot Password Link */
.forgot-password-link {
    color: #f472b6;
    /* Pink-purple theme */
    font-size: 14px;
    cursor: pointer;
    transition: color 0.2s;
    font-weight: 400;
}

.forgot-password-link:hover {
    color: #ff85c0;
    /* Lighter pink */
    text-decoration: none;
}

/* Captcha Box (Cloudflare Style) */
.captcha-box {
    background: #f9f9f9;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    padding: 12px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.captcha-checkbox {
    width: 24px;
    height: 24px;
    cursor: pointer;
    accent-color: #3b82f6;
    border-radius: 4px;
}

/* Input Groups */
.input-group {
    margin-bottom: 18px;
}

.glass-input {
    width: 100%;
    /* Increase padding to ensure caret does not hit the border */
    padding: 12px 16px;
    border-radius: 12px;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(155, 93, 229, 0.5);
    color: white;
    /* CRITICAL FIX: iOS zoom occurs if input font-size is less than 16px */
    font-size: 16px !important;
    outline: none;
    box-sizing: border-box;
    transition: all 0.3s ease;
    letter-spacing: 0.3px;
    /* Fix for iOS caret jumping */
    text-indent: 0;
    text-align: left;
    -webkit-appearance: none;
    appearance: none;
}

.glass-input::placeholder {
    color: rgba(255, 255, 255, 0.4) !important;
    font-size: 13px !important;
    font-weight: 300 !important;
    letter-spacing: 0.5px !important;
}

.glass-input::-webkit-input-placeholder {
    color: rgba(255, 255, 255, 0.4) !important;
    font-size: 13px !important;
    font-weight: 300 !important;
    letter-spacing: 0.5px !important;
}

.glass-input:focus {
    border-color: rgba(155, 93, 229, 0.7);
    background: rgba(0, 0, 0, 0.5) !important;
    box-shadow: 0 0 0 3px rgba(155, 93, 229, 0.15), 0 0 20px rgba(168, 85, 247, 0.12);
}

.login-submit-btn,
button.login-submit-btn,
input.login-submit-btn {
    width: 100%;
    padding: 16px;
    border-radius: 14px;
    border: none;
    color: white;
    font-weight: 600;
    font-size: 16px;
    cursor: pointer !important;
    background: linear-gradient(135deg, #a855f7 0%, #f472b6 50%, #fb7185 100%);
    /* Unified Pink-Purple Gradient */
    transition: all 0.3s ease;
    margin-top: 14px;
    box-shadow: 0 6px 20px rgba(168, 85, 247, 0.4);
    position: relative;
    z-index: 100 !important;
    pointer-events: auto !important;
    -webkit-user-select: none;
    user-select: none;
}

.login-submit-btn:hover {
    opacity: 0.95;
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(168, 85, 247, 0.6);
}

.comment-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 0;
    font-size: 0.9rem;
}

.comment-header i {
    color: rgba(0, 0, 0, 0.4);
    font-size: 1rem;
}

.comment-author {
    font-weight: 600;
    color: rgba(0, 0, 0, 0.7);
    letter-spacing: 0.3px;
    white-space: nowrap;
    /* 防止昵称竖向排列 */
}

/* 点赞激活状态 - 红色爱心 */
.like-btn.liked,
.action-btn.liked {
    color: #ef4444 !important;
}

.like-btn.liked i,
.action-btn.liked i {
    color: #ef4444 !important;
    font-weight: 900;
    /* 实心图标 */
}

.comment-time {
    color: rgba(0, 0, 0, 0.4);
    font-size: 0.8rem;
    margin-left: auto;
}

/* 确保爱心颜色优先级 - 暴力覆盖 */
.like-btn.liked,
.like-btn.liked i,
.like-btn.liked span,
.action-btn.liked,
.action-btn.liked i,
.action-btn.liked span {
    color: #ef4444 !important;
    font-weight: 900 !important;
}

.comment-content {
    color: rgba(0, 0, 0, 0.85);
    font-size: 0.95rem;
    /* 稍微减小字号 */
    line-height: 1.5;
    margin-left: 4px;
    line-height: 1.5;
    margin-left: 4px;
    margin-top: 0;
    /* 增加一点顶部间距 */
}

.no-comments {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    color: rgba(0, 0, 0, 0.5);
    font-size: 0.9rem;
    white-space: nowrap;
}

/* Add Comment Form */
.add-comment-form {
    display: grid;
    gap: 10px;
}

.comment-name-input {
    padding: 10px 14px;
    background: rgba(0, 0, 0, 0.03);
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: 8px;
    color: rgba(0, 0, 0, 0.85);
    font-size: 0.9rem;
    transition: all 0.3s ease;
}

.comment-name-input:focus {
    outline: none;
    background: #fff;
    border-color: #6366f1;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.comment-input {
    padding: 10px 14px;
    background: rgba(0, 0, 0, 0.03);
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: 8px;
    color: rgba(0, 0, 0, 0.85);
    font-size: 0.9rem;
    min-height: 70px;
    resize: vertical;
    font-family: inherit;
    transition: all 0.3s ease;
}

.comment-input:focus {
    outline: none;
    background: #fff;
    border-color: #6366f1;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.comment-submit-btn {
    padding: 10px 20px;
    background: linear-gradient(135deg, #f59e0b, #d97706);
    border: none;
    border-radius: 8px;
    color: white;
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    box-shadow: 0 4px 15px rgba(245, 158, 11, 0.3);
}

.comment-submit-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(245, 158, 11, 0.5);
    background: linear-gradient(135deg, #fbbf24, #f59e0b);
}

.comment-submit.save-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(56, 189, 248, 0.3);
    background: linear-gradient(135deg, #0ea5e9 0%, #6366f1 100%);
}

.gradient-btn {
    background: linear-gradient(135deg, #ec4899 0%, #f472b6 100%);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 12px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.3s ease;
}

.gradient-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(236, 72, 153, 0.4);
    opacity: 0.95;
}

/* Empty State */
.empty-state-large {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    min-height: 400px;
    color: rgba(255, 255, 255, 0.4);
}

.empty-state-large i {
    font-size: 4rem;
    margin-bottom: 20px;
    opacity: 0.3;
}

.empty-state-large p {
    font-size: 1.3rem;
    margin: 5px 0;
}

.empty-hint {
    font-size: 0.95rem !important;
    font-style: italic;
}

/* Image Modal */
.image-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    /* Use bottom: 0 for full coverage */
    height: auto;
    background: rgba(0, 0, 0, 0.95);
    z-index: 10000;
    /* Higher than guestbook modal */
    /* touch-action: none; - Removed to allow pinch-to-zoom */
    display: none;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.image-modal.active {
    display: flex;
    opacity: 1;
}

.image-modal.image-modal-force-hidden {
    display: none !important;
    opacity: 0 !important;
    visibility: hidden !important;
    pointer-events: none !important;
    background: transparent !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    transition: none !important;
}

.image-modal.image-modal-force-hidden .image-modal-content,
.image-modal.image-modal-force-hidden .image-modal-content * {
    opacity: 0 !important;
    visibility: hidden !important;
    pointer-events: none !important;
    transition: none !important;
    animation: none !important;
}

.image-.modal-overlay.active {
    visibility: visible;
    opacity: 1;
}

/* Prevent background scroll when modal open - especially on mobile */
/* Consolidated into the earlier definition */

.image-modal-content {
    position: relative;
    max-width: 90%;
    max-height: 90%;
}

.image-modal-content img {
    max-width: 100%;
    max-height: 90vh;
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6);
    --image-zoom-translate-x: 0px;
    --image-zoom-translate-y: 0px;
    --image-zoom-scale: 1;
    transform: translate(var(--image-zoom-translate-x), var(--image-zoom-translate-y)) scale(var(--image-zoom-scale));
    transform-origin: center center;
    transition: none;
    touch-action: none;
    /* 完全禁止触摸手势 */
    user-select: none;
    /* Prevent text selection */
    -webkit-user-select: none;
    -webkit-touch-callout: none;
    /* Disable iOS callout */
}

.image-modal-content img.image-zoom-animating {
    transition: transform 0.3s ease;
}

.image-modal-close {
    display: none;
    /* Hide close button - users can click image to close */
}

.image-modal-close:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.1);
}

#navUserAvatar,
.nav-user-avatar {
    width: 42px;
    /* Increased from 36px */
    height: 42px;
    border-radius: 50%;
    object-fit: cover;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-block;
    opacity: 0;
    background: transparent !important;
    /* Force transparent */
    border: none !important;
    /* Remove white border */
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3) !important;
    /* Add depth shadow */
    outline: none !important;
    /* Force no outline */
}

#navUserAvatar.show,
.nav-user-avatar.show {
    opacity: 1;
}

/* Ensure parent button doesn't clip shadow */
.login-trigger-btn.logged-in {
    overflow: visible !important;
}

/* Trigger glow when hovering the PARENT button or the avatar itself */
.login-trigger-btn:hover #navUserAvatar,
.login-trigger-btn:hover .nav-user-avatar,
#navUserAvatar:hover,
.nav-user-avatar:hover {
    transform: scale(0.9);
    /* Enhanced shadow without white ring */
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.4) !important;
    background: transparent !important;
    border: none !important;
    outline: none !important;
    transition: all 0.3s ease;
}

/* Animations */
@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Responsive */
@media (max-width: 768px) {
    .floating-back-btn {
        display: none !important;
    }
}

/* Mobile Responsive Adjustments - Extended to larger phones */
@media (max-width: 640px) {
    .guestbook-main {
        max-width: 100%;
        padding: 80px 20px 20px;
        /* ⚡ Use padding for top spacing to prevent margin collapse */
        margin: 0 auto;
    }

    /* Reset body layout for guestbook page to prevent crash */
    body.guestbook-page {
        display: block !important;
        height: auto !important;
        min-height: 100vh;
        overflow-x: hidden;
    }

    /* Center guestbook main container on desktop */
    .guestbook-page .guestbook-main {
        margin-left: auto;
        margin-right: auto;
    }

    .message-container {
        column-count: 1 !important;
        display: flex;
        flex-direction: column;
        gap: 0;
        /* No gap between items for seamless look */
    }

    .message-item {
        padding: 16px 20px;
        margin-bottom: 40px;
        /* Increase margin to 40px for lift effect */
        /* Keep translucent white background from base style */
        background: rgba(255, 255, 255, 0.75);
        backdrop-filter: blur(12px);
        -webkit-backdrop-filter: blur(12px);
        border: none;
        /* Remove border */
        border-bottom: none;
        /* Remove divider line */
        break-inside: avoid;
        /* Prevent column breaks */
    }

    .message-item:last-child {
        border-bottom: none;
        /* No border on last item */
    }

    .message-content {
        font-size: 0.95rem;
        line-height: 1.6;
        color: rgba(255, 255, 255, 0.9);
        margin-bottom: 8px;
    }

    .message-author {
        font-size: 0.9rem;
        font-weight: 600;
        color: rgba(56, 189, 248, 0.95);
        /* Accent color for author */
        margin-bottom: 4px;
    }

    /* Comment Section Adjustments */
    .comment-section {
        margin-top: 0;
        padding-top: 0;
    }

    /* Comment styling for mobile */
    .comment-item {
        display: flex;
        flex-direction: column;
        padding: 12px 0;
        border-bottom: 1px solid rgba(0, 0, 0, 0.04);
        /* 淡化分隔线颜色 */
        animation: fadeIn 0.3s ease-in-out;
        /* 移除固定的 data-can-reply 选择器，改为通用 class */
        overflow-x: visible;
        /* ✅ 改为 visible，防止光晕被裁切 */
        overflow-y: visible;
        margin-left: 0;
        background: transparent;
        border-radius: 0;
        margin-bottom: 0;
    }

    .comment-item:last-child {
        border-bottom: none;
    }

}

/* ==================== Message Card Global Styles ==================== */
/* New Message Card Layout - Applied Globally */
.message-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.author-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

.author-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.author-avatar-placeholder {
    font-size: 32px;
    color: rgba(255, 255, 255, 0.5);
}

.author-name {
    font-size: 0.95rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.9);
}

.message-time {
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.4);
}

.message-content {
    font-size: 1rem;
    line-height: 1.6;
    color: rgba(255, 255, 255, 0.85);
    margin-bottom: 16px;
    white-space: pre-wrap;
    /* Preserve line breaks */
    word-wrap: break-word;
    overflow-wrap: break-word;
    word-break: break-word;
}

/* ========== ACTIONS BAR - COMPLETE REWRITE ========== */
.message-actions-bar {
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-gap: 40px;
    border-top: 1px solid rgba(0, 0, 0, 0.06);
    padding-top: 12px;
    margin-bottom: 12px;
}

/* Action buttons - clean simple styling */
.action-btn,
.like-btn,
.comment-btn {
    all: unset;
    /* Reset all styles */
    display: flex !important;
    align-items: center;
    justify-content: center;
    gap: 6px;
    color: rgba(0, 0, 0, 0.5);
    font-size: 0.9rem;
    cursor: pointer !important;
    padding: 8px;
    transition: all 0.3s ease;
    pointer-events: auto !important;
    /* Critical: ensure clickable */
    user-select: none;
    /* Prevent text selection on click */
}

.action-btn:hover,
.like-btn:hover,
.comment-btn:hover {
    color: rgba(0, 0, 0, 0.75);
    transform: translateY(-2px);
}

.action-btn.active,
.like-btn.active {
    color: #ef4444;
}

.action-btn i,
.like-btn i,
.comment-btn i {
    font-size: 1.1rem;
}

/* ========== NO COMMENTS - SIMPLE CENTERING ========== */
.no-comments {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 80px;
    color: rgba(255, 255, 255, 0.5);
    font-size: 0.9rem;
}

/* ========== COMMENT LIST ========== */
.comment-list {
    transition: max-height 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    will-change: max-height;
}

/* Global Comment Styles */
/* Clickable comments (can be replied to) */
.comment-item--clickable {
    cursor: pointer;
}

.comment-item--clickable:hover {
    background-color: rgba(0, 0, 0, 0.04);
    /* Subtle hover */
}

/* Only highlight the direct author of the hovered comment */
.comment-item--clickable:hover>.comment-row>.comment-main>.comment-header>.comment-author {
    color: rgba(56, 189, 248, 1);
    /* Highlight author name */
}

.comment-item--clickable:hover>.comment-row>.comment-main>.comment-content {
    color: rgba(0, 0, 0, 1);
    /* Darker text */
}

/* New Comment Layout Structure */
.comment-main {
    flex: 1;
    /* Take up available space */
    min-width: 0;
    /* Prevent overflow */
}

.comment-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 4px;
}

.comment-author {
    font-size: 0.9rem;
    font-weight: 600;
    color: rgba(0, 0, 0, 0.7);
}

.comment-time {
    font-size: 0.75rem;
    color: rgba(0, 0, 0, 0.4);
}

.comment-content {
    font-size: 0.95rem;
    line-height: 1.5;
    color: rgba(0, 0, 0, 0.85);
    word-break: break-word;
}

/* Comment Like Button (Right Side) */
.comment-like-wrapper {
    display: flex;
    align-items: flex-start;
    margin-left: 4px;
    padding-top: 0;
    flex-shrink: 0;
}

.comment-like-btn {
    background: transparent;
    border: none;
    color: rgba(0, 0, 0, 0.5);
    /* 深灰色，在浅色背景上清晰可见 */
    font-size: 0.85rem;
    display: flex;
    flex-direction: column;
    /* Stack icon and number */
    align-items: center;
    gap: 2px;
    cursor: pointer;
    padding: 4px;
    transition: all 0.2s;
}

.comment-like-btn:hover {
    color: rgba(0, 0, 0, 0.75);
    /* Hover时变深 */
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    /* No transform to prevent displacement */
}

/* Ensure active state stays red even on hover */
.comment-like-btn.active:hover {
    color: #ef4444 !important;
}

.comment-like-btn.active {
    color: #ef4444;
}

.comment-like-btn.active i {
    animation: heartBeat 0.3s ease-in-out;
}

.like-count {
    font-size: 0.75rem;
    font-weight: 500;
}

/* Nested comment styles */
.comment-item--nested {
    border-left: 2px solid rgba(0, 0, 0, 0.1);
    padding-left: 12px;
    background: transparent;
    background: transparent;
    margin-top: 2px;
    margin-bottom: 2px;
    border-radius: 0;
    transition: border-left-color 0.2s ease;
    position: relative;
}

/* Compact nested comments row */
.comment-item--nested .comment-row {
    padding: 4px 12px !important;
    /* More compact padding */
    min-height: auto;
    border-radius: 4px;
    /* 最小圆角，体现最深层级 */
}

/* Hover state for nested comments */
/* Update hover selector to target comment-row */
.comment-item--clickable:hover>.comment-row {
    background: rgba(255, 255, 255, 0.05);
    cursor: pointer;
}

/* Thread line highlight - controlled by JS */
.comment-item--nested.thread-highlight {
    border-left-color: rgba(56, 189, 248, 0.6) !important;
}

/* SMART: Only highlight if this element is being directly hovered, not a child */
.comment-item--nested.comment-item--clickable:hover {
    border-left-color: rgba(56, 189, 248, 0.6);
}

/* Reset border for nested children when parent is hovered */
.comment-item--nested.comment-item--clickable:hover .comment-item--nested {
    border-left-color: rgba(0, 0, 0, 0.1);
}

/* But allow the deeply nested one to highlight itself when directly hovered */
.comment-item--nested.comment-item--clickable:hover .comment-item--nested.comment-item--clickable:hover {
    border-left-color: rgba(56, 189, 248, 0.6);
}

/* Nested Comment Text Colors - High Specificity */
.comment-item--nested .comment-main .comment-header .comment-author {
    color: rgba(0, 0, 0, 0.75) !important;
    /* Neutral dark grey for nested author */
}

.comment-item--nested .comment-main .comment-content {
    color: rgba(0, 0, 0, 0.85) !important;
    /* Dark for nested content */
}

/* Toggle Button Hover - No Underline */
.comment-toggle-btn:hover {
    color: rgba(56, 189, 248, 1);
    transform: translateY(-1px);
}

/* =========================================
   Mobile & Tablet Optimization for Nested Comments
   ========================================= */
@media (max-width: 768px) {

    /* Drastically reduce indentation on mobile to prevent squashing */
    .comment-item {
        margin-left: 0 !important;
        /* Remove margin accumulation */
    }

    .comment-item--nested {
        padding-left: 8px;
        /* Minimal padding for border */
        border-left-width: 2px;
        margin-left: 4px !important;
        /* Slight offset for hierarchy */
    }

    .comment-item--nested .comment-row {
        padding: 6px 8px !important;
        /* Compact padding */
    }

    /* Allow header to wrap if needed, or adjust font size */
    .comment-header {
        flex-wrap: wrap;
        gap: 4px;
    }

    .comment-author {
        font-size: 0.85rem;
        max-width: 100%;
    }

    .comment-time {
        font-size: 0.7rem;
    }

    /* Ensure content doesn't overflow */
    .comment-content {
        font-size: 0.9rem;
        word-break: break-word;
        overflow-wrap: break-word;
        max-width: 100% !important;
        width: 100% !important;
        box-sizing: border-box !important;
    }

    .comment-main {
        max-width: 100% !important;
        overflow: hidden !important;
    }

    .comment-row {
        max-width: 100% !important;
        overflow: hidden !important;
    }

    /* ✅ 移动端强制显示光晕，防止被裁切 */
    .comment-list {
        overflow: visible !important;
        /* 确保光晕不被裁切 */
        padding: 15px !important;
        /* 四周留出光晕空间 */
    }

    .comment-item.highlight-flash {
        overflow: visible !important;
        /* 高亮时强制可见 */
    }
}

/* @mention styling */
.comment-mention {
    color: #93c5fd;
    /* Soft sky blue */
    font-weight: 600;
    margin-right: 4px;
    font-size: 0.9em;
}

/* Force Desktop Layout Override */
@media (min-width: 1441px) {
    .message-container {
        column-count: 5 !important;
        column-gap: 20px;
    }
}



/* Comment Collapse Styles */
.comment-list {
    /* ⚡ OPTIMIZATION: Smoother easing and hardware acceleration */
    transition: max-height 0.5s ease-out,
        opacity 0.5s ease;
    /* will-change: max-height; <--- Removed to save memory on large lists */
    position: relative;
    overflow: visible;
    /* ✅ 改为 visible，防止光晕被裁切 */
    margin-top: 0;
    /* ✅ 移除顶部margin，减少间距 */
    padding: 15px 15px 15px 15px;
    /* ✅ 上下左右15px，完整容纳光晕 */
    /* 移除min-height避免抽搐 */
}

/* ONLY use flex when showing 'no comments' */
.comment-list:empty::before {
    content: '';
    /* ✅ 移除"暂无评论"文字 */
    display: none;
    /* ✅ 完全隐藏 */
}

/* 移除伪元素遮罩，改用 mask-image */

.comment-list.collapsed {
    max-height: 160px;
    /* 减小折叠高度 */
    overflow: hidden;
    /* 折叠时才使用 hidden */
    /* 使用 mask-image 实现自然淡出 */
    -webkit-mask-image: linear-gradient(to bottom, black 60%, transparent 100%);
    mask-image: linear-gradient(to bottom, black 60%, transparent 100%);
}

/* 展开状态下的样式限制，防止卡片过长 */
.comment-list:not(.collapsed) {
    max-height: 60vh;
    /* 限制最大高度为视口高度的60% */
    overflow-y: auto;
    /* 允许内部滚动 */
    overflow-x: visible;
    /* ✅ 允许横向光晕显示 */
    /* 自定义滚动条样式 */
    scrollbar-width: thin;
    scrollbar-color: rgba(0, 0, 0, 0.2) transparent;
    /* ✅ 移除padding和margin，保持与折叠状态一致 */
}

.comment-list:not(.collapsed)::-webkit-scrollbar {
    width: 4px;
}

.comment-list:not(.collapsed)::-webkit-scrollbar-track {
    background: transparent;
}

.comment-list:not(.collapsed)::-webkit-scrollbar-thumb {
    background-color: rgba(0, 0, 0, 0.2);
    border-radius: 4px;
}

.comment-toggle-btn {
    width: 100%;
    padding: 6px;
    background: transparent;
    border: none;
    color: rgba(0, 0, 0, 0.6);
    cursor: pointer;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    transition: all 0.2s;
    margin-top: 4px;
    position: relative;
    z-index: 5;
}

.comment-toggle-btn:hover {
    color: rgba(0, 0, 0, 0.8);
    text-decoration: none;
    background: rgba(0, 0, 0, 0.03);
    border-radius: 8px;
}

/* Add Comment Trigger Button - Compact inline style for header */
.add-comment-trigger-btn {
    padding: 6px 12px;
    background: rgba(0, 0, 0, 0.04);
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 6px;
    color: rgba(0, 0, 0, 0.6);
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 5px;
    white-space: nowrap;
}

.add-comment-trigger-btn:hover {
    background: rgba(0, 0, 0, 0.06);
    border-color: rgba(0, 0, 0, 0.15);
    transform: translateY(-1px);
}

.add-comment-trigger-btn i {
    font-size: 0.75rem;
}

/* Comment Form Styles */
.add-comment-form {
    position: relative;
    margin-top: 0;
    padding: 0;
    background: transparent;
    border: none;
    border-radius: 0;
    overflow: visible;
    max-height: none;
    opacity: 1;
    transform: none;
    transform-origin: top;
    transition: opacity 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Cancel Button - Small close icon in top-right */
.cancel-comment-btn {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 24px;
    height: 24px;
    padding: 0;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    color: rgba(255, 255, 255, 0.5);
    font-size: 0.75rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.cancel-comment-btn:hover {
    background: rgba(239, 68, 68, 0.2);
    border-color: rgba(239, 68, 68, 0.3);
    color: #ef4444;
    transform: scale(1.1);
}

/* Submit Button */
.comment-submit-btn {
    width: 100%;
    padding: 10px 20px;
    margin-top: 10px;
    background: linear-gradient(135deg, #a855f7 0%, #f472b6 50%, #fb7185 100%);
    /* Unified Pink-Purple Gradient */
    border: none;
    border-radius: 8px;
    color: white;
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    box-shadow: 0 4px 15px rgba(168, 85, 247, 0.3);
}

.comment-submit-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(168, 85, 247, 0.5);
    opacity: 0.95;
}

/* Hidden class for forms */
.add-comment-form.hidden {
    display: none;
}

/* Content Slide Up Animation - Transition Based */

/* Elastic Press State */
.glass-box {
    will-change: transform;
    /* Optimize for transform animations */
    /* No CSS transitions for transform - handled by JS physics */
    position: relative;
    overflow: hidden;
    text-decoration: none;
}



/* Mobile Layout Optimizations */
@media (max-width: 768px) {

    /* Center Profile Card Content */
    .box-profile {
        text-align: center;
        align-items: center;
        justify-content: center;
    }

    .profile-header {
        flex-direction: column;
        align-items: center;
        width: 100%;
    }

    .profile-info {
        align-items: center;
        text-align: center;
        margin-top: 10px;
    }

    .profile-info h1 {
        text-align: center;
        width: 100%;
    }

    .profile-info p {
        text-align: center;
        width: 100%;
    }

    .date-time-compact {
        width: 100%;
        justify-content: center;
        margin-bottom: 10px;
        text-align: right;
        /* Keep time at top right or center? User asked for title center. Let's keep time as is or center it too? Reference image shows time at top right. */
    }

    /* Fix time position on mobile to be top right absolute or just flow? 
       In the reference image, time is top right. 
       Let's make sure the title "Zaoyoe 拾光里" is centered.
    */
    .box-profile {
        position: relative;
        /* For absolute positioning of time if needed */
    }

    .date-time-compact {
        position: absolute;
        top: 20px;
        right: 20px;
        width: auto;
        margin: 0;
    }

    /* Hide date on mobile as requested */
    #current-date {
        display: none !important;
    }

    .profile-info {
        margin-top: 40px;
        /* Space for the time */
    }
}

/* ==================== Login System Styles ==================== */

/* Top Right Trigger Button */
.top-right-nav {
    position: fixed;
    top: 28px;
    right: 30px;
    /* 统一与 prompts.html 的 .user-avatar-container 位置一致 */
    z-index: 2100;
    /* Higher than login-overlay (2000) to ensure user menu is always accessible */
}

.login-trigger-btn {
    /* Remove glassmorphism background */
    background: transparent !important;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    border: none !important;
    box-shadow: none;

    /* Circular shape to fit icon */
    border-radius: 50%;
    padding: 0;
    width: 48px;
    height: 48px;

    /* Misc */
    color: white;
    cursor: pointer;
    transition: all 0.3s ease;

    /* Center icon */
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0;
}

/* Add shadow to default icon for 3D effect */
#defaultAuthIcon {
    filter: drop-shadow(0 8px 16px rgba(0, 0, 0, 0.4)) drop-shadow(0 4px 8px rgba(0, 0, 0, 0.3));
    font-size: 1.8rem !important;
    transition: all 0.3s ease;
    color: rgba(255, 255, 255, 0.5) !important;
    /* Semi-transparent to minimize visible glass circle */
}

#defaultAuthIcon:hover {
    transform: scale(1.1);
    filter: drop-shadow(0 0 0 3px rgba(255, 255, 255, 0.9)) drop-shadow(0 0 15px rgba(255, 255, 255, 0.7)) brightness(1.3);
    transition: all 0.3s ease;
}

/* 为 Sign In 文本添加过渡动画 */
#authBtnText {
    opacity: 1;
    transition: opacity 0.3s ease, max-width 0.3s ease;
}

/* 登录状态下隐藏 Sign In 文本（已由后面的 .logged-in 规则处理） */

/* 用户头像和昵称进入动画 */
.nav-user-avatar {
    width: 40px;
    height: 40px;
    min-width: 40px;
    min-height: 40px;
    border-radius: 50%;
    object-fit: cover;
    border: none !important;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.4),
        0 4px 8px rgba(0, 0, 0, 0.3) !important;
    transition: all 0.3s ease;
    /* White border for 3D effect */
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    /* Shadow for depth */
    flex-shrink: 0;
    display: inline-block;
    vertical-align: middle;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
    /* Stronger shadow for 3D effect */
}

.nav-user-avatar.animate-in {
    animation: userAvatarRise 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94) backwards;
}

#authBtnText.animate-in {

    animation: userTextRise 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94) 0.1s backwards;
}


/* 登录状态下隐藏昵称，使用动画过渡 */
.login-trigger-btn.logged-in #authBtnText {
    max-width: 0;
    opacity: 0;
    margin: 0;
    padding: 0;
    overflow: hidden;
    /* transition 已在 #authBtnText 中定义 */
}

/* 登录状态下的按钮样式：只显示头像 */
.login-trigger-btn.logged-in {
    padding: 0 !important;
    border-radius: 50% !important;
    width: 40px !important;
    height: 40px !important;
    min-width: 40px !important;
    min-height: 40px !important;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    /* Prevent content from spilling out */
    /* Explicitly prevent any background/border/shadow */
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
}

.login-trigger-btn.logged-in .nav-user-avatar {
    margin: 0;
    width: 40px !important;
    height: 40px !important;
    border: none !important;
}

@keyframes userAvatarRise {
    from {
        opacity: 0;
        transform: translateY(-10px) scale(0.8);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes userTextRise {
    from {
        opacity: 0;
        transform: translateY(-15px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Login Modal Overlay */
.login-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--app-modal-backdrop);
    backdrop-filter: var(--app-modal-backdrop-filter);
    -webkit-backdrop-filter: var(--app-modal-backdrop-filter);
    z-index: 3000;
    /* Higher than other modals (profile modal is 2000) */
    display: flex;
    justify-content: center;
    align-items: center;

    /* Hidden by default */
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    /* 分离过渡，避免 backdrop-filter 参与过渡 */
}

.login-overlay.active {
    opacity: 1;
    visibility: visible;
    /* 确保激活时恢复背景和模糊效果 */
    backdrop-filter: var(--app-modal-backdrop-filter) !important;
    -webkit-backdrop-filter: var(--app-modal-backdrop-filter) !important;
    background: var(--app-modal-backdrop) !important;
    pointer-events: all !important;
}


/* 关闭时立即清除 backdrop-filter 和背景以防止残留 */
.login-overlay.closing {
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    background: transparent !important;
    pointer-events: none !important;
}

/* 非激活状态下清除效果（但优先级低于 .active） */
.login-overlay:not(.active):not(.closing) {
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    background: transparent;
    pointer-events: none;
}

/* Login Card Body */
.login-card {
    width: 360px;
    padding: 40px;
    border-radius: 24px;
    position: relative;
    z-index: 1;

    /* Lighter Glassmorphism - Unified with other modals */
    background: rgba(255, 255, 255, 0.03);
    backdrop-filter: blur(40px);
    -webkit-backdrop-filter: blur(40px);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-top: 1px solid rgba(255, 255, 255, 0.25);

    transform: scale(0.95);
    transition: transform 0.3s ease-out;
    pointer-events: auto !important;
}

.login-overlay.active .login-card {
    transform: scale(1);
}

/* Card Internal Elements */
.card-title {
    font-size: 24px;
    margin-bottom: 8px;
    /* Gradient Text - Pink-Purple Theme */
    background: linear-gradient(135deg, #fff 0%, #f472b6 60%, #a855f7 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    font-weight: 700;
    text-align: center;
}

/* Image Preview Container */
.image-preview-container {
    position: relative;
    margin-top: 15px;
    /* Increased spacing */
    margin-bottom: 15px;
    /* Added bottom spacing */
    border-radius: 12px;
    overflow: hidden;
    background: rgba(0, 0, 0, 0.2);
    display: none;
    /* Hidden by default */
    border: 1px solid rgba(255, 255, 255, 0.1);
    /* Subtle border */
}

/* Full Image Display (No Cropping) */
.image-preview-container img {
    width: 100%;
    height: auto;
    max-height: 300px;
    object-fit: contain;
    /* Ensure full image is visible */
    display: block;
}

/* Modal Exit Animation */
.modal-overlay.closing .modal-content {
    animation: modalFadeOut 0.3s ease-in forwards;
}

.modal-overlay.closing {
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

@keyframes modalFadeOut {
    from {
        opacity: 1;
        transform: scale(1) translateY(0);
    }

    to {
        opacity: 0;
        transform: scale(0.95) translateY(10px);
    }
}

/* Mac-style Remove Button - 统一风格，与留言板关闭按钮一致 */
.remove-image-btn {
    position: absolute;
    top: 8px;
    left: 8px;
    width: 16px;
    height: 16px;
    background: #ff5f57;
    border: 1px solid #e0443e;
    border-radius: 50%;
    cursor: pointer;
    padding: 0;
    z-index: 20;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Hover时显示黑色X */
/* Hover时显示黑色X */
.remove-image-btn i {
    font-size: 10px;
    color: #4a0002;
    /* Match mac-dot red icon color */
    opacity: 0;
    transition: opacity 0.2s ease;
}

.remove-image-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 0 8px rgba(255, 95, 87, 0.6);
}

.remove-image-btn:hover i {
    opacity: 1;
}


.image-preview-container:hover .remove-image-btn {
    opacity: 1;
}

/* --- User Dropdown Menu (Mac System Style) --- */
/* --- User Dropdown Menu (Mac System Style) --- */
/* Dropdown Backdrop */
.dropdown-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--app-modal-backdrop);
    backdrop-filter: var(--app-modal-backdrop-filter);
    -webkit-backdrop-filter: var(--app-modal-backdrop-filter);
    z-index: 1999;
    /* 低于弹窗 (2000) 以免遮挡弹窗交互 */
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    pointer-events: none !important;
}

/* Trigger backdrop when dropdown is active */
/* Dropdown blur overlay - similar to modal backdrop */
.dropdown-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: transparent;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 2000;
    pointer-events: none;
}

.dropdown-overlay.active {
    opacity: 1;
    visibility: visible;
    pointer-events: all;
}

body:has(.user-dropdown.active) .dropdown-backdrop {
    opacity: 1;
    visibility: visible;
    pointer-events: all !important;
}

.user-dropdown {
    position: absolute;
    top: calc(100% + 5px);
    right: 0;
    left: auto;
    min-width: 200px;
    /* Reduced from 300px for a more refined look */

    /* Mac-style Glass Effect - Improved opacity for readability */
    background: rgba(0, 0, 0, 0.4);
    /* Match shared modal background */
    backdrop-filter: blur(20px) saturate(150%);
    /* Match shared modal filter */
    -webkit-backdrop-filter: blur(20px) saturate(150%);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-top: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);

    border-radius: 12px;
    padding: 8px;

    opacity: 0;
    visibility: hidden;
    transform: scale(0.95);
    /* Match modal animation - start slightly smaller */
    transition: all 0.3s ease-out;
    /* Elastic easing - same as modal */
    pointer-events: none;
    z-index: 2100;
    /* Same as parent .top-right-nav, above all modals */
}

.user-dropdown.active {
    opacity: 1;
    visibility: visible;
    transform: scale(1);
    /* Match modal animation - scale up to full size */
    pointer-events: all;
}

/* Content Staggered Animation */
.user-dropdown .menu-item,
.user-dropdown .profile-section,
.user-dropdown .divider {
    opacity: 0;
    transform: translateY(-15px);
    transition: opacity 0.3s ease, transform 0.3s ease-out;
}

.user-dropdown.active .menu-item,
.user-dropdown.active .profile-section,
.user-dropdown.active .divider {
    opacity: 1;
    transform: translateY(0);
}

/* Stagger Delays */
.user-dropdown.active .profile-section {
    transition-delay: 0.05s;
}

.user-dropdown.active .divider {
    transition-delay: 0.1s;
}

.user-dropdown.active .menu-item:not(.profile-section) {
    transition-delay: 0.15s;
}

/* Avatar Container */
/* Profile Modal - Compact & Elegant */
.profile-modal {
    width: 400px;
    max-width: 90%;
    text-align: center;
    /* Remove width transition to prevent layout shifts */
}

.profile-modal-file-input {
    display: none;
}

#profileModal {
    --profile-modal-shift-y: 0px;
    --profile-modal-overlay-height: 100dvh;
    height: var(--profile-modal-overlay-height);
    min-height: var(--profile-modal-overlay-height);
    overflow: hidden !important;
}

#profileModal .modal-content.profile-modal {
    display: flex;
    flex-direction: column;
    position: relative;
    padding: 0 !important;
    top: var(--profile-modal-shift-y, 0px);
    transform: none !important;
    transition:
        top 180ms cubic-bezier(0.22, 1, 0.36, 1),
        opacity 0.3s ease-out,
        max-height 180ms cubic-bezier(0.22, 1, 0.36, 1),
        width 220ms cubic-bezier(0.22, 1, 0.36, 1),
        max-width 220ms cubic-bezier(0.22, 1, 0.36, 1);
    will-change: top, opacity;
    overflow: hidden !important;
}

#profileModal .profile-modal-scroll {
    width: 100%;
    flex: 1 1 auto;
    min-height: 0;
    scroll-padding-top: 24px;
    scroll-padding-bottom: 200px;
    overflow-y: auto !important;
    overflow-x: hidden !important;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    touch-action: pan-y;
    scrollbar-gutter: stable both-edges;
}

#profileModal {
    --profile-mobile-modal-radius: 20px;
    --profile-mobile-topbar-height: 86px;
    --profile-mobile-topbar-inset: 0px;
}

#profileModal .modal-content.profile-modal {
    border-radius: var(--profile-mobile-modal-radius) !important;
    background: rgba(12, 15, 19, 0.92) !important;
    border: 1px solid rgba(255, 255, 255, 0.08) !important;
    box-shadow:
        0 26px 56px rgba(0, 0, 0, 0.32),
        inset 0 1px 0 rgba(255, 255, 255, 0.06) !important;
}

#profileModal .profile-modal-scroll {
    position: relative !important;
    padding: 0 12px calc(18px + env(safe-area-inset-bottom)) !important;
    padding-top: calc(var(--profile-mobile-topbar-height) + 12px) !important;
    scroll-padding-top: calc(var(--profile-mobile-topbar-height) + 20px) !important;
    scroll-padding-bottom: 220px !important;
}

#profileModal .profile-mobile-topbar {
    display: block;
    position: absolute;
    top: 0;
    left: var(--profile-mobile-topbar-inset);
    right: var(--profile-mobile-topbar-inset);
    z-index: 30;
    height: var(--profile-mobile-topbar-height);
    pointer-events: none;
}

#profileModal .profile-mobile-topbar-shell {
    position: relative;
    height: 100%;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    padding: 16px 18px 10px;
    border-radius: var(--profile-mobile-modal-radius) var(--profile-mobile-modal-radius) 0 0;
    background: rgba(12, 15, 19, 0.56);
    backdrop-filter: blur(18px) saturate(140%);
    -webkit-backdrop-filter: blur(18px) saturate(140%);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
    overflow: hidden;
    pointer-events: auto;
}

#profileModal .profile-mobile-tabs {
    display: flex;
    width: 100%;
    justify-content: center;
    gap: 28px;
    align-items: flex-end;
    position: relative;
    padding-bottom: 4px;
}

#profileModal .profile-mobile-tabs .tab-item {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 34px;
    padding: 0 0 10px;
    border-radius: 0;
    background: transparent !important;
    font-size: 16px;
    font-weight: 600;
    letter-spacing: -0.18px;
    color: rgba(212, 220, 228, 0.56);
}

#profileModal .profile-mobile-tabs .tab-item:hover {
    color: rgba(255, 255, 255, 0.82);
    background: transparent !important;
}

#profileModal .profile-mobile-tabs .tab-item.active {
    color: rgba(255, 255, 255, 0.98);
}

#profileModal .profile-mobile-tabs .tab-item.active::after {
    display: none;
}

#profileModal .profile-mobile-tab-indicator {
    position: absolute;
    left: 0;
    bottom: 0;
    width: var(--profile-tab-indicator-width, 34px);
    height: 2px;
    border-radius: 999px;
    background: #9fcaff;
    transform: translateX(var(--profile-tab-indicator-x, 0px));
    transition:
        transform 0.3s cubic-bezier(0.22, 1, 0.36, 1),
        width 0.3s cubic-bezier(0.22, 1, 0.36, 1);
    pointer-events: none;
}

#profileModal .profile-security-desktop-layout {
    display: none;
}

#profileModal .profile-flip-container {
    min-height: 480px !important;
    height: auto !important;
    overflow: visible !important;
}

#profileModal .profile-flip-inner {
    min-height: 480px !important;
}

#profileModal .profile-view {
    align-items: stretch !important;
}

#profileModal .profile-view[hidden] {
    display: none !important;
}

#profileModal .profile-front {
    justify-content: flex-start !important;
    gap: 12px !important;
    padding-top: 0 !important;
    padding-bottom: 20px !important;
}

#profileModal .profile-mobile-sheet {
    position: relative;
    z-index: 1;
    display: block;
    width: 100%;
    margin-top: 0;
    padding-bottom: 10px;
}

#profileModal .profile-mobile-hero-card,
#profileModal .profile-mobile-card {
    width: 100%;
    max-width: 100%;
    margin-bottom: 14px;
}

#profileModal .profile-mobile-hero-card {
    display: grid;
    grid-template-columns: 72px minmax(0, 1fr);
    grid-template-areas:
        "avatar main"
        "avatar editor";
    column-gap: 14px;
    row-gap: 14px;
    align-items: center;
    padding: 18px 16px;
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 22px;
    background: rgba(16, 20, 25, 0.94);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.035),
        0 6px 14px rgba(0, 0, 0, 0.05);
}

#profileModal .profile-mobile-hero-avatar {
    grid-area: avatar;
    position: relative;
    width: 72px;
    height: 72px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(20, 24, 30, 0.92);
    color: rgba(236, 241, 247, 0.96);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.06),
        0 6px 14px rgba(0, 0, 0, 0.06);
    overflow: visible;
    -webkit-appearance: none;
    appearance: none;
    align-self: center;
    justify-self: start;
    grid-row: 1 / span 2;
}

#profileModal #profileModalAvatarMobile {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    border-radius: 50%;
}

#profileModal .profile-mobile-hero-avatar-fallback {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    font-size: 30px;
    font-weight: 600;
    letter-spacing: -0.4px;
    border-radius: 50%;
}

#profileModal .profile-mobile-hero-card.is-editing .profile-mobile-hero-avatar-editmark {
    opacity: 1;
    transform: translateX(-50%) translateY(0) scale(1);
}

#profileModal .profile-mobile-hero-main {
    grid-area: main;
    min-width: 0;
    text-align: left;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 6px;
    align-self: center;
    position: relative;
    padding-right: 74px;
}

#profileModal .profile-mobile-hero-kicker {
    margin-bottom: 0;
    color: rgba(255, 255, 255, 0.42);
    font-size: 12px;
    letter-spacing: 0.24px;
    text-transform: uppercase;
}

#profileModal .profile-mobile-hero-name {
    min-width: 0;
    font-size: 22px;
    font-weight: 600;
    line-height: 1.1;
    letter-spacing: -0.4px;
    color: rgba(255, 255, 255, 0.98);
}

#profileModal .profile-mobile-hero-meta {
    min-width: 0;
    font-size: 14px;
    line-height: 1.48;
    color: rgba(227, 234, 242, 0.72);
    word-break: break-all;
}

#profileModal #profileMobileHeroEmail,
#profileModal #profileMobileHeroId {
    display: block;
}

#profileModal .profile-mobile-hero-actions {
    position: absolute;
    right: 0;
    bottom: 2px;
    display: flex;
    justify-content: flex-end;
}

#profileModal .profile-mobile-hero-edit-btn {
    min-height: 36px;
    padding: 0 12px;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(255, 255, 255, 0.04);
    color: rgba(255, 255, 255, 0.92);
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.1px;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
    -webkit-appearance: none;
    appearance: none;
}

#profileModal .profile-mobile-card {
    padding: 20px 16px;
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 22px;
    background: rgba(16, 20, 25, 0.94);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.035),
        0 6px 14px rgba(0, 0, 0, 0.05);
}

#profileModal .profile-mobile-sheet > :last-child {
    margin-bottom: 0;
}

#profileModal .profile-mobile-section-head {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 12px;
    margin-bottom: 16px;
}

#profileModal .profile-mobile-section-title {
    font-size: 15px;
    font-weight: 600;
    letter-spacing: -0.12px;
    color: rgba(255, 255, 255, 0.96);
}

#profileModal .profile-mobile-info-rows {
    display: grid;
}

#profileModal .profile-mobile-info-row {
    min-height: 54px;
    display: grid;
    grid-template-columns: 92px 1fr;
    gap: 12px;
    align-items: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

#profileModal .profile-mobile-info-row:last-child {
    border-bottom: 0;
}

#profileModal .profile-mobile-info-key {
    font-size: 13px;
    color: rgba(212, 220, 228, 0.42);
    text-align: left;
}

#profileModal .profile-mobile-info-value {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    font-size: 14px;
    line-height: 1.45;
    color: rgba(255, 255, 255, 0.94);
    text-align: right;
    min-width: 0;
    word-break: break-word;
}

#profileModal .profile-mobile-inline-editor {
    grid-area: editor;
    grid-column: 2;
    display: grid;
    gap: 10px;
    width: 100%;
    max-height: 0;
    overflow: hidden;
    margin-top: 0;
    padding-top: 0;
    border-top: 1px solid transparent;
    opacity: 0;
    pointer-events: none;
    transform: translateY(-6px);
    transform-origin: top center;
    transition:
        max-height 0.32s cubic-bezier(0.22, 1, 0.36, 1),
        opacity 0.22s ease,
        transform 0.28s cubic-bezier(0.22, 1, 0.36, 1),
        margin-top 0.28s ease,
        padding-top 0.28s ease,
        border-color 0.28s ease;
}

#profileModal .profile-mobile-inline-editor.is-visible {
    max-height: 176px;
    margin-top: 14px;
    padding-top: 14px;
    border-top-color: rgba(255, 255, 255, 0.05);
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
}

#profileModal .profile-mobile-inline-input {
    width: 100%;
    min-height: 46px;
    padding: 10px 16px;
    border-radius: 14px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(10, 14, 18, 0.88);
    color: rgba(255, 255, 255, 0.96);
    font-size: 15px;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
    caret-color: #9fcaff;
}

#profileModal .profile-mobile-inline-input:focus,
#profileModal .profile-mobile-inline-input:focus-visible {
    outline: none !important;
    border-color: #9fcaff !important;
    background: rgba(255, 255, 255, 0.042) !important;
    box-shadow: none !important;
}

#profileModal .profile-mobile-inline-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

#profileModal .profile-mobile-editor-btn {
    -webkit-appearance: none;
    appearance: none;
    min-height: 44px;
    border-radius: 14px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    font-size: 14px;
    font-weight: 600;
    letter-spacing: 0.1px;
}

#profileModal .profile-mobile-editor-btn--ghost {
    background: rgba(255, 255, 255, 0.04);
    color: rgba(255, 255, 255, 0.92);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

#profileModal .profile-mobile-editor-btn--primary {
    background: rgba(229, 235, 241, 0.94);
    color: #0f141a;
    border-color: rgba(255, 255, 255, 0.18);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.46);
}

#profileModal .profile-mobile-quick-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

#profileModal .profile-mobile-quick-card {
    position: relative;
    -webkit-appearance: none;
    appearance: none;
    min-height: 126px;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    padding: 14px;
    border-radius: 18px;
    background: rgba(20, 24, 30, 0.92);
    border: 1px solid rgba(255, 255, 255, 0.06);
    color: rgba(255, 255, 255, 0.94);
    text-align: left;
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.03),
        0 4px 10px rgba(0, 0, 0, 0.04);
}

#profileModal .profile-mobile-quick-icon {
    width: 38px;
    height: 38px;
    display: grid;
    place-items: center;
    margin-bottom: 22px;
    border-radius: 12px;
    background: rgba(20, 24, 30, 0.92);
    border: 1px solid rgba(255, 255, 255, 0.06);
    color: rgba(236, 241, 247, 0.84);
}

#profileModal .profile-mobile-quick-title {
    margin-bottom: 6px;
    font-size: 14px;
    font-weight: 600;
    line-height: 1.35;
}

#profileModal .profile-mobile-quick-desc {
    font-size: 12px;
    line-height: 1.46;
    color: rgba(227, 234, 242, 0.72);
}

#profileModal .profile-mobile-quick-arrow {
    position: absolute;
    top: 14px;
    right: 14px;
    color: rgba(212, 220, 228, 0.42);
    font-size: 16px;
}

#profileModal .mobile-security-layout {
    display: block;
    width: 100%;
    padding: 0 0 12px;
}

#profileModal .mobile-security-section {
    background: rgba(16, 20, 25, 0.94);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 22px;
    padding: 18px 16px;
    margin-bottom: 14px;
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.035),
        0 6px 14px rgba(0, 0, 0, 0.05);
}

#profileModal .mobile-section-title {
    margin-bottom: 14px;
    font-size: 15px;
    color: rgba(255, 255, 255, 0.96);
}

#profileModal .mobile-section-title::before {
    width: 2px;
    height: 14px;
    background: rgba(255, 255, 255, 0.24);
}

#profileModal .mobile-section-title.danger::before {
    background: rgba(193, 149, 149, 0.72);
}

#profileModal .mobile-section-desc {
    margin-bottom: 14px;
    font-size: 12px;
    line-height: 1.5;
    color: rgba(255, 255, 255, 0.48);
}

#profileModal .mobile-security-layout .security-input,
#profileModal .mobile-security-layout .security-input.glass-input {
    background: rgba(10, 14, 18, 0.88);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 14px;
    color: rgba(255, 255, 255, 0.96);
    min-height: 46px;
    height: auto;
    padding: 10px 16px;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

#profileModal .mobile-security-layout .security-input:focus,
#profileModal .mobile-security-layout .security-input.glass-input:focus {
    border-color: #9fcaff !important;
    background: rgba(255, 255, 255, 0.042) !important;
    box-shadow: none !important;
}

#profileModal .security-input::placeholder {
    color: rgba(225, 232, 240, 0.22) !important;
    -webkit-text-fill-color: rgba(225, 232, 240, 0.22) !important;
    opacity: 1 !important;
    font-size: 13px !important;
    font-weight: 400 !important;
    letter-spacing: 0 !important;
    line-height: 1.2 !important;
}

#profileModal .security-input::-webkit-input-placeholder {
    color: rgba(225, 232, 240, 0.22) !important;
    -webkit-text-fill-color: rgba(225, 232, 240, 0.22) !important;
    opacity: 1 !important;
    font-size: 13px !important;
    font-weight: 400 !important;
    letter-spacing: 0 !important;
    line-height: 1.2 !important;
}

#profileModal .security-input::-moz-placeholder {
    color: rgba(225, 232, 240, 0.22) !important;
    opacity: 1 !important;
    font-size: 13px !important;
    font-weight: 400 !important;
    letter-spacing: 0 !important;
    line-height: 1.2 !important;
}

#profileModal .security-input:-ms-input-placeholder {
    color: rgba(225, 232, 240, 0.22) !important;
    opacity: 1 !important;
    font-size: 13px !important;
    font-weight: 400 !important;
    letter-spacing: 0 !important;
    line-height: 1.2 !important;
}

#profileModal .mobile-security-layout .security-mobile-code-btn {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 14px;
    color: rgba(255, 255, 255, 0.9);
    height: 46px;
    padding: 0 14px;
}

#profileModal .profile-mobile-code-row {
    display: flex;
    gap: 10px;
}

#profileModal .profile-mobile-code-row .profile-mobile-code-input {
    flex: 1;
}

#profileModal .mobile-security-layout .security-mobile-primary-btn,
#profileModal .mobile-security-layout .security-mobile-danger-btn {
    width: 100%;
    min-width: 0;
    max-width: none;
    margin: 12px 0 0;
    height: 46px;
    border-radius: 14px;
    padding: 0 16px;
    font-family: "SF Pro Display", "PingFang SC", "Helvetica Neue", sans-serif;
    font-weight: 600;
    letter-spacing: 0.1px;
}

#profileModal .mobile-security-layout .security-mobile-primary-btn {
    background: rgba(229, 235, 241, 0.94);
    border: 1px solid rgba(255, 255, 255, 0.18);
    color: #0f141a;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.46);
}

#profileModal .mobile-security-layout .security-mobile-danger-btn {
    background: rgba(166, 48, 48, 0.34);
    border: 1px solid rgba(223, 98, 98, 0.34);
    color: #ffe1e1;
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.05),
        0 4px 10px rgba(72, 12, 12, 0.14);
}

#profileModal .profile-front.animate-in .profile-mobile-hero-avatar {
    animation: staggeredRise 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94) 0.1s backwards;
}

#profileModal .profile-front.animate-in .profile-mobile-hero-kicker {
    animation: staggeredRise 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94) 0.14s backwards;
}

#profileModal .profile-front.animate-in .profile-mobile-hero-name {
    animation: staggeredRise 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94) 0.19s backwards;
}

#profileModal .profile-front.animate-in .profile-mobile-hero-meta {
    animation: staggeredRise 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94) 0.24s backwards;
}

#profileModal .profile-front.animate-in .profile-mobile-hero-actions {
    animation: staggeredRise 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94) 0.29s backwards;
}

#profileModal .profile-front.animate-in .profile-mobile-card--essential .profile-mobile-section-head {
    animation: staggeredRise 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94) 0.34s backwards;
}

#profileModal .profile-front.animate-in .profile-mobile-card--essential .profile-mobile-info-row:nth-child(1) {
    animation: staggeredRise 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94) 0.39s backwards;
}

#profileModal .profile-front.animate-in .profile-mobile-card--essential .profile-mobile-info-row:nth-child(2) {
    animation: staggeredRise 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94) 0.44s backwards;
}

#profileModal .profile-front.animate-in .profile-mobile-card--essential .profile-mobile-info-row:nth-child(3) {
    animation: staggeredRise 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94) 0.49s backwards;
}

#profileModal .profile-front.animate-in .profile-mobile-card--quick .profile-mobile-section-head {
    animation: staggeredRise 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94) 0.54s backwards;
}

#profileModal .profile-front.animate-in .profile-mobile-card--quick .profile-mobile-quick-card:nth-child(1) {
    animation: staggeredRise 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94) 0.59s backwards;
}

#profileModal .profile-front.animate-in .profile-mobile-card--quick .profile-mobile-quick-card:nth-child(2) {
    animation: staggeredRise 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94) 0.64s backwards;
}

#profileModal .profile-front.animate-in .profile-mobile-card--quick .profile-mobile-quick-card:nth-child(3) {
    animation: staggeredRise 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94) 0.69s backwards;
}

#profileModal .profile-front.animate-in .profile-mobile-card--quick .profile-mobile-quick-card:nth-child(4) {
    animation: staggeredRise 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94) 0.74s backwards;
}

#profileModal .profile-back.animate-in .mobile-security-section:nth-child(1) .mobile-section-title {
    animation: staggeredRise 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94) 0.12s backwards;
}

#profileModal .profile-back.animate-in .mobile-security-section:nth-child(1) .input-group:nth-of-type(1) {
    animation: staggeredRise 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94) 0.17s backwards;
}

#profileModal .profile-back.animate-in .mobile-security-section:nth-child(1) .input-group:nth-of-type(2) {
    animation: staggeredRise 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94) 0.22s backwards;
}

#profileModal .profile-back.animate-in .mobile-security-section:nth-child(1) .security-mobile-primary-btn {
    animation: staggeredRise 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94) 0.27s backwards;
}

#profileModal .profile-back.animate-in .mobile-security-section:nth-child(2) .mobile-section-title {
    animation: staggeredRise 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94) 0.32s backwards;
}

#profileModal .profile-back.animate-in .mobile-security-section:nth-child(2) .mobile-section-desc {
    animation: staggeredRise 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94) 0.37s backwards;
}

#profileModal .profile-back.animate-in .mobile-security-section:nth-child(2) .input-group:nth-of-type(1) {
    animation: staggeredRise 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94) 0.42s backwards;
}

#profileModal .profile-back.animate-in .mobile-security-section:nth-child(2) .input-group:nth-of-type(2) {
    animation: staggeredRise 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94) 0.47s backwards;
}

#profileModal .profile-back.animate-in .mobile-security-section:nth-child(2) .security-mobile-primary-btn {
    animation: staggeredRise 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94) 0.52s backwards;
}

#profileModal .profile-back.animate-in .mobile-security-section:nth-child(3) .mobile-section-title {
    animation: staggeredRise 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94) 0.57s backwards;
}

#profileModal .profile-back.animate-in .mobile-security-section:nth-child(3) .mobile-section-desc {
    animation: staggeredRise 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94) 0.62s backwards;
}

#profileModal .profile-back.animate-in .mobile-security-section:nth-child(3) .security-mobile-danger-btn {
    animation: staggeredRise 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94) 0.67s backwards;
}

@media (min-width: 769px) {
    #profileModal {
        --profile-mobile-modal-radius: 26px;
        --profile-mobile-topbar-height: 72px;
        --profile-desktop-inline-editor-offset: 148px;
    }

    #profileModal .modal-content.profile-modal {
        display: grid !important;
        grid-template-rows: auto minmax(0, 1fr);
        row-gap: 0;
        padding: 12px !important;
        position: relative;
        width: min(432px, calc(100vw - 120px)) !important;
        max-width: 432px !important;
        min-height: auto !important;
        max-height: min(748px, calc(100vh - 88px)) !important;
    }

    #profileModal[data-profile-tab="security"] .modal-content.profile-modal {
        width: min(724px, calc(100vw - 92px)) !important;
        max-width: 724px !important;
        min-height: auto !important;
        max-height: min(656px, calc(100vh - 104px)) !important;
    }

    #profileModal .profile-modal-scroll {
        scrollbar-gutter: auto;
        min-height: 0 !important;
        padding: 0 !important;
        scroll-padding-top: 0 !important;
        scroll-padding-bottom: 0 !important;
    }

    #profileModal[data-profile-tab="profile"] .profile-modal-scroll {
        padding-top: 82px !important;
        scroll-padding-top: 82px !important;
    }

    #profileModal[data-profile-tab="security"] .profile-modal-scroll {
        padding-top: 82px !important;
        overflow: hidden !important;
        scroll-padding-top: 82px !important;
        scroll-padding-bottom: 0 !important;
    }

    #profileModal .profile-mobile-topbar {
        position: absolute;
        top: 12px;
        left: 12px;
        right: 12px;
        margin: 0;
        height: 0;
        flex: 0 0 0;
        overflow: visible;
        z-index: 5;
    }

    #profileModal .profile-mobile-topbar-shell {
        height: auto;
        min-height: 56px;
        width: min(100%, 284px);
        min-width: 0;
        margin: 0 auto;
        transform: none;
        padding: 12px 26px 10px;
        border-radius: 20px;
        border: 1px solid rgba(255, 255, 255, 0.08);
        border-top-color: rgba(255, 255, 255, 0.12);
        background: rgba(12, 15, 19, 0.56);
        backdrop-filter: blur(18px) saturate(140%);
        -webkit-backdrop-filter: blur(18px) saturate(140%);
        box-shadow:
            0 14px 30px rgba(0, 0, 0, 0.16),
            inset 0 1px 0 rgba(255, 255, 255, 0.05);
    }

    #profileModal .profile-mobile-tabs {
        width: auto;
        justify-content: center;
        gap: 28px;
        padding-bottom: 2px;
    }

    #profileModal .profile-mobile-tabs .tab-item {
        min-height: 30px;
        padding-bottom: 8px;
        font-size: 15px;
        letter-spacing: -0.12px;
    }

    #profileModal .profile-flip-container,
    #profileModal .profile-flip-inner {
        min-height: 0 !important;
        height: auto !important;
        overflow: visible !important;
    }

    #profileModal .profile-view {
        position: relative !important;
        height: auto !important;
        opacity: 1 !important;
        visibility: visible !important;
        transition: none !important;
        align-items: stretch !important;
    }

    #profileModal .profile-back {
        display: none !important;
    }

    #profileModal .profile-flip-inner.flipped .profile-front {
        display: none !important;
    }

    #profileModal .profile-flip-inner.flipped .profile-back {
        display: block !important;
        opacity: 1 !important;
        pointer-events: auto !important;
        visibility: visible !important;
    }

    #profileModal .profile-front,
    #profileModal .profile-back {
        padding-bottom: 0 !important;
    }

    #profileModal .profile-mobile-sheet {
        display: flex;
        flex-direction: column;
        gap: 14px;
        width: 100%;
        max-width: none;
        margin: 0;
        padding-top: 0;
        padding-bottom: 0;
    }

    #profileModal .profile-mobile-hero-card,
    #profileModal .profile-mobile-card {
        width: 100%;
        max-width: 100%;
        margin: 0;
        border-radius: 18px;
        background: rgba(14, 18, 23, 0.94);
        border-color: rgba(255, 255, 255, 0.055);
        box-shadow:
            inset 0 1px 0 rgba(255, 255, 255, 0.03),
            0 8px 18px rgba(0, 0, 0, 0.04);
    }

    #profileModal .profile-mobile-hero-card {
        display: grid !important;
        grid-template-columns: 76px minmax(0, 1fr);
        grid-template-areas:
            "avatar main"
            "avatar editor";
        column-gap: 16px;
        row-gap: 14px;
        align-items: center;
        padding: 20px 18px;
        position: relative;
        overflow: visible;
    }

    #profileModal .profile-mobile-hero-avatar {
        width: 76px;
        height: 76px;
        grid-row: 1 / span 2;
        justify-self: start;
        align-self: center;
    }

    #profileModal .profile-mobile-hero-main {
        grid-area: main;
        min-width: 0;
        display: flex;
        flex-direction: column;
        justify-content: center;
        gap: 6px;
        padding-right: 0;
    }

    #profileModal .profile-mobile-hero-kicker {
        font-size: 10px;
        letter-spacing: 0.24em;
    }

    #profileModal .profile-mobile-hero-name {
        font-size: 22px;
        line-height: 1.04;
        letter-spacing: -0.42px;
    }

    #profileModal .profile-mobile-hero-meta {
        font-size: 13px;
        line-height: 1.5;
    }

    #profileModal .profile-mobile-hero-actions {
        position: static;
        justify-content: flex-end;
        margin-top: 8px;
    }

    #profileModal .profile-mobile-hero-edit-btn {
        min-height: 34px;
        padding: 0 13px;
        font-size: 12px;
        font-weight: 600;
    }

    #profileModal .profile-mobile-inline-editor {
        position: absolute;
        top: calc(100% - 6px);
        left: calc(18px + 76px + 16px);
        right: 18px;
        grid-column: auto;
        width: auto;
        margin-top: 0;
        z-index: 4;
    }

    #profileModal .profile-mobile-card {
        padding: 18px 18px 16px;
    }

    #profileModal .profile-mobile-card--essential,
    #profileModal .profile-mobile-card--quick {
        transition: margin-top 0.32s cubic-bezier(0.22, 1, 0.36, 1);
    }

    #profileModal .profile-mobile-sheet.is-editing-desktop .profile-mobile-card--essential {
        margin-top: var(--profile-desktop-inline-editor-offset);
    }

    #profileModal .profile-mobile-section-head {
        margin-bottom: 14px;
    }

    #profileModal .profile-mobile-section-title,
    #profileModal .mobile-section-title {
        font-size: 15px;
        letter-spacing: -0.14px;
    }

    #profileModal .profile-mobile-info-row {
        min-height: 52px;
        grid-template-columns: 96px 1fr;
    }

    #profileModal .profile-mobile-info-key {
        font-size: 12px;
    }

    #profileModal .profile-mobile-info-value {
        font-size: 14px;
    }

    #profileModal .profile-mobile-quick-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 12px;
    }

    #profileModal .profile-mobile-quick-card {
        min-height: 112px;
        padding: 14px;
        border-radius: 16px;
        cursor: pointer;
        transition:
            transform 0.22s ease,
            background 0.22s ease,
            border-color 0.22s ease,
            box-shadow 0.22s ease;
    }

    #profileModal .profile-mobile-card--quick .profile-mobile-quick-card:hover {
        transform: translateY(-3px);
        background: rgba(23, 29, 36, 0.98);
        border-color: rgba(159, 202, 255, 0.14);
        box-shadow:
            inset 0 1px 0 rgba(255, 255, 255, 0.04),
            0 12px 28px rgba(0, 0, 0, 0.16);
    }

    #profileModal .profile-mobile-card--quick .profile-mobile-quick-card:hover .profile-mobile-quick-arrow {
        transform: translateX(2px);
        color: rgba(248, 251, 255, 0.88);
    }

    #profileModal .profile-mobile-card--quick .profile-mobile-quick-card:hover .profile-mobile-quick-icon {
        border-color: rgba(159, 202, 255, 0.16);
        color: rgba(248, 251, 255, 0.96);
    }

    #profileModal .profile-mobile-quick-icon {
        width: 36px;
        height: 36px;
        margin-bottom: 18px;
        border-radius: 11px;
    }

    #profileModal .profile-mobile-quick-title {
        font-size: 14px;
    }

    #profileModal .profile-mobile-quick-desc {
        font-size: 11px;
        line-height: 1.44;
    }

    #profileModal .profile-mobile-quick-arrow {
        top: 12px;
        right: 12px;
    }

    #profileModal .profile-security-desktop-layout {
        display: grid;
        grid-template-columns: 172px minmax(0, 1fr);
        gap: 14px;
        min-height: 392px;
        align-items: stretch;
        position: relative;
        isolation: isolate;
        z-index: 2;
    }

    #profileModal .profile-security-desktop-sidebar {
        display: flex;
        flex-direction: column;
        justify-content: center;
        gap: 16px;
        padding: 8px 0;
        position: relative;
        z-index: 3;
    }

    #profileModal .profile-security-desktop-indicator {
        position: absolute;
        inset: 8px 0 auto;
        height: 64px;
        border-radius: 16px;
        background: rgba(255, 255, 255, 0.08);
        border: 1px solid rgba(159, 202, 255, 0.26);
        box-shadow:
            inset 0 1px 0 rgba(255, 255, 255, 0.04),
            0 10px 24px rgba(15, 23, 42, 0.14);
        pointer-events: none;
        opacity: 0;
        z-index: 0;
        transition:
            top 0.3s cubic-bezier(0.25, 0.8, 0.25, 1),
            height 0.3s cubic-bezier(0.25, 0.8, 0.25, 1),
            background 0.24s ease,
            border-color 0.24s ease,
            box-shadow 0.24s ease,
            opacity 0.18s ease;
    }

    #profileModal .profile-security-desktop-indicator.is-danger {
        background: rgba(166, 48, 48, 0.14);
        border-color: rgba(223, 98, 98, 0.24);
        box-shadow:
            inset 0 1px 0 rgba(255, 255, 255, 0.03),
            0 12px 28px rgba(127, 29, 29, 0.12);
    }

    #profileModal .profile-security-desktop-item {
        position: relative;
        z-index: 1;
        display: flex;
        align-items: center;
        gap: 12px;
        padding: 14px 15px;
        border-radius: 16px;
        border: 1px solid rgba(255, 255, 255, 0.05);
        background: rgba(255, 255, 255, 0.025);
        color: rgba(232, 238, 244, 0.72);
        cursor: pointer;
        transition:
            border-color 0.22s ease,
            background 0.22s ease,
            color 0.22s ease,
            transform 0.22s ease;
        text-align: left;
    }

    #profileModal .profile-security-desktop-item * {
        cursor: inherit;
    }

    #profileModal .profile-security-desktop-item:hover {
        background: rgba(255, 255, 255, 0.045);
        color: rgba(248, 251, 255, 0.9);
        transform: translateX(2px);
    }

    #profileModal .profile-security-desktop-item.active {
        background: rgba(255, 255, 255, 0.08);
        border-color: rgba(159, 202, 255, 0.26);
        color: rgba(248, 251, 255, 0.98);
    }

    #profileModal .profile-security-desktop-sidebar.profile-security-desktop-sidebar--indicator-ready .profile-security-desktop-item.active {
        background: transparent;
        border-color: transparent;
        box-shadow: none;
    }

    #profileModal .profile-security-desktop-sidebar.profile-security-desktop-sidebar--indicator-ready .profile-security-desktop-item.active:hover {
        transform: none;
    }

    #profileModal .profile-security-desktop-item--danger.active {
        border-color: rgba(223, 98, 98, 0.24);
        background: rgba(166, 48, 48, 0.14);
        color: #ffe5e5;
    }

    #profileModal .profile-security-desktop-item-icon {
        width: 36px;
        height: 36px;
        display: grid;
        place-items: center;
        border-radius: 12px;
        background: rgba(255, 255, 255, 0.055);
        color: inherit;
        flex-shrink: 0;
    }

    #profileModal .profile-security-desktop-item-title {
        font-size: 14px;
        font-weight: 600;
        letter-spacing: -0.12px;
    }

    #profileModal .profile-security-desktop-content {
        position: relative;
        min-height: 392px;
        padding: 18px 16px;
        border-radius: 18px;
        background: rgba(14, 18, 23, 0.94);
        border: 1px solid rgba(255, 255, 255, 0.055);
        box-shadow:
            inset 0 1px 0 rgba(255, 255, 255, 0.03),
            0 10px 24px rgba(0, 0, 0, 0.05);
        overflow: hidden;
        display: flex;
        align-items: center;
        justify-content: center;
        z-index: 2;
    }

    #profileModal .profile-security-desktop-panel {
        display: none;
        flex: 1 1 auto;
        width: min(100%, 318px);
        max-width: 318px;
        min-height: 100%;
        height: 100%;
        flex-direction: column;
        justify-content: center;
        gap: 14px;
        margin: 0 auto;
    }

    #profileModal .profile-security-desktop-panel.is-active {
        display: flex;
    }

    #profileModal .profile-security-desktop-panel.is-entering > :nth-child(1) {
        animation: staggeredRise 0.48s cubic-bezier(0.25, 0.46, 0.45, 0.94) 0.04s backwards;
    }

    #profileModal .profile-security-desktop-panel.is-entering > :nth-child(2) {
        animation: staggeredRise 0.48s cubic-bezier(0.25, 0.46, 0.45, 0.94) 0.1s backwards;
    }

    #profileModal .profile-security-desktop-panel.is-entering > :nth-child(3) {
        animation: staggeredRise 0.48s cubic-bezier(0.25, 0.46, 0.45, 0.94) 0.16s backwards;
    }

    #profileModal .profile-security-desktop-panel.is-entering > :nth-child(4) {
        animation: staggeredRise 0.48s cubic-bezier(0.25, 0.46, 0.45, 0.94) 0.22s backwards;
    }

    #profileModal .profile-security-desktop-panel.is-entering > :nth-child(5) {
        animation: staggeredRise 0.48s cubic-bezier(0.25, 0.46, 0.45, 0.94) 0.28s backwards;
    }

    #profileModal .profile-security-desktop-title {
        margin: 0 0 4px;
        font-size: 22px;
        font-weight: 600;
        letter-spacing: -0.44px;
        color: rgba(248, 251, 255, 0.98);
        text-align: center;
    }

    #profileModal .profile-security-desktop-title--danger {
        color: #ffe2e2;
    }

    #profileModal .profile-security-desktop-desc {
        margin: 0 0 4px;
        font-size: 13px;
        line-height: 1.6;
        color: rgba(232, 238, 244, 0.56);
        text-align: center;
    }

    #profileModal .profile-security-desktop-desc--danger {
        color: rgba(255, 224, 224, 0.78);
    }

    #profileModal .profile-security-desktop-panel .input-group {
        margin: 0;
    }

    #profileModal .profile-security-desktop-panel .security-input,
    #profileModal .profile-security-desktop-panel .security-input.glass-input {
        background: rgba(10, 14, 18, 0.88) !important;
        border: 1px solid rgba(255, 255, 255, 0.08) !important;
        border-radius: 14px !important;
        color: rgba(255, 255, 255, 0.96) !important;
        min-height: 46px !important;
        padding: 10px 16px !important;
        box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03) !important;
        margin-bottom: 0 !important;
    }

    #profileModal .profile-security-desktop-panel .security-input:focus,
    #profileModal .profile-security-desktop-panel .security-input.glass-input:focus {
        border-color: #9fcaff !important;
        background: rgba(255, 255, 255, 0.042) !important;
        box-shadow: none !important;
    }

    #profileModal .profile-security-desktop-code-row {
        display: flex;
        gap: 12px;
        align-items: stretch;
    }

    #profileModal .profile-security-desktop-code-row .security-input {
        flex: 1;
    }

    #profileModal .profile-security-desktop-code-btn,
    #profileModal .profile-security-desktop-primary-btn,
    #profileModal .profile-security-desktop-danger-btn {
        min-height: 46px;
        border-radius: 14px;
        padding: 0 18px;
        font-family: "SF Pro Display", "PingFang SC", "Helvetica Neue", sans-serif;
        font-size: 14px;
        font-weight: 600;
        letter-spacing: 0.08px;
        border: 1px solid transparent;
        cursor: pointer;
        transition:
            transform 0.22s ease,
            background 0.22s ease,
            border-color 0.22s ease,
            box-shadow 0.22s ease,
            color 0.22s ease,
            filter 0.22s ease;
    }

    #profileModal .profile-security-desktop-code-btn {
        min-width: 120px;
        background: rgba(255, 255, 255, 0.04);
        border-color: rgba(255, 255, 255, 0.08);
        color: rgba(255, 255, 255, 0.9);
    }

    #profileModal .profile-security-desktop-primary-btn {
        align-self: center;
        min-width: 152px;
        margin-top: 12px;
        background: rgba(229, 235, 241, 0.94);
        border-color: rgba(255, 255, 255, 0.18);
        color: #0f141a;
        box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.46);
    }

    #profileModal .profile-security-desktop-danger-btn {
        align-self: center;
        min-width: 152px;
        margin-top: 12px;
        background: rgba(166, 48, 48, 0.3);
        border-color: rgba(223, 98, 98, 0.34);
        color: #ffe1e1;
        box-shadow:
            inset 0 1px 0 rgba(255, 255, 255, 0.05),
            0 4px 10px rgba(72, 12, 12, 0.12);
    }

    #profileModal .profile-security-desktop-code-btn:hover {
        transform: translateY(-2px);
        background: rgba(255, 255, 255, 0.065);
        border-color: rgba(159, 202, 255, 0.18);
        box-shadow:
            inset 0 1px 0 rgba(255, 255, 255, 0.05),
            0 10px 20px rgba(0, 0, 0, 0.12);
        color: rgba(248, 251, 255, 0.96);
    }

    #profileModal .profile-security-desktop-primary-btn:hover {
        transform: translateY(-2px);
        background: rgba(241, 245, 249, 0.98);
        border-color: rgba(255, 255, 255, 0.28);
        box-shadow:
            inset 0 1px 0 rgba(255, 255, 255, 0.58),
            0 12px 24px rgba(0, 0, 0, 0.14);
        filter: brightness(1.01);
    }

    #profileModal .profile-security-desktop-danger-btn:hover {
        transform: translateY(-2px);
        background: rgba(177, 58, 58, 0.38);
        border-color: rgba(239, 116, 116, 0.44);
        box-shadow:
            inset 0 1px 0 rgba(255, 255, 255, 0.07),
            0 12px 24px rgba(72, 12, 12, 0.18);
        color: #fff0f0;
    }

    #profileModal .mobile-security-layout {
        display: none !important;
    }
}

@media (max-width: 360px) {
    #profileModal {
        --profile-mobile-modal-radius: 16px;
    }
}

[data-theme="light"] #profileModal {
    background: var(--public-light-modal-backdrop);
    backdrop-filter: var(--public-light-modal-backdrop-filter);
    -webkit-backdrop-filter: var(--public-light-modal-backdrop-filter);
    overscroll-behavior: contain;
    overscroll-behavior-y: contain;
}

[data-theme="light"] #profileModal::-webkit-scrollbar-thumb,
[data-theme="light"] #profileModal .profile-modal-scroll::-webkit-scrollbar-thumb,
[data-theme="light"] #profileModal .modal-content.profile-modal::-webkit-scrollbar-thumb {
    background: rgba(148, 163, 184, 0.32);
}

[data-theme="light"] #profileModal::-webkit-scrollbar-thumb:hover,
[data-theme="light"] #profileModal .profile-modal-scroll::-webkit-scrollbar-thumb:hover,
[data-theme="light"] #profileModal .modal-content.profile-modal::-webkit-scrollbar-thumb:hover {
    background: rgba(148, 163, 184, 0.5);
}

[data-theme="light"] #profileModal .modal-content.profile-modal {
    color: #0f172a;
    background: rgba(255, 255, 255, 0.98) !important;
    border: 1px solid rgba(148, 163, 184, 0.2) !important;
    box-shadow:
        0 28px 60px rgba(148, 163, 184, 0.24),
        inset 0 1px 0 rgba(255, 255, 255, 0.96) !important;
}

[data-theme="light"] #profileModal .profile-mobile-topbar-shell {
    background: rgba(255, 255, 255, 0.82);
    border: 1px solid rgba(148, 163, 184, 0.18);
    box-shadow:
        0 16px 36px rgba(148, 163, 184, 0.18),
        inset 0 1px 0 rgba(255, 255, 255, 0.92);
}

[data-theme="light"] #profileModal .profile-mobile-tabs .tab-item {
    color: #94a3b8;
}

[data-theme="light"] #profileModal .profile-mobile-tabs .tab-item:hover {
    color: #475569;
}

[data-theme="light"] #profileModal .profile-mobile-tabs .tab-item.active {
    color: #0f172a;
}

[data-theme="light"] #profileModal .profile-mobile-tab-indicator {
    background: #6b9ece;
}

[data-theme="light"] #profileModal :is(
    .profile-mobile-hero-card,
    .profile-mobile-card,
    .mobile-security-section,
    .profile-security-desktop-content
) {
    background: rgba(255, 255, 255, 0.98);
    border-color: rgba(148, 163, 184, 0.18);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.96),
        0 16px 34px rgba(148, 163, 184, 0.14);
}

[data-theme="light"] #profileModal :is(
    .profile-mobile-hero-avatar,
    .profile-mobile-quick-card,
    .profile-mobile-quick-icon,
    .profile-mobile-hero-edit-btn,
    .profile-mobile-editor-btn--ghost,
    .security-mobile-code-btn,
    .profile-security-desktop-code-btn,
    .profile-security-desktop-item,
    .profile-security-desktop-item-icon
) {
    background: rgba(248, 250, 252, 0.98);
    border-color: rgba(148, 163, 184, 0.18);
    color: #334155;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.94);
}

[data-theme="light"] #profileModal .profile-mobile-hero-avatar-editmark {
    background: rgba(255, 255, 255, 0.98);
    border-color: rgba(148, 163, 184, 0.22);
    box-shadow:
        0 10px 22px rgba(148, 163, 184, 0.18),
        inset 0 1px 0 rgba(255, 255, 255, 0.96);
}

[data-theme="light"] #profileModal .profile-mobile-hero-avatar-editmark::before {
    background: #475569;
}

[data-theme="light"] #profileModal .profile-mobile-hero-avatar-editmark::after {
    background: #6b9ece;
}

[data-theme="light"] #profileModal :is(
    .profile-mobile-hero-name,
    .profile-mobile-section-title,
    .mobile-section-title,
    .profile-mobile-info-value,
    .profile-mobile-quick-title,
    .profile-security-desktop-title,
    .profile-security-desktop-item-title
) {
    color: #0f172a;
}

[data-theme="light"] #profileModal .profile-mobile-hero-meta {
    color: #57708e;
}

[data-theme="light"] #profileModal :is(
    .profile-mobile-hero-kicker,
    .profile-mobile-info-key,
    .profile-mobile-quick-desc,
    .mobile-section-desc,
    .profile-security-desktop-desc
) {
    color: #64748b;
}

[data-theme="light"] #profileModal .profile-mobile-quick-arrow {
    color: #94a3b8;
}

[data-theme="light"] #profileModal .profile-mobile-inline-editor.is-visible {
    border-top-color: rgba(148, 163, 184, 0.18);
}

[data-theme="light"] #profileModal :is(
    .profile-mobile-inline-input,
    .security-input,
    .security-input.glass-input
) {
    background: #ffffff !important;
    border-color: rgba(148, 163, 184, 0.22) !important;
    color: #0f172a !important;
    -webkit-text-fill-color: #0f172a !important;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.96) !important;
    caret-color: #6b9ece;
}

[data-theme="light"] #profileModal :is(
    .profile-mobile-inline-input:focus,
    .profile-mobile-inline-input:focus-visible,
    .security-input:focus,
    .security-input.glass-input:focus
) {
    border-color: rgba(107, 158, 206, 0.42) !important;
    background: #ffffff !important;
    box-shadow: 0 0 0 3px rgba(107, 158, 206, 0.16) !important;
}

[data-theme="light"] #profileModal .security-input::placeholder {
    color: rgba(100, 116, 139, 0.45) !important;
    -webkit-text-fill-color: rgba(100, 116, 139, 0.45) !important;
    opacity: 1 !important;
    font-size: 13px !important;
    font-weight: 400 !important;
    letter-spacing: 0 !important;
    line-height: 1.2 !important;
}

[data-theme="light"] #profileModal .security-input::-webkit-input-placeholder {
    color: rgba(100, 116, 139, 0.45) !important;
    -webkit-text-fill-color: rgba(100, 116, 139, 0.45) !important;
    opacity: 1 !important;
    font-size: 13px !important;
    font-weight: 400 !important;
    letter-spacing: 0 !important;
    line-height: 1.2 !important;
}

[data-theme="light"] #profileModal .security-input::-moz-placeholder {
    color: rgba(100, 116, 139, 0.45) !important;
    opacity: 1 !important;
    font-size: 13px !important;
    font-weight: 400 !important;
    letter-spacing: 0 !important;
    line-height: 1.2 !important;
}

[data-theme="light"] #profileModal .security-input:-ms-input-placeholder {
    color: rgba(100, 116, 139, 0.45) !important;
    opacity: 1 !important;
    font-size: 13px !important;
    font-weight: 400 !important;
    letter-spacing: 0 !important;
    line-height: 1.2 !important;
}

[data-theme="light"] #profileModal .profile-mobile-inline-input::placeholder,
[data-theme="light"] #profileModal .profile-mobile-inline-input::-webkit-input-placeholder,
[data-theme="light"] #profileModal .profile-mobile-inline-input::-moz-placeholder,
[data-theme="light"] #profileModal .profile-mobile-inline-input:-ms-input-placeholder {
    color: #64748b !important;
    -webkit-text-fill-color: #64748b !important;
    opacity: 1 !important;
    font-weight: 400 !important;
}

[data-theme="light"] #profileModal :is(
    .profile-mobile-inline-input,
    .security-input,
    .security-input.glass-input
):-webkit-autofill,
[data-theme="light"] #profileModal :is(
    .profile-mobile-inline-input,
    .security-input,
    .security-input.glass-input
):-webkit-autofill:hover,
[data-theme="light"] #profileModal :is(
    .profile-mobile-inline-input,
    .security-input,
    .security-input.glass-input
):-webkit-autofill:focus,
[data-theme="light"] #profileModal :is(
    .profile-mobile-inline-input,
    .security-input,
    .security-input.glass-input
):-webkit-autofill:focus-visible {
    -webkit-text-fill-color: #0f172a !important;
    caret-color: #6b9ece !important;
    box-shadow:
        0 0 0 1000px #ffffff inset !important,
        inset 0 1px 0 rgba(255, 255, 255, 0.96) !important;
}

[data-theme="light"] #profileModal :is(
    .profile-mobile-editor-btn--primary,
    .security-mobile-primary-btn,
    .profile-security-desktop-primary-btn
) {
    background: #6b9ece;
    border-color: #6b9ece;
    color: #ffffff;
    box-shadow: 0 14px 28px rgba(107, 158, 206, 0.22);
}

[data-theme="light"] #profileModal :is(
    .security-mobile-danger-btn,
    .profile-security-desktop-danger-btn
) {
    background: rgba(254, 242, 242, 0.98);
    border-color: rgba(248, 113, 113, 0.28);
    color: #dc2626;
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.96),
        0 12px 24px rgba(248, 113, 113, 0.1);
}

[data-theme="light"] #profileModal .profile-mobile-quick-card:hover {
    background: rgba(107, 158, 206, 0.12);
    border-color: rgba(107, 158, 206, 0.28);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.96),
        0 16px 32px rgba(148, 163, 184, 0.16);
}

[data-theme="light"] #profileModal .profile-mobile-quick-card:hover .profile-mobile-quick-arrow {
    color: #6b9ece;
}

[data-theme="light"] #profileModal .profile-mobile-quick-card:hover .profile-mobile-quick-icon {
    background: #ffffff;
    border-color: rgba(107, 158, 206, 0.22);
    color: #6b9ece;
}

[data-theme="light"] #profileModal .profile-security-desktop-item:hover {
    background: rgba(107, 158, 206, 0.12);
    border-color: rgba(107, 158, 206, 0.24);
    color: #5f8fbc;
}

[data-theme="light"] #profileModal .profile-security-desktop-item.active {
    background: rgba(107, 158, 206, 0.22);
    border-color: rgba(107, 158, 206, 0.42);
    color: #5a86b3;
}

[data-theme="light"] #profileModal .profile-security-desktop-item-icon {
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.96) 0%, rgba(244, 248, 252, 0.96) 100%);
    border: 1px solid rgba(148, 163, 184, 0.18);
    color: #475569;
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.96),
        0 8px 18px rgba(148, 163, 184, 0.1);
}

[data-theme="light"] #profileModal .profile-security-desktop-item:hover .profile-security-desktop-item-icon,
[data-theme="light"] #profileModal .profile-security-desktop-item.active .profile-security-desktop-item-icon {
    background: #ffffff;
    border-color: rgba(107, 158, 206, 0.22);
    color: #5f8fbc;
}

[data-theme="light"] #profileModal .profile-security-desktop-indicator {
    background: rgba(107, 158, 206, 0.18);
    border-color: rgba(107, 158, 206, 0.3);
    box-shadow: 0 10px 22px rgba(107, 158, 206, 0.12);
}

[data-theme="light"] #profileModal .profile-security-desktop-indicator.is-danger {
    background: rgba(239, 68, 68, 0.08);
    border-color: rgba(239, 68, 68, 0.24);
    box-shadow: 0 10px 22px rgba(239, 68, 68, 0.08);
}

[data-theme="light"] #profileModal .profile-security-desktop-sidebar.profile-security-desktop-sidebar--indicator-ready .profile-security-desktop-item.active {
    background: transparent;
    border-color: transparent;
    box-shadow: none;
}

[data-theme="light"] #profileModal .profile-security-desktop-item--danger.active {
    background: rgba(254, 242, 242, 0.96);
    border-color: rgba(248, 113, 113, 0.24);
    color: #dc2626;
}

[data-theme="light"] #profileModal .profile-security-desktop-item--danger .profile-security-desktop-item-icon,
[data-theme="light"] #profileModal .profile-security-desktop-item--danger.active .profile-security-desktop-item-icon {
    border-color: rgba(248, 113, 113, 0.18);
    color: #dc2626;
}

[data-theme="light"] #profileModal .profile-security-desktop-title--danger,
[data-theme="light"] #profileModal .mobile-section-title.danger {
    color: #dc2626;
}

[data-theme="light"] #profileModal .profile-security-desktop-desc--danger {
    color: #b91c1c;
}

[data-theme="light"] #profileModal :is(
    .profile-security-desktop-code-btn:hover,
    .profile-mobile-hero-edit-btn:hover,
    .profile-mobile-editor-btn--ghost:hover
) {
    background: rgba(107, 158, 206, 0.12);
    border-color: rgba(107, 158, 206, 0.22);
    color: #5f8fbc;
}

[data-theme="light"] #profileModal :is(
    .profile-mobile-editor-btn--primary:hover,
    .security-mobile-primary-btn:hover,
    .profile-security-desktop-primary-btn:hover
) {
    background: #5f8fbc;
    border-color: #5f8fbc;
    color: #ffffff;
}

[data-theme="light"] #profileModal :is(
    .security-mobile-danger-btn:hover,
    .profile-security-desktop-danger-btn:hover
) {
    background: rgba(254, 226, 226, 0.98);
    border-color: rgba(248, 113, 113, 0.34);
    color: #b91c1c;
}

html.profile-modal-lock,
body.profile-modal-lock {
    overflow: hidden !important;
    overscroll-behavior: none !important;
}

#profileModal.keyboard-active {
    align-items: flex-start !important;
}

.save-btn,
.cancel-btn {
    padding: 8px 18px;
    border-radius: 6px;
    font-size: 14px;
    cursor: pointer;
    border: none;
    transition: all 0.2s ease;
    font-weight: 500;
}

.save-btn {
    background: linear-gradient(135deg, #a855f7 0%, #f472b6 50%, #fb7185 100%);
    color: white;
    box-shadow: 0 2px 10px rgba(244, 114, 182, 0.3);
}

.save-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(244, 114, 182, 0.4);
    filter: brightness(1.1);
}

.login-trigger-btn.logged-in {
    background: transparent;
    border: none;
    box-shadow: none;
    padding: 0;
    width: auto;
    height: auto;
}

.login-trigger-btn.logged-in:hover {
    background: transparent;
    border: none;
    box-shadow: none;
    transform: scale(1.05);
}

.cancel-btn {
    /* 与安全页面次要按钮风格一致 */
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: white;
}

.cancel-btn:hover {
    background: rgba(0, 0, 0, 0.5);
    border-color: rgba(255, 255, 255, 0.25);
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

/* Profile Flip Animation - Text Staggered Rise Effect */
.profile-flip-container {
    width: 100%;
    min-height: 580px;
    position: relative;
    transition: min-height 0.3s ease;
    overflow: hidden;
}

.profile-flip-inner {
    position: relative;
    width: 100%;
    height: 100%;
    text-align: center;
    min-height: 500px;
}

.profile-view {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    display: flex !important;
    flex-direction: column;
    justify-content: flex-start;
    align-items: center;
    /* 淡入淡出过渡 */
    transition: opacity 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    will-change: opacity;
    padding-bottom: 20px;
}

.profile-front {
    z-index: 2;
    opacity: 1;
    pointer-events: auto;
    visibility: visible;
}

.profile-back {
    z-index: 1;
    opacity: 0;
    pointer-events: none;
    visibility: hidden;
}

/* Flip State Class - 切换到安全页面 */
.profile-flip-inner.flipped .profile-front {
    opacity: 0;
    pointer-events: none;
    visibility: hidden;
}

.profile-flip-inner.flipped .profile-back {
    opacity: 1;
    pointer-events: auto;
    visibility: visible;
}

/* 错落上升动画关键帧 */
@keyframes staggeredRise {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.tab-item {
    padding: 6px 24px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    color: rgba(255, 255, 255, 0.6);
    transition: all 0.2s;
}

.tab-item:hover {
    color: rgba(255, 255, 255, 0.9);
    background: rgba(255, 255, 255, 0.05);
}

.tab-item.active {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    font-weight: 500;
}

.security-input {
    width: 100%;
    box-sizing: border-box;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(155, 93, 229, 0.5);
    border-radius: 12px;
    padding: 10px 16px;
    color: white;
    font-size: 14px;
    margin-bottom: 12px;
    outline: none;
    letter-spacing: 0.3px;
    caret-color: #9fcaff;
    transition: all 0.3s ease;
}

.security-input::placeholder {
    color: rgba(255, 255, 255, 0.4) !important;
    font-size: 13px !important;
    font-weight: 300 !important;
    letter-spacing: 0.5px !important;
    text-shadow: none;
}

.security-input::-webkit-input-placeholder {
    color: rgba(255, 255, 255, 0.4) !important;
    font-size: 13px !important;
    font-weight: 300 !important;
    letter-spacing: 0.5px !important;
    text-shadow: none;
}

.security-input:focus {
    outline: none;
    border-color: #9fcaff;
    background: rgba(255, 255, 255, 0.042) !important;
    box-shadow: none;
}

.danger-zone {
    /* 危险区域更明显的区分 */
    border-color: rgba(239, 68, 68, 0.4);
    background: rgba(239, 68, 68, 0.12);
    box-shadow:
        0 2px 8px rgba(239, 68, 68, 0.2),
        inset 0 1px 3px rgba(0, 0, 0, 0.3);
}

.danger-zone::before {
    background: linear-gradient(180deg, rgba(239, 68, 68, 0.8), rgba(220, 38, 38, 0.8));
}

.text-red {
    /* 恢复纯色 */
    color: #ef4444;
}

.danger-btn {
    width: 100%;
    padding: 10px;
    background: #ef4444;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    transition: all 0.2s ease;
}

.danger-btn:hover {
    background: #dc2626;
    transform: translateY(-1px);
}

.secondary-btn {
    padding: 6px 14px;
    /* 更深的背景，与输入框保持一致 */
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: white;
    border-radius: 6px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    /* 恢复纯色文字 */
}

.secondary-btn:hover {
    background: rgba(0, 0, 0, 0.5);
    border-color: rgba(255, 255, 255, 0.25);
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}


/* Member Since Badge */
.member-since-badge {
    margin-top: 0;
    margin-bottom: 0;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    /* 与安全页面模块风格一致 */
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 20px;
    font-size: 12px;
    color: rgba(255, 255, 255, 0.6);
    box-shadow:
        0 2px 8px rgba(0, 0, 0, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.05);
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.member-since-badge:hover {
    border-color: rgba(255, 255, 255, 0.18);
    box-shadow:
        0 4px 12px rgba(0, 0, 0, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.08);
    transform: translateY(-2px);
}

/* Menu Items - Mac Style */

/* Menu Items - Mac Style */
.menu-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 12px;
    color: rgba(255, 255, 255, 0.9);
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.15s ease;
    font-size: 13px;
    font-weight: 400;
    margin: 2px 0;
    white-space: nowrap;
    /* Prevent text wrapping */
}


.menu-item:hover {
    background: rgba(0, 122, 255, 0.8);
    /* macOS 系统蓝色 - 明亮高光 */
    color: rgba(255, 255, 255, 1);
}

.menu-item svg {
    width: 16px;
    height: 16px;
    opacity: 0.8;
}

/* Switch Account Button - Mac Style with Purple Theme */
.menu-item.switch-account {
    color: rgba(255, 255, 255, 0.9);
}

.menu-item.switch-account:hover {
    background: rgba(0, 122, 255, 0.8);
    /* macOS 系统蓝色 - 与其他菜单项保持一致 */
    color: rgba(255, 255, 255, 1);
}

.menu-item.switch-account:active {
    background: rgba(0, 122, 255, 0.9);
    /* 点击时颜色更深 */
}

/* Log Out Button - Mac Style */
.menu-item.logout {
    color: rgba(255, 255, 255, 0.9);
    margin-top: 4px;
}

.menu-item.logout:hover {
    background: rgba(0, 122, 255, 0.8);
    /* macOS 系统蓝色 - 明亮高光 */
    color: rgba(255, 255, 255, 1);
}

.menu-item.logout:active {
    background: rgba(0, 122, 255, 0.9);
    /* 点击时颜色更深 */
}

/* Divider */
.divider {
    margin: 6px 0 !important;
    border-top: 1px solid rgba(255, 255, 255, 0.08) !important;
}

/* Avatar overlay icon repositioned */
.avatar-overlay-icon {
    position: absolute;
    bottom: 0;
    right: 0;
    transform: translate(25%, 25%);
    width: 24px;
    height: 24px;
    background: rgba(59, 130, 246, 0.9);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 10px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    transition: all 0.2s;
    pointer-events: none;
}

.login-divider::before {
    content: "";
    position: absolute;
    left: 0;
    top: 50%;
    width: 100%;
    height: 1px;
    background: rgba(255, 255, 255, 0.3);
}

.login-divider span {
    position: relative;
    background: transparent;
    padding: 0 10px;
    color: rgba(255, 255, 255, 0.4);
    font-size: 12px;
    z-index: 1;
}

/* Google Quick Login */
.google-btn {
    width: 100%;
    padding: 12px;
    border-radius: 12px;
    background: white;
    color: #333;
    border: none;
    font-weight: 500;
    font-size: 14px;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    transition: 0.2s;
}

.google-btn:hover {
    background: #f0f0f0;
}

/* Mobile Responsive for Login */
@media (max-width: 480px) {
    .top-right-nav {
        top: 20px;
        right: 20px;
    }

    .login-card {
        width: 90%;
        padding: 30px 20px;
    }
}

/* --- Dual Mode Login System Styles --- */

/* View Switching Animation */
.form-view {
    animation: fadeIn 0.4s ease forwards;
    position: relative;
    z-index: 1;
    pointer-events: auto;
}

.hidden {
    display: none;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Switch Links */
.switch-text {
    text-align: center;
    margin-top: 24px;
    color: rgba(255, 255, 255, 0.6);
    font-size: 14px;
    font-weight: 400;
}

.switch-link {
    color: #f15bb5;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.2s ease;
    margin-left: 6px;
    display: inline-block;
}

.switch-link:hover {
    color: #ff85c0;
    text-decoration: none;
    transform: translateY(-1px);
}

.switch-link:active {
    transform: translateY(0);
}

/* Pink style for "返回登录" link */
.back-to-login {
    color: #f15bb5 !important;
    font-weight: 500 !important;
}

.back-to-login:hover {
    color: #ff85c0 !important;
}

/* Checkbox Styles */
.checkbox-wrapper {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: rgba(255, 255, 255, 0.6);
    margin-bottom: 15px;
}

.custom-checkbox {
    accent-color: #9b5de5;
    width: 16px;
    height: 16px;
    cursor: pointer;
}

/* Ensure card handles overflow gracefully */
.login-card {
    overflow: hidden;
    /* Prevent content spill during animation */
}

/* Global Guestbook Input Styles */
.guestbook-form input,
.guestbook-form textarea {
    width: 100%;
    padding: 14px 16px;
    border-radius: 12px;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: white;
    /* CRITICAL: iOS Safari zooms if font-size < 16px */
    font-size: 16px !important;
    outline: none;
    box-sizing: border-box;
    transition: 0.3s;
    font-family: inherit;
}

.guestbook-form input:focus,
.guestbook-form textarea:focus {
    border-color: #9b5de5;
    background: rgba(0, 0, 0, 0.4);
}

.guestbook-form textarea {
    min-height: 100px;
    resize: vertical;
}

/* Verification Code Input Container */
.input-with-action {
    position: relative;
    display: flex;
    align-items: center;
}

/* Adjust input to make room for the button */
.input-with-action .glass-input {
    padding-right: 130px !important;
    /* Right padding to prevent text overlap with button */
    position: relative;
    z-index: 1;
}

/* Send Verification Code Button */
.verify-code-btn {
    position: absolute;
    right: 8px;
    /* Distance from right border */
    top: 50%;
    transform: translateY(-50%);
    z-index: 10;

    padding: 6px 12px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    background: rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.9);
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s;
    pointer-events: auto !important;
}

.verify-code-btn:hover {
    background: rgba(168, 85, 247, 0.2);
    border-color: rgba(244, 114, 182, 0.5);
    color: #f472b6;
}

/* Disabled state for countdown */
.verify-code-btn:disabled {
    cursor: not-allowed;
    background: transparent;
    border-color: transparent;
    color: rgba(255, 255, 255, 0.3);
}



/* User Avatar Styles */
.nav-user-avatar {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    object-fit: cover;
    border: none;
    margin-right: 4px;
}

.login-trigger-btn {
    /* Ensure button looks good with avatar */
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    height: 40px;
    background: transparent !important;
    border: none !important;
    border-radius: 20px;
    color: white;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: none !important;
}

.login-trigger-btn:hover {
    background: transparent;
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
}

/* --- Mobile Responsive --- */
@media screen and (max-width: 768px) {

    .glass-card,
    .login-card {
        width: 90%;
        padding: 30px 20px;
    }

    .top-right-nav {
        top: 20px;
        right: 20px;
        position: fixed !important;
        /* Fix position on mobile */
        z-index: 2000;
    }

    .card-title {
        font-size: 22px;
    }

    .user-dropdown {
        right: 0;
        width: 180px;
    }
}

/* ==================== 评论表单按钮样式 ==================== */
.form-actions {
    display: flex;
    gap: 12px;
    margin-top: 16px;
}

/* 次要按钮 - 取消按钮 */
.cancel-btn {
    flex: 1;
    padding: 10px 20px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

.cancel-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.2);
    color: rgba(255, 255, 255, 0.9);
    transform: translateY(-1px);
}

.cancel-btn:active {
    transform: translateY(0);
}

/* 主要按钮 - 发送按钮（保持原有submit-btn样式）*/
.submit-btn {
    flex: 1;
}

/* Global Animation Keyframes */

/* Elastic Fade In Up (for content blocks) */
@keyframes fadeInUpElastic {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Elastic Fade In Down (for dropdowns) */
@keyframes fadeInDownElastic {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Utility class for staggered animation base */
.animate-stagger {
    opacity: 0;
    /* Start hidden */
    animation: fadeInUpElastic 0.6s ease-out forwards;
}

/* =========================================
   GLOBAL CURSOR FIX - FORCE RESET
   ========================================= */
body,
html {
    cursor: default !important;
}

/* Only allow pointer on interactive elements */
a,
button,
input[type="button"],
input[type="submit"],
[role="button"],
.glass-box,
.pointer-cursor,
.mac-dot,
.close-btn,
.submit-btn,
.upload-icon-btn,
.view-more-btn {
    cursor: pointer !important;
}

/* Ensure modal overlay doesn't have pointer */
.modal-overlay,
.login-overlay,
.dropdown-backdrop,
.background-blobs,
.aurora-overlay {
    cursor: default !important;
}

/* Ensure modal content inherits correctly or resets */
.modal-content,
.login-card {
    cursor: default !important;
}

/* Menu Items - Mac Style */

/* Menu Items - Mac Style */
.menu-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 12px;
    color: rgba(255, 255, 255, 0.9);
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.15s ease;
    font-size: 13px;
    font-weight: 400;
    margin: 2px 0;
}

.menu-item:hover {
    background: rgba(0, 122, 255, 0.8);
    /* macOS 系统蓝色 - 明亮高光 */
    color: rgba(255, 255, 255, 1);
}

.menu-item svg {
    width: 16px;
    height: 16px;
    opacity: 0.8;
}

/* Switch Account Button - Mac Style with Purple Theme */
.menu-item.switch-account {
    color: rgba(255, 255, 255, 0.9);
}

.menu-item.switch-account:hover {
    background: rgba(0, 122, 255, 0.8);
    /* macOS 系统蓝色 - 与其他菜单项保持一致 */
    color: rgba(255, 255, 255, 1);
}

.menu-item.switch-account:active {
    background: rgba(0, 122, 255, 0.9);
    /* 点击时颜色更深 */
}

/* Log Out Button - Mac Style */
.menu-item.logout {
    color: rgba(255, 255, 255, 0.9);
    margin-top: 4px;
}

.menu-item.logout:hover {
    background: rgba(0, 122, 255, 0.8);
    /* macOS 系统蓝色 - 明亮高光 */
    color: rgba(255, 255, 255, 1);
}

.menu-item.logout:active {
    background: rgba(0, 122, 255, 0.9);
    /* 点击时颜色更深 */
}

/* Divider */
.divider {
    margin: 6px 0 !important;
    border-top: 1px solid rgba(255, 255, 255, 0.08) !important;
}

/* Avatar overlay icon repositioned */
.avatar-overlay-icon {
    position: absolute;
    bottom: 0;
    right: 0;
    transform: translate(25%, 25%);
    width: 24px;
    height: 24px;
    background: rgba(59, 130, 246, 0.9);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 10px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    transition: all 0.2s;
    pointer-events: none;
}

.login-divider::before {
    content: "";
    position: absolute;
    left: 0;
    top: 50%;
    width: 100%;
    height: 1px;
    background: rgba(255, 255, 255, 0.3);
}

.login-divider span {
    position: relative;
    background: transparent;
    padding: 0 10px;
    color: rgba(255, 255, 255, 0.4);
    font-size: 12px;
    z-index: 1;
}

/* Google Quick Login */
.google-btn {
    width: 100%;
    padding: 12px;
    border-radius: 12px;
    background: white;
    color: #333;
    border: none;
    font-weight: 500;
    font-size: 14px;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    transition: 0.2s;
}

.google-btn:hover {
    background: #f0f0f0;
}

/* Mobile Responsive for Login */
@media (max-width: 480px) {
    .top-right-nav {
        top: 20px;
        right: 20px;
    }

    .login-card {
        width: 90%;
        padding: 30px 20px;
    }
}

/* --- Dual Mode Login System Styles --- */

/* View Switching Animation */
.form-view {
    animation: fadeIn 0.4s ease forwards;
    position: relative;
    z-index: 1;
    pointer-events: auto;
}

.hidden {
    display: none;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Switch Links */
.switch-text {
    text-align: center;
    margin-top: 24px;
    color: rgba(255, 255, 255, 0.6);
    font-size: 14px;
    font-weight: 400;
}

.switch-link {
    color: #f15bb5;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.2s ease;
    margin-left: 6px;
    display: inline-block;
}

.switch-link:hover {
    color: #ff85c0;
    text-decoration: none;
    transform: translateY(-1px);
}

.switch-link:active {
    transform: translateY(0);
}

/* Pink style for "返回登录" link */
.back-to-login {
    color: #f15bb5 !important;
    font-weight: 500 !important;
}

.back-to-login:hover {
    color: #ff85c0 !important;
}

/* Checkbox Styles */
.checkbox-wrapper {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: rgba(255, 255, 255, 0.6);
    margin-bottom: 15px;
}

.custom-checkbox {
    accent-color: #9b5de5;
    width: 16px;
    height: 16px;
    cursor: pointer;
}

/* Ensure card handles overflow gracefully */
.login-card {
    overflow: hidden;
    /* Prevent content spill during animation */
}

/* Global Guestbook Input Styles */
.guestbook-form input,
.guestbook-form textarea {
    width: 100%;
    padding: 14px 16px;
    border-radius: 12px;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: white;
    /* CRITICAL: iOS Safari zooms if font-size < 16px */
    font-size: 16px !important;
    outline: none;
    box-sizing: border-box;
    transition: 0.3s;
    font-family: inherit;
}

.guestbook-form input:focus,
.guestbook-form textarea:focus {
    border-color: #9b5de5;
    background: rgba(0, 0, 0, 0.4);
}

.guestbook-form textarea {
    min-height: 100px;
    resize: vertical;
}

/* Verification Code Input Container */
/* Verification Code Input Container */
.input-with-action {
    display: grid !important;
    grid-template-columns: 1fr auto !important;
    gap: 12px !important;
    align-items: center !important;
    position: relative !important;
    flex-direction: unset !important;
}

/* Input takes available space */
.input-with-action .glass-input {
    width: 100% !important;
    min-width: 0 !important;
    padding-right: 16px !important;
    position: relative !important;
    flex: unset !important;
}

/* Send Verification Code Button - below input, aligned right */
/* Send Verification Code Button */
.verify-code-btn {
    width: auto !important;
    white-space: nowrap !important;
    position: relative !important;
    top: auto !important;
    right: auto !important;
    transform: none !important;
    margin: 0 !important;
    align-self: center !important;

    padding: 14px 20px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    background: rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.9);
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s;
}

.verify-code-btn:hover {
    background: rgba(168, 85, 247, 0.2);
    border-color: rgba(244, 114, 182, 0.5);
    color: #f472b6;
}

/* Disabled state for countdown */
.verify-code-btn:disabled {
    cursor: not-allowed;
    background: transparent;
    border-color: transparent;
    color: rgba(255, 255, 255, 0.3);
}

/* 已删除重复的logout样式定义 - 使用3531-3543行的统一定义 */

/* User Avatar Styles */
.nav-user-avatar {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    object-fit: cover;
    border: none;
    margin-right: 4px;
}

.login-trigger-btn {
    /* Ensure button looks good with avatar */
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    height: 40px;
    background: transparent;
    border: none;
    border-radius: 20px;
    color: white;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.login-trigger-btn:hover {
    background: transparent;
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
}

/* --- Mobile Responsive --- */
@media screen and (max-width: 768px) {

    .glass-card,
    .login-card {
        width: 90%;
        padding: 30px 20px;
    }

    .top-right-nav {
        top: 20px;
        right: 20px;
        position: fixed !important;
        /* Fix position on mobile */
        z-index: 2000;
    }

    .card-title {
        font-size: 22px;
    }

    .user-dropdown {
        right: 0;
        width: 180px;
    }
}

/* ==================== 评论表单按钮样式 ==================== */
.form-actions {
    display: flex;
    gap: 12px;
    margin-top: 16px;
}

/* 次要按钮 - 取消按钮 */
.cancel-btn {
    flex: 1;
    padding: 10px 20px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

.cancel-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.2);
    color: rgba(255, 255, 255, 0.9);
    transform: translateY(-1px);
}

.cancel-btn:active {
    transform: translateY(0);
}

/* 主要按钮 - 发送按钮（保持原有submit-btn样式）*/
.submit-btn {
    flex: 1;
}

/* Global Animation Keyframes */

/* Elastic Fade In Up (for content blocks) */
@keyframes fadeInUpElastic {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Elastic Fade In Down (for dropdowns) */
@keyframes fadeInDownElastic {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Utility class for staggered animation base */
.animate-stagger {
    opacity: 0;
    /* Start hidden */
    animation: fadeInUpElastic 0.6s ease-out forwards;
}

/* =========================================
   GLOBAL CURSOR FIX - FORCE RESET
   ========================================= */
body,
html {
    cursor: default !important;
}

/* Only allow pointer on interactive elements */
a,
button,
input[type="button"],
input[type="submit"],
[role="button"],
.glass-box,
.pointer-cursor,
.mac-dot,
.close-btn,
.submit-btn,
.upload-icon-btn,
.view-more-btn {
    cursor: pointer !important;
}

/* Ensure modal overlay doesn't have pointer */
.modal-overlay,
.login-overlay,
.dropdown-backdrop,
.background-blobs,
.aurora-overlay {
    cursor: default !important;
}

/* Ensure modal content inherits correctly or resets */
.modal-content,
.login-card {
    cursor: default !important;
}

/* =========================================
   CRITICAL FIX: Unclickable Blocks Issue
   ========================================= */
/* Use visibility and opacity instead of display:none to preserve animations */
/* The base class .modal-overlay now handles visibility transition correctly */
.modal-overlay:not(.active),
.login-overlay:not(.active) {
    /* pointer-events: none is already in base class, but keep for safety */
    pointer-events: none !important;
    /* visibility: hidden is handled by base class transition */
}

/* =========================================
   CRITICAL FIX: Comment Input Visibility
   ========================================= */
/* =========================================
   CRITICAL FIX: Comment Input Visibility & Global Input Fix
   ========================================= */
.guestbook-form input,
.guestbook-form textarea,
.modal-content input:not(.security-input),
.modal-content textarea,
.login-card input,
.login-card textarea,
.nickname-edit input {
    background: rgba(255, 255, 255, 0.1) !important;
    border: 1px solid rgba(255, 255, 255, 0.2) !important;
    color: white !important;
    caret-color: white !important;
    /* Cursor color */
}

.guestbook-form input::placeholder,
.guestbook-form textarea::placeholder,
.guestbook-form input::-webkit-input-placeholder,
.guestbook-form textarea::-webkit-input-placeholder,
.modal-content input:not(.security-input)::placeholder,
.modal-content textarea::placeholder,
.login-card input::placeholder {
    color: rgba(255, 255, 255, 0.4) !important;
    font-size: 13px !important;
    font-weight: 300 !important;
    letter-spacing: 0.5px !important;
}

/* ==================== Fixes for Modal Interaction Issues ==================== */

/* CRITICAL: Ensure modal overlays don't block interaction when NOT active */
.modal-overlay:not(.active),
.login-overlay:not(.active) {
    pointer-events: none !important;
    visibility: hidden;
    opacity: 0;
}

/* Ensure modal overlays allow interaction when active */
.modal-overlay.active,
.login-overlay.active {
    pointer-events: auto !important;
    visibility: visible !important;
    opacity: 1 !important;
}

/* Ensure modal content and children can be clicked when active */
.modal-overlay.active .modal-content,
.modal-overlay.active .modal-content *:not(p.modal-subtitle),
.login-overlay.active .login-card,
.login-overlay.active .login-card * {
    pointer-events: auto !important;
}

/* Ensure input areas have text cursor */
.modal-content input,
.modal-content textarea {
    cursor: text !important;
}

#guestbookModal #guestMessage,
#guestbookModal textarea,
#guestbookModal input:not([type="checkbox"]):not([type="radio"]):not([type="file"]):not([type="button"]):not([type="submit"]),
#commentModal textarea,
#commentModal input:not([type="hidden"]):not([type="checkbox"]):not([type="radio"]):not([type="file"]):not([type="button"]):not([type="submit"]) {
    cursor: text !important;
}

/* Ensure buttons have pointer cursor */
.modal-content button,
.modal-content a {
    cursor: pointer !important;
}

/* Fix for guestbook modal specifically */
.guestbook-content,
.guestbook-content *,
.guestbook-form,
.guestbook-form * {
    pointer-events: auto !important;
}

/* CRITICAL: Ensure ALL children of inactive modals cannot be clicked */
.modal-overlay:not(.active) *,
.login-overlay:not(.active) *,
#profileModal:not(.active) *,
#guestbookModal:not(.active) *,
#contactModal:not(.active) *,
#geminiModal:not(.active) *,
#googleModal:not(.active) * {
    pointer-events: none !important;
}

/* Prevent profile avatar trigger when modal is closed */
#profileModal:not(.active) .profile-mobile-hero-avatar,
#profileModal:not(.active) .profile-mobile-hero-avatar * {
    pointer-events: none !important;
    cursor: default !important;
}



@keyframes heartBeat {
    0% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.3);
    }

    100% {
        transform: scale(1);
    }
}

/* Cache buster: 1764385623 */

/* ==========================================================================
   FORCE REWRITE: View More Button (Renamed to bypass conflicts)
   ========================================================================== */
.guestbook-view-more,
.guestbook-view-more:visited {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 8px !important;
    margin-top: 20px !important;
    padding: 12px 24px !important;
    background: transparent !important;
    border: none !important;
    color: #f472b6 !important;
    /* Pink-400 */
    font-size: 0.95rem !important;
    font-weight: 600 !important;
    text-decoration: none !important;
    cursor: pointer !important;
    transition: color 0.2s ease, transform 0.2s ease, text-shadow 0.2s ease;
    backface-visibility: hidden;
    -webkit-font-smoothing: antialiased;
    position: relative !important;
    z-index: 1000 !important;
}

.guestbook-view-more:hover {
    color: #ff85c0 !important;
    /* Lighter Pink (Pink-300) */
    transform: translateY(-2px) !important;
    /* Match submit-btn lift */
    text-shadow: 0 4px 12px rgba(244, 114, 182, 0.4) !important;
    background: transparent !important;
    box-shadow: none !important;
}

.guestbook-view-more:active {
    transform: translateY(-1px) translateZ(0) !important;
}

.guestbook-view-more i {
    font-size: 1.1em !important;
    transition: transform 0.3s ease !important;
}

.guestbook-view-more:hover i {
    transform: scale(1.1) !important;
}

/* Homepage Guestbook Composer */
#guestbookModal {
    --guestbook-modal-overlay-height: 100dvh;
    --guestbook-modal-viewport-top: 0px;
    --guestbook-modal-viewport-left: 0px;
    --guestbook-modal-viewport-width: 100vw;
    --guestbook-modal-translate-y: 0px;
    --guestbook-modal-card-height: 420px;
    --guestbook-modal-card-max-height: calc(100svh - 56px);
    top: var(--guestbook-modal-viewport-top) !important;
    left: var(--guestbook-modal-viewport-left) !important;
    right: auto !important;
    bottom: auto !important;
    width: var(--guestbook-modal-viewport-width) !important;
    background: var(--app-modal-backdrop) !important;
    backdrop-filter: var(--app-modal-backdrop-filter) !important;
    -webkit-backdrop-filter: var(--app-modal-backdrop-filter) !important;
    height: var(--guestbook-modal-overlay-height) !important;
    min-height: var(--guestbook-modal-overlay-height) !important;
    padding: 24px 18px 18px !important;
    box-sizing: border-box !important;
    overflow: hidden !important;
    overscroll-behavior: none !important;
    transform: none !important;
    will-change: opacity !important;
    isolation: isolate !important;
}

#guestbookModal.active {
    pointer-events: auto !important;
}

#guestbookModal.guestbook-modal-interactive {
    pointer-events: auto !important;
}

.guestbook-modal-viewport-probe {
    position: fixed;
    top: 0;
    left: 0;
    width: 0;
    height: 100svh;
    pointer-events: none;
    visibility: hidden;
    opacity: 0;
    z-index: -1;
}

@keyframes guestbookComposerSectionRise {
    from {
        opacity: 0;
        transform: translate3d(0, 22px, 0) scale(0.985);
    }

    to {
        opacity: 1;
        transform: translate3d(0, 0, 0) scale(1);
    }
}

@keyframes guestbookComposerHandleRise {
    from {
        opacity: 0;
        transform: translate3d(0, 10px, 0) scaleX(0.88);
    }

    to {
        opacity: 1;
        transform: translate3d(0, 0, 0) scaleX(1);
    }
}

@keyframes guestbookComposerSheetFadeIn {
    from {
        opacity: 0;
        transform: translate3d(0, calc(var(--guestbook-modal-translate-y, 0px) + 18px), 0) scale(0.985);
    }

    to {
        opacity: 1;
        transform: translate3d(0, var(--guestbook-modal-translate-y, 0px), 0) scale(1);
    }
}

#guestbookModal .guestbook-composer-sheet {
    width: min(calc(100vw - 40px), 620px) !important;
    max-width: 620px !important;
    height: var(--guestbook-modal-card-height, 420px);
    min-height: 320px;
    max-height: var(--guestbook-modal-card-max-height, calc(100svh - 56px));
    margin: 0 auto !important;
    padding: 14px 18px calc(18px + env(safe-area-inset-bottom)) !important;
    box-sizing: border-box !important;
    position: relative !important;
    display: flex !important;
    flex-direction: column !important;
    gap: 12px !important;
    overflow: hidden !important;
    text-align: left !important;
    background: rgba(11, 14, 20, 0.94) !important;
    border: 1px solid rgba(255, 255, 255, 0.08) !important;
    border-radius: 32px !important;
    box-shadow:
        0 26px 70px rgba(0, 0, 0, 0.28),
        inset 0 1px 0 rgba(255, 255, 255, 0.06) !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    transform: translate3d(0, calc(var(--guestbook-modal-translate-y, 0px) + 18px), 0) scale(0.985) !important;
    opacity: 0 !important;
    will-change: transform, height !important;
    transition: none !important;
    pointer-events: auto !important;
    isolation: isolate !important;
    z-index: 4 !important;
}

#guestbookModal #imageUpload {
    display: none !important;
}

#guestbookModal.active .guestbook-composer-sheet,
#guestbookModal.active .guestbook-composer-sheet * {
    pointer-events: auto !important;
}

#guestbookModal.active .guestbook-composer-sheet,
#guestbookModal.active:focus-within .guestbook-composer-sheet,
#guestbookModal.ios-focus-lock .guestbook-composer-sheet {
    transform: translate3d(0, var(--guestbook-modal-translate-y, 0px), 0) scale(1) !important;
    opacity: 1 !important;
}

#guestbookModal.keyboard-docked .guestbook-composer-sheet,
#guestbookModal.keyboard-docked.active .guestbook-composer-sheet,
#guestbookModal.keyboard-docked.ios-focus-lock .guestbook-composer-sheet,
#guestbookModal.keyboard-docked.active:focus-within .guestbook-composer-sheet {
    transform: translate3d(0, var(--guestbook-modal-translate-y, 0px), 0) scale(1) !important;
    will-change: transform, height !important;
}

#guestbookModal.guestbook-entrying .guestbook-composer-sheet {
    animation: guestbookComposerSheetFadeIn 0.4s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

#guestbookModal.active:focus-within .guestbook-composer-sheet,
#guestbookModal.ios-focus-lock .guestbook-composer-sheet,
#guestbookModal.keyboard-docked .guestbook-composer-sheet {
    animation: none !important;
}

#guestbookModal .guestbook-composer-sheet.guestbook-sheet-animating {
    transition: transform 250ms cubic-bezier(0.22, 1, 0.36, 1) !important;
}

#guestbookModal .guestbook-composer-sheet>* {
    flex-shrink: 0;
}

#guestbookModal .guestbook-composer-handle,
#guestbookModal .guestbook-composer-header,
#guestbookModal .guestbook-composer-form,
#guestbookModal .guestbook-composer-editor,
#guestbookModal .guestbook-composer-preview,
#guestbookModal .guestbook-composer-actions {
    position: relative;
    z-index: 1;
    pointer-events: auto !important;
    backface-visibility: hidden;
    will-change: transform, opacity;
}

#guestbookModal.guestbook-entrying .guestbook-composer-handle {
    animation: guestbookComposerHandleRise 0.38s cubic-bezier(0.22, 1, 0.36, 1) 0.03s both;
}

#guestbookModal.guestbook-entrying .guestbook-composer-header {
    animation: guestbookComposerSectionRise 0.42s cubic-bezier(0.22, 1, 0.36, 1) 0.08s both;
}

#guestbookModal.guestbook-entrying .guestbook-composer-editor {
    animation: guestbookComposerSectionRise 0.46s cubic-bezier(0.22, 1, 0.36, 1) 0.14s both;
}

#guestbookModal.guestbook-entrying .guestbook-composer-preview {
    animation: guestbookComposerSectionRise 0.44s cubic-bezier(0.22, 1, 0.36, 1) 0.18s both;
}

#guestbookModal.guestbook-entrying .guestbook-composer-actions {
    animation: guestbookComposerSectionRise 0.48s cubic-bezier(0.22, 1, 0.36, 1) 0.21s both;
}

#guestbookModal .guestbook-composer-handle {
    width: 42px;
    height: 4px;
    margin: 0 auto 4px;
    position: relative;
    overflow: visible;
    border-radius: 999px;
    background: rgba(107, 158, 206, 0.24);
    transform-origin: center;
    transition:
        background-color 300ms cubic-bezier(0.22, 1, 0.36, 1),
        opacity 220ms ease,
        box-shadow 300ms cubic-bezier(0.22, 1, 0.36, 1),
        transform 300ms cubic-bezier(0.22, 1, 0.36, 1);
}

#guestbookModal .guestbook-composer-handle::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    opacity: 0;
    pointer-events: none;
    background: rgba(102, 224, 150, 1);
    box-shadow: none;
    transform: scaleX(1);
}

#guestbookModal:focus-within .guestbook-composer-handle,
#guestbookModal.keyboard-docked .guestbook-composer-handle {
    background: rgba(126, 184, 239, 0.96);
    box-shadow: 0 0 0 1px rgba(126, 184, 239, 0.08), 0 0 18px rgba(126, 184, 239, 0.2);
}

@keyframes guestbookComposerHandleSuccessGlow {
    0% {
        box-shadow: 0 0 0 rgba(102, 224, 150, 0);
        transform: scaleX(1);
        opacity: 0;
    }
    18% {
        box-shadow:
            0 0 0 1px rgba(102, 224, 150, 0.18),
            0 0 22px rgba(102, 224, 150, 0.34);
        transform: scaleX(1.05);
        opacity: 1;
    }
    100% {
        box-shadow:
            0 0 0 1px rgba(102, 224, 150, 0),
            0 0 0 rgba(102, 224, 150, 0);
        transform: scaleX(1);
        opacity: 0;
    }
}

#guestbookModal.guestbook-submit-pending .guestbook-composer-handle,
#guestbookModal.guestbook-submit-pending:focus-within .guestbook-composer-handle,
#guestbookModal.guestbook-submit-pending.keyboard-docked .guestbook-composer-handle {
    background: rgba(255, 167, 60, 0.96);
    box-shadow:
        0 0 0 1px rgba(255, 167, 60, 0.12),
        0 0 18px rgba(255, 167, 60, 0.28);
    transform: scaleX(1.04);
}

#guestbookModal.guestbook-submit-success .guestbook-composer-handle,
#guestbookModal.guestbook-submit-success:focus-within .guestbook-composer-handle,
#guestbookModal.guestbook-submit-success.keyboard-docked .guestbook-composer-handle {
    background: rgba(107, 158, 206, 0.24);
    box-shadow: none;
    transform: scaleX(1);
}

#guestbookModal.guestbook-submit-success .guestbook-composer-handle::after,
#guestbookModal.guestbook-submit-success:focus-within .guestbook-composer-handle::after,
#guestbookModal.guestbook-submit-success.keyboard-docked .guestbook-composer-handle::after {
    animation: guestbookComposerHandleSuccessGlow 1000ms cubic-bezier(0.22, 1, 0.36, 1) 1 both;
}

#guestbookModal .guestbook-composer-header {
    display: flex !important;
    align-items: flex-start !important;
    justify-content: flex-start !important;
    gap: 16px !important;
    margin: 0 !important;
}

#guestbookModal .guestbook-composer-copy {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

#guestbookModal .guestbook-composer-kicker {
    font-size: 0.68rem;
    font-weight: 600;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.4);
}

html[lang^="zh"] #guestbookModal .guestbook-composer-kicker {
    display: none;
}

#guestbookModal .guestbook-composer-title {
    margin: 0;
    font-size: clamp(1.04rem, 2.05vw, 1.22rem);
    font-weight: 520;
    letter-spacing: -0.02em;
    color: rgba(241, 245, 249, 0.82);
}

#guestbookModal .guestbook-composer-meta {
    min-height: 0;
    margin: 0;
    font-size: 0.82rem;
    line-height: 1.5;
    color: rgba(200, 206, 216, 0.74);
}

#guestbookModal .guestbook-composer-meta:empty {
    display: none;
}

#guestbookModal .guestbook-composer-more,
#guestbookModal .guestbook-composer-more:visited {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
    height: auto;
    padding: 2px 4px 0 0;
    border-radius: 0;
    border: none !important;
    background: transparent !important;
    color: rgba(126, 184, 239, 0.96) !important;
    font-size: 0.9rem;
    font-weight: 560;
    letter-spacing: 0.02em;
    white-space: nowrap;
    text-decoration: none !important;
    box-shadow: none !important;
    opacity: 1;
    transition: color 160ms ease, transform 160ms ease, opacity 160ms ease;
}

#guestbookModal .guestbook-composer-more:hover {
    background: transparent !important;
    color: rgba(160, 206, 248, 0.98) !important;
    transform: translateY(-1px);
}

#guestbookModal .guestbook-composer-more i {
    color: inherit;
    font-size: 0.92rem;
}

#guestbookModal .guestbook-composer-form {
    display: flex !important;
    flex-direction: column !important;
    gap: 12px !important;
    flex: 1 1 auto !important;
    min-height: 0 !important;
    margin: 0 !important;
}

#guestbookModal .guestbook-composer-editor {
    flex: 1 1 auto !important;
    min-height: 140px !important;
    margin: 0 !important;
    padding: 18px 18px 18px !important;
    position: relative !important;
    display: flex !important;
    align-items: stretch !important;
    justify-content: stretch !important;
    overflow: hidden !important;
    border: 1px solid rgba(255, 255, 255, 0.14) !important;
    border-radius: 20px !important;
    background: rgba(8, 11, 18, 0.72) !important;
    box-shadow:
        inset 0 0 0 1px rgba(255, 255, 255, 0.02),
        0 1px 2px rgba(0, 0, 0, 0.18) !important;
    cursor: text !important;
    z-index: 2;
}

#guestbookModal .guestbook-composer-editor:hover,
#guestbookModal .guestbook-composer-editor:focus-within {
    cursor: text !important;
}

#guestbookModal .guestbook-composer-editor:focus-within {
    border-color: rgba(126, 184, 239, 0.64) !important;
    background: rgba(10, 15, 24, 0.92) !important;
    box-shadow:
        0 0 0 3px rgba(126, 184, 239, 0.14),
        0 1px 2px rgba(0, 0, 0, 0.2) !important;
}

#guestbookModal .guestbook-composer-empty-placeholder {
    position: absolute;
    inset: 18px 66px 18px 18px;
    display: block;
    padding: 2px 0 0;
    text-align: left;
    color: rgba(200, 206, 216, 0.5);
    font-size: 17px;
    line-height: 1.82;
    pointer-events: none;
    z-index: 0;
    opacity: 0;
    transition: opacity 160ms ease;
}

#guestbookModal .guestbook-composer-editor.is-empty .guestbook-composer-empty-placeholder {
    opacity: 1;
}

#guestbookModal #guestMessage {
    width: 100% !important;
    flex: 1 1 auto !important;
    min-height: 100% !important;
    max-height: 100% !important;
    height: auto !important;
    margin: 0 !important;
    padding: 0 44px 18px 0 !important;
    border: none !important;
    border-radius: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
    color: rgba(241, 245, 249, 0.96) !important;
    caret-color: rgba(126, 184, 239, 0.96) !important;
    font-size: 17px !important;
    line-height: 1.82 !important;
    resize: none !important;
    overflow-y: auto !important;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    align-self: stretch !important;
    position: relative;
    z-index: 2;
    cursor: text !important;
    pointer-events: auto !important;
}

#guestbookModal #guestMessage:hover,
#guestbookModal #guestMessage:focus {
    cursor: text !important;
}

#guestbookModal #guestMessage:focus {
    outline: none !important;
    border: none !important;
    background: transparent !important;
    box-shadow: none !important;
}

#guestbookModal.keyboard-settling #guestMessage,
#guestbookModal.keyboard-settling #guestMessage:focus {
    caret-color: transparent !important;
}

#guestbookModal #guestMessage::placeholder,
#guestbookModal #guestMessage::-webkit-input-placeholder,
#guestbookModal #guestMessage::-moz-placeholder,
#guestbookModal #guestMessage:-ms-input-placeholder {
    color: transparent !important;
}

#guestbookModal .guestbook-composer-preview {
    flex: 0 0 auto;
    margin: 0 !important;
    border-radius: 18px !important;
    overflow: hidden !important;
    border: 1px solid rgba(255, 255, 255, 0.08) !important;
    background: rgba(255, 255, 255, 0.03) !important;
}

#guestbookModal .guestbook-composer-preview img {
    display: block;
    width: 100%;
    max-height: 160px;
    object-fit: contain;
    background: rgba(0, 0, 0, 0.28);
}

#guestbookModal .guestbook-composer-preview-remove {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 32px;
    height: 32px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    border: none;
    border-radius: 999px;
    background: rgba(11, 14, 20, 0.82);
    color: rgba(241, 245, 249, 0.92);
    cursor: pointer;
    z-index: 3;
    pointer-events: auto !important;
    transition:
        transform 180ms ease,
        background-color 180ms ease,
        box-shadow 180ms ease,
        color 180ms ease;
}

#guestbookModal .guestbook-composer-actions {
    display: flex !important;
    align-items: center !important;
    justify-content: flex-end !important;
    gap: 12px !important;
    padding-top: 6px !important;
    margin-top: auto !important;
    border-top: 1px solid rgba(255, 255, 255, 0.08) !important;
    z-index: 3;
}

body:not(.guestbook-page) #guestbookModal .guestbook-composer-actions {
    justify-content: space-between !important;
}

#guestbookModal .guestbook-composer-upload {
    flex: 0 0 auto;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 0 !important;
    border: 1px solid rgba(255, 255, 255, 0.08) !important;
    background: rgba(255, 255, 255, 0.03) !important;
    color: rgba(230, 234, 241, 0.82) !important;
    cursor: pointer !important;
    pointer-events: auto !important;
    transition:
        transform 180ms ease,
        background-color 180ms ease,
        border-color 180ms ease,
        box-shadow 180ms ease,
        color 180ms ease,
        opacity 180ms ease;
}

#guestbookModal .guestbook-composer-upload-inline {
    position: absolute;
    right: 14px;
    bottom: 14px;
    width: 38px;
    height: 38px;
    z-index: 3;
    border-radius: 13px !important;
    background: rgba(21, 24, 31, 0.82) !important;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    font-size: 0.92rem !important;
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.04),
        0 8px 20px rgba(0, 0, 0, 0.18);
}

#guestbookModal .guestbook-composer-upload.has-image {
    color: rgba(126, 184, 239, 0.96) !important;
    border-color: rgba(126, 184, 239, 0.28) !important;
    background: rgba(126, 184, 239, 0.08) !important;
}

#guestbookModal .guestbook-submit-btn.guestbook-composer-send {
    min-width: 108px;
    height: 46px;
    flex: 0 0 auto;
    margin: 0 !important;
    padding: 0 24px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    border: none !important;
    border-radius: 999px !important;
    background: rgba(224, 230, 240, 0.92) !important;
    color: #12161d !important;
    font-size: 1rem !important;
    font-weight: 600 !important;
    letter-spacing: 0.01em !important;
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.14) !important;
    position: relative;
    z-index: 3;
    pointer-events: auto !important;
    cursor: pointer !important;
    transition:
        transform 180ms ease,
        background-color 180ms ease,
        box-shadow 180ms ease,
        color 180ms ease,
        opacity 180ms ease;
}

#guestbookModal .guestbook-submit-btn.guestbook-composer-send span {
    color: inherit !important;
}

@keyframes guestbookSubmitLabelPulse {
    0%, 100% {
        opacity: 1;
        transform: translateY(0);
    }
    50% {
        opacity: 0.72;
        transform: translateY(-1px);
    }
}

#guestbookModal .guestbook-submit-btn.guestbook-composer-send[disabled] {
    cursor: default !important;
}

#guestbookModal .guestbook-submit-btn.guestbook-composer-send.is-submitting {
    background: linear-gradient(135deg, rgba(214, 220, 230, 0.96), rgba(193, 202, 215, 0.96)) !important;
    color: #18202c !important;
    box-shadow:
        0 12px 24px rgba(0, 0, 0, 0.14),
        inset 0 1px 0 rgba(255, 255, 255, 0.48) !important;
}

#guestbookModal .guestbook-submit-btn.guestbook-composer-send.is-submitting .guestbook-submit-label {
    animation: guestbookSubmitLabelPulse 960ms ease-in-out infinite;
}

#guestbookModal .guestbook-submit-btn.guestbook-composer-send.is-success {
    background: linear-gradient(135deg, rgba(116, 220, 166, 0.98), rgba(92, 201, 146, 0.96)) !important;
    color: #082313 !important;
    box-shadow:
        0 14px 28px rgba(15, 88, 54, 0.22),
        inset 0 1px 0 rgba(255, 255, 255, 0.38) !important;
}

#guestbookModal .guestbook-composer-more.is-disabled,
#guestbookModal .guestbook-composer-more.is-disabled:visited {
    opacity: 0.54;
    pointer-events: none !important;
    transform: none !important;
    box-shadow: none !important;
}

#guestbookModal .guestbook-composer-upload:hover,
#guestbookModal .guestbook-composer-upload:focus-visible {
    transform: translateY(-1px);
    border-color: rgba(126, 184, 239, 0.24) !important;
    background: rgba(255, 255, 255, 0.06) !important;
    color: rgba(241, 245, 249, 0.96) !important;
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.06),
        0 10px 22px rgba(0, 0, 0, 0.16);
}

#guestbookModal .guestbook-composer-upload.has-image:hover,
#guestbookModal .guestbook-composer-upload.has-image:focus-visible {
    border-color: rgba(126, 184, 239, 0.36) !important;
    background: rgba(126, 184, 239, 0.12) !important;
    color: rgba(190, 224, 255, 0.98) !important;
}

#guestbookModal .guestbook-composer-preview-remove:hover,
#guestbookModal .guestbook-composer-preview-remove:focus-visible {
    transform: translateY(-1px) scale(1.04);
    background: rgba(18, 23, 31, 0.94);
    color: rgba(255, 255, 255, 0.98);
    box-shadow:
        0 12px 22px rgba(0, 0, 0, 0.22),
        inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

#guestbookModal .guestbook-submit-btn.guestbook-composer-send:hover,
#guestbookModal .guestbook-submit-btn.guestbook-composer-send:focus-visible {
    transform: translateY(-1px);
    background: rgba(238, 243, 250, 0.98) !important;
    box-shadow:
        0 14px 28px rgba(0, 0, 0, 0.18),
        inset 0 1px 0 rgba(255, 255, 255, 0.6) !important;
}

#guestbookModal .guestbook-composer-upload:active,
#guestbookModal .guestbook-composer-preview-remove:active,
#guestbookModal .guestbook-submit-btn.guestbook-composer-send:active {
    transform: translateY(0) scale(0.98);
}

#guestbookModal .guestbook-composer-more,
#guestbookModal .guestbook-composer-more:visited {
    position: relative;
    z-index: 3;
    pointer-events: auto !important;
}

/* Guestbook Page Comment Composer */
#commentModal {
    --comment-modal-overlay-height: 100dvh;
    --comment-modal-translate-y: 0px;
    --comment-modal-card-height: 420px;
    --comment-modal-card-max-height: calc(100svh - 56px);
    background: var(--app-modal-backdrop) !important;
    backdrop-filter: var(--app-modal-backdrop-filter) !important;
    -webkit-backdrop-filter: var(--app-modal-backdrop-filter) !important;
    height: var(--comment-modal-overlay-height) !important;
    min-height: var(--comment-modal-overlay-height) !important;
    padding: 24px 18px 18px !important;
    box-sizing: border-box !important;
    overflow: hidden !important;
    overscroll-behavior: none !important;
    transform: none !important;
    will-change: opacity !important;
    isolation: isolate !important;
}

#commentModal.active {
    pointer-events: auto !important;
}

#commentModal.comment-modal-force-hidden {
    display: none !important;
    opacity: 0 !important;
    visibility: hidden !important;
    pointer-events: none !important;
    background: transparent !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    transition: none !important;
}

#commentModal.comment-modal-force-hidden .comment-composer-sheet,
#commentModal.comment-modal-force-hidden .comment-composer-sheet * {
    opacity: 0 !important;
    visibility: hidden !important;
    pointer-events: none !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    transition: none !important;
    animation: none !important;
}

#commentModal .comment-composer-sheet {
    width: min(calc(100vw - 40px), 620px) !important;
    max-width: 620px !important;
    height: var(--comment-modal-card-height, 420px);
    min-height: 320px;
    max-height: calc(100vh - 56px);
    max-height: var(--comment-modal-card-max-height, calc(100svh - 56px));
    margin: 0 auto !important;
    padding: 14px 18px calc(18px + env(safe-area-inset-bottom)) !important;
    box-sizing: border-box !important;
    position: relative !important;
    display: flex !important;
    flex-direction: column !important;
    gap: 12px !important;
    overflow: hidden !important;
    text-align: left !important;
    background: rgba(11, 14, 20, 0.94) !important;
    border: 1px solid rgba(255, 255, 255, 0.08) !important;
    border-radius: 32px !important;
    box-shadow:
        0 26px 70px rgba(0, 0, 0, 0.28),
        inset 0 1px 0 rgba(255, 255, 255, 0.06) !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    transform: translate3d(0, calc(var(--comment-modal-translate-y, 0px) + 18px), 0) scale(0.985) !important;
    opacity: 0 !important;
    will-change: transform, opacity !important;
    transition: transform 0.26s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.26s ease !important;
    pointer-events: auto !important;
    isolation: isolate !important;
    z-index: 4 !important;
}

#commentModal.active .comment-composer-sheet,
#commentModal.active .comment-composer-sheet * {
    pointer-events: auto !important;
}

#commentModal.active .comment-composer-sheet {
    transform: translate3d(0, var(--comment-modal-translate-y, 0px), 0) scale(1) !important;
    opacity: 1 !important;
}

.comment-modal-viewport-probe {
    position: fixed;
    top: 0;
    left: 0;
    width: 0;
    height: 100svh;
    pointer-events: none;
    visibility: hidden;
    opacity: 0;
    z-index: -1;
}

#commentModal.keyboard-docked .comment-composer-sheet,
#commentModal.keyboard-docked.active .comment-composer-sheet,
#commentModal.keyboard-docked.ios-focus-lock .comment-composer-sheet,
#commentModal.keyboard-docked.active:focus-within .comment-composer-sheet {
    transform: translate3d(0, var(--comment-modal-translate-y, 0px), 0) scale(1) !important;
    will-change: transform, height !important;
}

#commentModal.active:focus-within .comment-composer-sheet,
#commentModal.ios-focus-lock .comment-composer-sheet,
#commentModal.keyboard-docked .comment-composer-sheet {
    animation: none !important;
}

#commentModal .comment-composer-sheet.comment-sheet-animating {
    transition: transform 250ms cubic-bezier(0.22, 1, 0.36, 1) !important;
}

#commentModal.comment-entrying .comment-composer-sheet {
    animation: guestbookComposerSheetFadeIn 0.4s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

#commentModal .comment-composer-sheet>* {
    flex-shrink: 0;
}

#commentModal .guestbook-composer-handle,
#commentModal .guestbook-composer-header,
#commentModal .guestbook-composer-form,
#commentModal .comment-composer-editor,
#commentModal .comment-composer-actions {
    position: relative;
    z-index: 1;
    pointer-events: auto !important;
    backface-visibility: hidden;
    will-change: transform, opacity;
}

#commentModal.comment-entrying .guestbook-composer-handle {
    animation: guestbookComposerHandleRise 0.38s cubic-bezier(0.22, 1, 0.36, 1) 0.03s both;
}

#commentModal.comment-entrying .guestbook-composer-header {
    animation: guestbookComposerSectionRise 0.42s cubic-bezier(0.22, 1, 0.36, 1) 0.08s both;
}

#commentModal.comment-entrying .comment-composer-editor {
    animation: guestbookComposerSectionRise 0.46s cubic-bezier(0.22, 1, 0.36, 1) 0.14s both;
}

#commentModal.comment-entrying .comment-composer-actions {
    animation: guestbookComposerSectionRise 0.48s cubic-bezier(0.22, 1, 0.36, 1) 0.2s both;
}

#commentModal .guestbook-composer-handle {
    width: 42px;
    height: 4px;
    margin: 0 auto 4px;
    border-radius: 999px;
    background: rgba(107, 158, 206, 0.24);
    transition: background-color 180ms ease, opacity 180ms ease, box-shadow 180ms ease;
}

#commentModal:focus-within .guestbook-composer-handle {
    background: rgba(126, 184, 239, 0.96);
    box-shadow: 0 0 0 1px rgba(126, 184, 239, 0.08), 0 0 18px rgba(126, 184, 239, 0.2);
}

#commentModal .guestbook-composer-header {
    display: flex !important;
    align-items: flex-start !important;
    justify-content: flex-start !important;
    gap: 16px !important;
    margin: 0 !important;
}

#commentModal .guestbook-composer-copy {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

#commentModal .guestbook-composer-kicker {
    font-size: 0.68rem;
    font-weight: 600;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.4);
}

html[lang^="zh"] #commentModal .guestbook-composer-kicker {
    display: none;
}

#commentModal .guestbook-composer-title {
    margin: 0;
    font-size: clamp(1.04rem, 2.05vw, 1.22rem);
    font-weight: 520;
    letter-spacing: -0.02em;
    color: rgba(241, 245, 249, 0.82);
}

#commentModal .comment-composer-meta {
    min-height: 0;
    margin: 0;
    font-size: 0.82rem;
    line-height: 1.5;
    color: rgba(200, 206, 216, 0.74);
}

#commentModal .comment-composer-form {
    display: flex !important;
    flex-direction: column !important;
    gap: 12px !important;
    flex: 1 1 auto !important;
    min-height: 0 !important;
    margin: 0 !important;
}

#commentModal .comment-composer-editor {
    flex: 1 1 auto !important;
    min-height: 168px !important;
    margin: 0 !important;
    padding: 18px 18px 18px !important;
    position: relative !important;
    display: flex !important;
    align-items: stretch !important;
    justify-content: stretch !important;
    overflow: hidden !important;
    border: 1px solid rgba(255, 255, 255, 0.14) !important;
    border-radius: 20px !important;
    background: rgba(8, 11, 18, 0.72) !important;
    box-shadow:
        inset 0 0 0 1px rgba(255, 255, 255, 0.02),
        0 1px 2px rgba(0, 0, 0, 0.18) !important;
    cursor: text !important;
    z-index: 2;
}

#commentModal .comment-composer-editor:hover,
#commentModal .comment-composer-editor:focus-within {
    cursor: text !important;
}

#commentModal .comment-composer-editor:focus-within {
    border-color: rgba(126, 184, 239, 0.64) !important;
    background: rgba(10, 15, 24, 0.92) !important;
    box-shadow:
        0 0 0 3px rgba(126, 184, 239, 0.14),
        0 1px 2px rgba(0, 0, 0, 0.2) !important;
}

#commentModal .comment-composer-empty-placeholder {
    position: absolute;
    inset: 18px;
    display: block;
    padding: 2px 0 0;
    text-align: left;
    color: rgba(200, 206, 216, 0.5);
    font-size: 17px;
    line-height: 1.82;
    pointer-events: none;
    z-index: 0;
    opacity: 0;
    transition: opacity 160ms ease;
}

#commentModal .comment-composer-editor.is-empty .comment-composer-empty-placeholder {
    opacity: 1;
}

#commentModal #commentContent {
    width: 100% !important;
    flex: 1 1 auto !important;
    min-height: 100% !important;
    max-height: 100% !important;
    height: auto !important;
    margin: 0 !important;
    padding: 0 0 12px 0 !important;
    border: none !important;
    border-radius: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
    color: rgba(241, 245, 249, 0.96) !important;
    caret-color: rgba(126, 184, 239, 0.96) !important;
    font-size: 17px !important;
    line-height: 1.82 !important;
    resize: none !important;
    overflow-y: auto !important;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    align-self: stretch !important;
    position: relative;
    z-index: 2;
    cursor: text !important;
    pointer-events: auto !important;
}

#commentModal #commentContent:hover,
#commentModal #commentContent:focus {
    cursor: text !important;
}

#commentModal #commentContent:focus {
    outline: none !important;
    border: none !important;
    background: transparent !important;
    box-shadow: none !important;
}

#commentModal #commentContent::placeholder,
#commentModal #commentContent::-webkit-input-placeholder,
#commentModal #commentContent::-moz-placeholder,
#commentModal #commentContent:-ms-input-placeholder {
    color: transparent !important;
}

#commentModal .comment-composer-actions {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    gap: 12px !important;
    padding-top: 6px !important;
    margin-top: auto !important;
    border-top: 1px solid rgba(255, 255, 255, 0.08) !important;
    z-index: 3;
}

#commentModal .comment-composer-cancel,
#commentModal .comment-composer-cancel:visited {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
    height: auto;
    padding: 2px 4px 0 0;
    border-radius: 0;
    border: none !important;
    background: transparent !important;
    color: rgba(126, 184, 239, 0.96) !important;
    font-size: 0.9rem;
    font-weight: 560;
    letter-spacing: 0.02em;
    white-space: nowrap;
    text-decoration: none !important;
    box-shadow: none !important;
    opacity: 1;
    transition: color 160ms ease, transform 160ms ease, opacity 160ms ease;
    cursor: pointer !important;
}

#commentModal .comment-composer-cancel:hover,
#commentModal .comment-composer-cancel:focus-visible {
    background: transparent !important;
    color: rgba(160, 206, 248, 0.98) !important;
    transform: translateY(-1px);
}

#commentModal .comment-composer-send {
    min-width: 108px;
    height: 46px;
    flex: 0 0 auto;
    margin: 0 !important;
    padding: 0 24px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    border: none !important;
    border-radius: 999px !important;
    background: rgba(224, 230, 240, 0.92) !important;
    color: #12161d !important;
    font-size: 1rem !important;
    font-weight: 600 !important;
    letter-spacing: 0.01em !important;
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.14) !important;
    position: relative;
    z-index: 3;
    pointer-events: auto !important;
    cursor: pointer !important;
    transition:
        transform 180ms ease,
        background-color 180ms ease,
        box-shadow 180ms ease,
        color 180ms ease,
        opacity 180ms ease;
}

#commentModal .comment-composer-send span {
    color: inherit !important;
}

#commentModal .comment-composer-send:hover,
#commentModal .comment-composer-send:focus-visible {
    transform: translateY(-1px);
    background: rgba(238, 243, 250, 0.98) !important;
    box-shadow:
        0 14px 28px rgba(0, 0, 0, 0.18),
        inset 0 1px 0 rgba(255, 255, 255, 0.6) !important;
}

#commentModal .comment-composer-send:active,
#commentModal .comment-composer-cancel:active {
    transform: translateY(0) scale(0.98);
}

/* Mobile Scroll Highlight Effect - 白色卡片版 */
@media (max-width: 768px) {
    .message-item {
        transition: all 0.5s ease-out;
        /* Default: Translucent white (same as desktop) */
        /* Background is already set in base .message-item style */
        /* No need to override here - it will cause conflicts */
        backdrop-filter: blur(12px);
        -webkit-backdrop-filter: blur(12px);
        border: 1px solid rgba(0, 0, 0, 0.06);
        transform: scale(1);
        /* Reset scale */

        /* ⚡ PERF: Optimize rendering performance (Mobile Only) */
        content-visibility: auto;
        contain-intrinsic-size: auto 100px;
    }

    .message-item.active-focus {
        /* 优雅的抬起效果 */
        transform: scale(1.02) translateY(-3px);

        /* 完全不透明 -> 改为 90% 透明度保留磨砂感 */
        background: #ffffff !important;

        /* 更深的阴影 - 去掉紫色光晕 */
        box-shadow:
            0 8px 16px rgba(0, 0, 0, 0.08),
            0 20px 40px rgba(0, 0, 0, 0.12) !important;

        z-index: 10;
    }

    /* ⚡ FIX: Expanded cards push the next card down further */
    .message-item.expanded {
        /* z-index: 20 !important; <--- Removed z-index fix */
        /* position: relative; */

        /* ⚡ NEW STRATEGY: Increase margin to push next card away */
        /* Normal margin is 40px. We increase it to 45px to accommodate lift effect */
        margin-bottom: 45px !important;

        /* ⚡ FIX: Add top margin to prevent overlapping the card above when lifted */
        margin-top: 20px !important;
    }
}

/* 强制禁止移动端页面缩放 */
/* 强制禁止移动端页面缩放 - 但允许滚动 */
html,
body {
    /* touch-action: pan-y !important;  <-- Removed to prevent scroll locking */
    -webkit-text-size-adjust: 100%;
}

/* Ensure comments are always clickable */
.comment-item {
    pointer-events: auto !important;
}

/* 图片预览模态框禁止缩放 */
.image-modal,
.image-modal * {
    touch-action: none !important;
}

/* 修复输入框获得焦点时模态框被输入法遮挡的问题 */
@media (max-width: 768px) {

    /* Fix all modal overlays on mobile */
    .modal-overlay.active:not(.login-overlay):not(#guestbookModal) {
        align-items: center !important;
        /* Fixed: was flex-start causing top positioning */
        padding-top: calc(20px + env(safe-area-inset-top)) !important;
        padding-bottom: calc(20px + env(safe-area-inset-bottom)) !important;
        overflow-y: auto !important;
        -webkit-overflow-scrolling: touch !important;
    }

    /* Ensure modal content is scrollable and fits viewport */
    .modal-content:not(.guestbook-composer-sheet) {
        max-height: calc(100vh - 40px) !important;
        overflow-y: auto !important;
        -webkit-overflow-scrolling: touch !important;
        margin-top: 0 !important;
        position: relative !important;
    }

    /* Match profile modal width to mobile prompt card width */
    #profileModal .modal-content.profile-modal {
        width: 95% !important;
        max-width: 480px !important;
        box-sizing: border-box !important;
        margin: 0 auto !important;
    }

    #profileModal {
        padding: calc(env(safe-area-inset-top, 0px) + 12px) 0 calc(env(safe-area-inset-bottom, 0px) + 12px) !important;
        box-sizing: border-box !important;
        height: var(--profile-modal-overlay-height) !important;
        min-height: var(--profile-modal-overlay-height) !important;
        overflow: hidden !important;
    }

    #profileModal.keyboard-active {
        align-items: flex-start !important;
    }

    #profileModal .modal-content.profile-modal,
    #profileModal.active .modal-content.profile-modal,
    #profileModal.active:focus-within .modal-content.profile-modal {
        top: 0 !important;
        transform: none !important;
        height: min(82svh, calc(var(--profile-modal-overlay-height, 100dvh) - 56px)) !important;
        min-height: 0 !important;
        max-height: calc(var(--profile-modal-overlay-height, 100dvh) - 48px) !important;
        margin: auto !important;
        overflow: hidden !important;
    }

    #profileModal.active.ios-focus-lock .modal-content.profile-modal,
    #profileModal.active.keyboard-active .modal-content.profile-modal {
        top: var(--profile-modal-shift-y, 0px) !important;
        transform: none !important;
        height: auto !important;
        min-height: auto !important;
        max-height: min(90svh, calc(100% - 128px)) !important;
        overflow: hidden !important;
    }

    #profileModal .profile-modal-scroll {
        scroll-padding-bottom: 220px !important;
        overflow-y: auto !important;
        overflow-x: hidden !important;
        -webkit-overflow-scrolling: touch !important;
        touch-action: pan-y !important;
    }

    /* .guestbook-content rule REMOVED to fix mobile scroll lock */
    /* It was causing the content to be trapped in a small scrollable area */

    .guestbook-main {
        overflow: visible !important;
        height: auto !important;
        max-height: none !important;
    }

    /* Fix Profile Security Scroll Truncation */
    .mobile-security-layout {
        padding-bottom: 100px !important;
        /* Ensure scrolling reaches bottom */
        display: block !important;
    }

    /* 防止背景滚动，但不使用position:fixed避免背景跟随上移 */
    body.modal-active {
        height: 100dvh !important;
        /* Use dynamic viewport height */
        overflow: hidden !important;
        /* Keep hidden for modal to prevent background scroll */
        overscroll-behavior: none !important;
        background: transparent !important;
        /* Restore dynamic background */
    }

    /* ⚡ CRITICAL FIX: Restore Native Scroll for Address Bar Collapse */
    body.guestbook-page {
        position: relative !important;
        width: 100% !important;
        height: auto !important;
        overflow: visible !important;
        overscroll-behavior: auto !important;
        background: transparent !important;
    }
}

/* Make the main container the scrollable area */
@media (max-width: 640px) {
    .guestbook-main {
        height: auto !important;
        overflow: visible !important;
        padding-bottom: 120px !important;
    }
}

/* 强制修复iOS输入法导致的背景上移问题 */
/* Revert to global defaults for main page */
html,
body {
    position: relative !important;
    min-height: 100vh !important;
    overflow-x: hidden !important;
}

/* 确保background-blobs完全固定且覆盖所有回弹区域 */
.background-blobs {
    position: fixed !important;
    top: -50vh !important;
    bottom: -50vh !important;
    left: -50vw !important;
    right: -50vw !important;
    width: 200vw !important;
    height: 200vh !important;
    min-height: 200% !important;
    z-index: -1 !important;
    pointer-events: none !important;
    transform: translateZ(0) !important;
    will-change: auto !important;
}

/* 调整 Blob 位置以适应 200% 大小的容器，使其视觉上保持在屏幕中央 */
/* Formula: New% = 25% + (Old% / 2) */
.blob-1 {
    top: 27.5% !important;
    /* Was 5% */
    left: 20% !important;
    /* Was -10% -> 25 + (-5) = 20% */
}

.blob-2 {
    bottom: 27.5% !important;
    /* Was 5% */
    right: 20% !important;
    /* Was -10% -> 20% */
}

.blob-3 {
    top: 42.5% !important;
    /* Was 35% -> 25 + 17.5 = 42.5% */
    left: 40% !important;
    /* Was 30% -> 25 + 15 = 40% */
}

/* blob使用fixed相对于viewport */
.background-blobs .blob {
    position: fixed !important;
}

/* Unified text shadow for all box labels */
.box-label {
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3) !important;
}

/* =========================================
   Unified Mobile Input Zoom Fix (iOS Safari)
   =========================================
   Strategy: Preserve all modal entrance animations (staggered rise,
   backdrop blur transition, scale entrance). Only flatten transforms
   and kill transitions when an input is focused (:focus-within),
   which prevents iOS Safari caret misplacement.
   ========================================= */
@media (max-width: 768px) {
    html {
        -webkit-text-size-adjust: 100%;
    }

    /* iOS Safari zooms when focused input font size is below 16px */
    input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="file"]):not([type="color"]),
    textarea,
    select {
        font-size: 16px !important;
        line-height: 1.35 !important;
    }

    /* Login card: skip ONLY max-height constraint on mobile */
    .login-overlay .login-card {
        max-height: none !important;
        overflow-y: visible !important;
    }

    /* Input-level: remove heavy backdrop-filter for iOS perf & stabilize caret */
    .login-overlay .glass-input,
    .modal-overlay .glass-input,
    .modal-overlay .security-input,
    .modal-overlay input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="file"]):not([type="color"]),
    .modal-overlay textarea,
    .modal-overlay select {
        backdrop-filter: none !important;
        -webkit-backdrop-filter: none !important;
        caret-color: #ffffff !important;
    }

    /*
      ⚡ iOS CARET FIX (focus-within only):
      When ANY input inside the modal gains focus (keyboard opens),
      flatten transforms and kill transitions to prevent caret offset.
      This fires AFTER the entrance animation has already played.
    */

    /* Clear transform on BOTH overlay and content when focused */
    .modal-overlay.active:focus-within {
        transform: none !important;
        will-change: auto !important;
    }

    .modal-overlay.active:focus-within .modal-content:not(.guestbook-content) {
        transform: none !important;
        animation: none !important;
        transition: none !important;
    }

    .modal-overlay.active:focus-within .modal-content:not(.guestbook-content)>*:not(.window-controls):not(.modal-close) {
        transform: none !important;
        transition: none !important;
        transition-delay: 0s !important;
    }

    /* JS-based ios-focus-lock class (for ALL modal types) */
    .modal-overlay.ios-focus-lock,
    .modal-overlay.ios-focus-lock .modal-content:not(.guestbook-content) {
        transform: none !important;
        will-change: auto !important;
        animation: none !important;
        transition: none !important;
    }

    .modal-overlay.ios-focus-lock .modal-content:not(.guestbook-content)>*:not(.window-controls):not(.modal-close) {
        transform: none !important;
        transition: none !important;
        transition-delay: 0s !important;
    }

    #guestbookModal {
        padding: calc(env(safe-area-inset-top, 0px) + 12px) 20px calc(env(safe-area-inset-bottom, 0px) + 12px) !important;
        box-sizing: border-box !important;
        height: var(--guestbook-modal-overlay-height, 100dvh) !important;
        min-height: var(--guestbook-modal-overlay-height, 100dvh) !important;
        overflow: hidden !important;
        -webkit-overflow-scrolling: auto !important;
    }

    #guestbookModal.active {
        overflow: hidden !important;
        -webkit-overflow-scrolling: auto !important;
    }

    #guestbookModal .guestbook-composer-sheet,
    #guestbookModal.active .guestbook-composer-sheet,
    #guestbookModal.active:focus-within .guestbook-composer-sheet,
    #guestbookModal.ios-focus-lock .guestbook-composer-sheet {
        width: calc(100vw - 40px) !important;
        max-width: 620px !important;
        height: var(--guestbook-modal-card-height, min(400px, calc(var(--guestbook-modal-overlay-height, 100svh) - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px) - 24px)));
        min-height: 300px;
        max-height: var(--guestbook-modal-card-max-height, calc(var(--guestbook-modal-overlay-height, 100svh) - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px) - 24px));
        padding: 14px 16px calc(16px + env(safe-area-inset-bottom)) !important;
        border-radius: 20px !important;
    }

    #commentModal {
        padding: calc(env(safe-area-inset-top, 0px) + 12px) 20px calc(env(safe-area-inset-bottom, 0px) + 12px) !important;
        box-sizing: border-box !important;
        height: var(--comment-modal-overlay-height, 100dvh) !important;
        min-height: var(--comment-modal-overlay-height, 100dvh) !important;
        overflow: hidden !important;
        -webkit-overflow-scrolling: auto !important;
    }

    #commentModal.active {
        overflow: hidden !important;
        -webkit-overflow-scrolling: auto !important;
    }

    #commentModal .comment-composer-sheet,
    #commentModal.active .comment-composer-sheet,
    #commentModal.active:focus-within .comment-composer-sheet,
    #commentModal.ios-focus-lock .comment-composer-sheet,
    #commentModal.keyboard-docked .comment-composer-sheet {
        width: calc(100vw - 40px) !important;
        max-width: 620px !important;
        height: var(--comment-modal-card-height, min(400px, calc(var(--comment-modal-overlay-height, 100svh) - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px) - 24px)));
        min-height: 300px;
        max-height: var(--comment-modal-card-max-height, calc(var(--comment-modal-overlay-height, 100svh) - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px) - 24px));
        padding: 14px 16px calc(16px + env(safe-area-inset-bottom)) !important;
        border-radius: 20px !important;
    }

    #commentModal.active:focus-within .comment-composer-sheet>*,
    #commentModal.ios-focus-lock .comment-composer-sheet>*,
    #commentModal.active:focus-within .comment-composer-form>*,
    #commentModal.ios-focus-lock .comment-composer-form>* {
        opacity: 1 !important;
        transform: none !important;
        animation: none !important;
        transition: none !important;
        transition-delay: 0s !important;
        will-change: auto !important;
    }

    #commentModal .guestbook-composer-header {
        gap: 12px !important;
    }

    #commentModal .guestbook-composer-title {
        font-size: clamp(1rem, 5vw, 1.18rem) !important;
    }

    #commentModal .comment-composer-editor {
        min-height: 140px !important;
    }

    #commentModal #commentContent {
        font-size: 16px !important;
        line-height: 1.78 !important;
    }

    #guestbookModal.active:focus-within .guestbook-composer-sheet>*,
    #guestbookModal.ios-focus-lock .guestbook-composer-sheet>*,
    #guestbookModal.keyboard-docked .guestbook-composer-sheet>*,
    #guestbookModal.active:focus-within .guestbook-composer-form>*,
    #guestbookModal.ios-focus-lock .guestbook-composer-form>*,
    #guestbookModal.keyboard-docked .guestbook-composer-form>* {
        opacity: 1 !important;
        transform: none !important;
        animation: none !important;
        transition: none !important;
        transition-delay: 0s !important;
        will-change: auto !important;
    }

    #guestbookModal .guestbook-composer-header {
        gap: 12px !important;
    }

    #guestbookModal .guestbook-composer-title {
        font-size: clamp(1rem, 5vw, 1.18rem) !important;
    }

    #guestbookModal .guestbook-composer-editor {
        min-height: 140px !important;
    }

    #guestbookModal #guestMessage {
        font-size: 16px !important;
        line-height: 1.78 !important;
    }

    /*
      ⚠️ DO NOT apply translateZ(0) to inputs.
      Even translateZ(0) creates a compositing layer on iOS that
      causes the caret position to be miscalculated on repeated taps.
      The parent's transform:none + will-change:auto is sufficient.
    */
}

@media (max-width: 768px) {
    #profileModal {
        --profile-mobile-modal-radius: 20px;
        --profile-mobile-topbar-height: 86px;
        --profile-mobile-topbar-inset: 0px;
    }

    #profileModal .modal-content.profile-modal {
        position: relative;
        padding: 0 !important;
        border-radius: var(--profile-mobile-modal-radius) !important;
        background: rgba(12, 15, 19, 0.92) !important;
        border: 1px solid rgba(255, 255, 255, 0.08) !important;
        box-shadow:
            0 26px 56px rgba(0, 0, 0, 0.32),
            inset 0 1px 0 rgba(255, 255, 255, 0.06) !important;
    }

    #profileModal .profile-modal-scroll {
        position: relative !important;
        padding: 0 12px calc(18px + env(safe-area-inset-bottom)) !important;
        padding-top: calc(var(--profile-mobile-topbar-height) + 12px) !important;
        scroll-padding-top: calc(var(--profile-mobile-topbar-height) + 20px) !important;
        scroll-padding-bottom: 220px !important;
    }

    #profileModal[data-profile-tab="profile"] .profile-modal-scroll,
    #profileModal[data-profile-tab="security"] .profile-modal-scroll {
        padding-top: calc(var(--profile-mobile-topbar-height) + 12px) !important;
        scroll-padding-top: calc(var(--profile-mobile-topbar-height) + 20px) !important;
    }

    #profileModal .profile-mobile-topbar {
        display: block !important;
        position: absolute;
        top: 0;
        left: var(--profile-mobile-topbar-inset);
        right: var(--profile-mobile-topbar-inset);
        z-index: 30;
        height: var(--profile-mobile-topbar-height);
        margin: 0;
        overflow: hidden;
        pointer-events: none;
    }

    #profileModal .profile-mobile-topbar-shell {
        margin: 0;
        position: relative;
        height: 100%;
        min-height: 0;
        width: 100%;
        min-width: 0;
        display: flex;
        align-items: flex-end;
        justify-content: center;
        padding: 16px 18px 10px;
        border-radius: var(--profile-mobile-modal-radius) var(--profile-mobile-modal-radius) 0 0;
        background: rgba(12, 15, 19, 0.56);
        border: 1px solid rgba(255, 255, 255, 0.08);
        border-top-color: rgba(255, 255, 255, 0.12);
        backdrop-filter: blur(18px) saturate(140%);
        -webkit-backdrop-filter: blur(18px) saturate(140%);
        box-shadow:
            0 14px 30px rgba(0, 0, 0, 0.16),
            inset 0 1px 0 rgba(255, 255, 255, 0.05);
        overflow: hidden;
        pointer-events: auto;
    }

    #profileModal .profile-mobile-head-row {
        display: none;
    }

    #profileModal .profile-mobile-head-copy {
        display: none;
    }

    #profileModal .profile-mobile-title {
        display: none;
    }

    #profileModal .profile-mobile-tabs {
        display: flex;
        width: 100%;
        justify-content: center;
        gap: 28px;
        align-items: flex-end;
        position: relative;
        padding-top: 0;
        padding-bottom: 4px;
    }

    #profileModal .profile-mobile-tabs .tab-item {
        position: relative;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        min-height: 34px;
        padding: 0 0 10px;
        border-radius: 0;
        background: transparent !important;
        font-size: 16px;
        font-weight: 600;
        letter-spacing: -0.18px;
        color: rgba(212, 220, 228, 0.56);
    }

    #profileModal .profile-mobile-tabs .tab-item:hover {
        color: rgba(255, 255, 255, 0.82);
        background: transparent !important;
    }

    #profileModal .profile-mobile-tabs .tab-item.active {
        color: rgba(255, 255, 255, 0.98);
        font-weight: 600;
    }

    #profileModal .profile-mobile-tabs .tab-item.active::after {
        display: none;
    }

    #profileModal .profile-mobile-tab-indicator {
        position: absolute;
        left: 0;
        bottom: 0;
        width: var(--profile-tab-indicator-width, 34px);
        height: 2px;
        border-radius: 999px;
        background: #9fcaff;
        transform: translateX(var(--profile-tab-indicator-x, 0px));
        transition:
            transform 0.3s cubic-bezier(0.22, 1, 0.36, 1),
            width 0.3s cubic-bezier(0.22, 1, 0.36, 1);
        pointer-events: none;
    }

    #profileModal .profile-flip-container {
        min-height: 480px !important;
        height: auto !important;
        overflow: visible !important;
    }

    #profileModal .profile-flip-inner {
        min-height: 480px !important;
        height: auto !important;
        display: block !important;
    }

    #profileModal .profile-view {
        position: relative !important;
        height: auto !important;
        opacity: 1 !important;
        visibility: visible !important;
        transition: none !important;
    }

    #profileModal .profile-back {
        display: none !important;
    }

    #profileModal .profile-flip-inner.flipped .profile-front {
        display: none !important;
    }

    #profileModal .profile-flip-inner.flipped .profile-back {
        display: block !important;
        opacity: 1 !important;
        pointer-events: auto !important;
        visibility: visible !important;
    }

    #profileModal .profile-front {
        justify-content: flex-start !important;
        gap: 12px !important;
        padding-top: 0 !important;
        padding-bottom: 20px !important;
    }

    #profileModal .profile-mobile-sheet {
        position: relative;
        z-index: 1;
        display: block;
        width: 100%;
        margin-top: 0;
        padding-bottom: 10px;
    }

    #profileModal .profile-mobile-hero-card,
    #profileModal .profile-mobile-card {
        width: 100%;
        max-width: 100%;
        margin-bottom: 14px;
    }

    #profileModal .profile-mobile-hero-card {
        display: grid !important;
        grid-template-columns: 72px minmax(0, 1fr);
        grid-template-areas:
            "avatar main"
            "avatar editor";
        column-gap: 14px;
        row-gap: 14px;
        align-items: center;
        padding: 18px 16px;
        border: 1px solid rgba(255, 255, 255, 0.06);
        border-radius: 22px;
        background: rgba(16, 20, 25, 0.94);
        box-shadow:
            inset 0 1px 0 rgba(255, 255, 255, 0.035),
            0 6px 14px rgba(0, 0, 0, 0.05);
    }

    #profileModal .profile-mobile-hero-avatar {
        grid-area: avatar;
        position: relative;
        width: 72px;
        height: 72px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        padding: 0;
        border-radius: 50%;
        border: 1px solid rgba(255, 255, 255, 0.08);
        background: rgba(20, 24, 30, 0.92);
        color: rgba(236, 241, 247, 0.96);
        box-shadow:
            inset 0 1px 0 rgba(255, 255, 255, 0.06),
            0 6px 14px rgba(0, 0, 0, 0.06);
        overflow: visible;
        -webkit-appearance: none;
        appearance: none;
        align-self: center;
        justify-self: start;
        grid-row: 1 / span 2;
    }

    #profileModal #profileModalAvatarMobile {
        width: 100%;
        height: 100%;
        object-fit: cover;
        display: block;
        border-radius: 50%;
    }

    #profileModal .profile-mobile-hero-avatar-fallback {
        position: absolute;
        inset: 0;
        display: grid;
        place-items: center;
        font-size: 30px;
        font-weight: 600;
        letter-spacing: -0.4px;
        border-radius: 50%;
    }

    #profileModal .profile-mobile-hero-avatar-editmark {
        position: absolute;
        left: 50%;
        bottom: -12px;
        width: 30px;
        height: 18px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        transform: translateX(-50%) translateY(6px) scale(0.94);
        border-radius: 999px;
        background: rgba(10, 14, 19, 0.9);
        border: 1px solid rgba(255, 255, 255, 0.09);
        box-shadow:
            0 10px 22px rgba(0, 0, 0, 0.24),
            inset 0 1px 0 rgba(255, 255, 255, 0.06);
        pointer-events: none;
        z-index: 2;
        opacity: 0;
        transition:
            opacity 0.2s ease,
            transform 0.28s cubic-bezier(0.22, 1, 0.36, 1);
    }

    #profileModal .profile-mobile-hero-avatar-editmark::before,
    #profileModal .profile-mobile-hero-avatar-editmark::after {
        content: "";
        position: absolute;
        left: 50%;
        border-radius: 999px;
        transform: translateX(-50%);
    }

    #profileModal .profile-mobile-hero-avatar-editmark::before {
        top: 5px;
        width: 10px;
        height: 1.8px;
        background: rgba(244, 247, 251, 0.95);
        transform: translateX(-50%) rotate(-34deg);
        transform-origin: center;
    }

    #profileModal .profile-mobile-hero-avatar-editmark::after {
        bottom: 4px;
        width: 8px;
        height: 1.6px;
        background: rgba(159, 202, 255, 0.92);
    }

    #profileModal .profile-mobile-hero-card.is-editing .profile-mobile-hero-avatar-editmark {
        opacity: 1;
        transform: translateX(-50%) translateY(0) scale(1);
    }

    #profileModal .profile-mobile-hero-main {
        grid-area: main;
        min-width: 0;
        text-align: left;
        display: flex;
        flex-direction: column;
        justify-content: center;
        gap: 6px;
        align-self: center;
        position: relative;
        padding-right: 74px;
    }

    #profileModal .profile-mobile-hero-kicker {
        margin-bottom: 0;
        color: rgba(255, 255, 255, 0.42);
        font-size: 12px;
        letter-spacing: 0.24px;
        text-transform: uppercase;
    }

    #profileModal .profile-mobile-hero-name {
        min-width: 0;
        font-size: 22px;
        font-weight: 600;
        line-height: 1.1;
        letter-spacing: -0.4px;
        color: rgba(255, 255, 255, 0.98);
    }

    #profileModal .profile-mobile-hero-meta {
        min-width: 0;
        margin-top: 0;
        font-size: 14px;
        line-height: 1.48;
        color: rgba(227, 234, 242, 0.72);
        word-break: break-all;
    }

    #profileModal #profileMobileHeroEmail,
    #profileModal #profileMobileHeroId {
        display: block;
    }

    #profileModal .profile-mobile-hero-actions {
        position: absolute;
        right: 0;
        bottom: 2px;
        display: flex;
        justify-content: flex-end;
        margin-top: 0;
        margin-bottom: 0;
    }

    #profileModal .profile-mobile-hero-edit-btn {
        min-height: 36px;
        padding: 0 12px;
        border-radius: 999px;
        border: 1px solid rgba(255, 255, 255, 0.08);
        background: rgba(255, 255, 255, 0.04);
        color: rgba(255, 255, 255, 0.92);
        font-size: 13px;
        font-weight: 600;
        letter-spacing: 0.1px;
        box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
        -webkit-appearance: none;
        appearance: none;
    }

    #profileModal .profile-mobile-card {
        padding: 20px 16px;
        border: 1px solid rgba(255, 255, 255, 0.06);
        border-radius: 22px;
        background: rgba(16, 20, 25, 0.94);
        box-shadow:
            inset 0 1px 0 rgba(255, 255, 255, 0.035),
            0 6px 14px rgba(0, 0, 0, 0.05);
    }

    #profileModal .profile-mobile-sheet > :last-child {
        margin-bottom: 0;
    }

    #profileModal .profile-mobile-section-head {
        display: flex;
        align-items: center;
        justify-content: flex-start;
        gap: 12px;
        margin-bottom: 16px;
    }

    #profileModal .profile-mobile-section-title {
        font-size: 15px;
        font-weight: 600;
        letter-spacing: -0.12px;
        color: rgba(255, 255, 255, 0.96);
    }

    #profileModal .profile-mobile-info-rows {
        display: grid;
    }

    #profileModal .profile-mobile-info-row {
        min-height: 54px;
        display: grid;
        grid-template-columns: 92px 1fr;
        gap: 12px;
        align-items: center;
        border-bottom: 1px solid rgba(255, 255, 255, 0.04);
    }

    #profileModal .profile-mobile-info-row:last-child {
        border-bottom: 0;
    }

    #profileModal .profile-mobile-info-key {
        font-size: 13px;
        color: rgba(212, 220, 228, 0.42);
        text-align: left;
    }

    #profileModal .profile-mobile-info-value {
        display: flex;
        align-items: center;
        justify-content: flex-end;
        gap: 8px;
        font-size: 14px;
        line-height: 1.45;
        color: rgba(255, 255, 255, 0.94);
        text-align: right;
        min-width: 0;
        word-break: break-word;
    }

    #profileModal .profile-mobile-inline-editor {
        grid-area: editor;
        grid-column: 2;
        display: grid;
        gap: 10px;
        width: 100%;
        max-height: 0;
        overflow: hidden;
        margin-top: 0;
        padding-top: 0;
        border-top: 1px solid transparent;
        opacity: 0;
        pointer-events: none;
        transform: translateY(-6px);
        transform-origin: top center;
        transition:
            max-height 0.32s cubic-bezier(0.22, 1, 0.36, 1),
            opacity 0.22s ease,
            transform 0.28s cubic-bezier(0.22, 1, 0.36, 1),
            margin-top 0.28s ease,
            padding-top 0.28s ease,
            border-color 0.28s ease;
    }

    #profileModal .profile-mobile-inline-editor.is-visible {
        max-height: 176px;
        margin-top: 14px;
        padding-top: 14px;
        border-top-color: rgba(255, 255, 255, 0.05);
        opacity: 1;
        pointer-events: auto;
        transform: translateY(0);
    }

    #profileModal .profile-mobile-inline-input {
        width: 100%;
        min-height: 46px;
        padding: 10px 16px;
        border-radius: 14px;
        border: 1px solid rgba(255, 255, 255, 0.08);
        background: rgba(10, 14, 18, 0.88);
        color: rgba(255, 255, 255, 0.96);
        font-size: 15px;
        box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
        caret-color: #9fcaff;
    }

    #profileModal .profile-mobile-inline-input:focus,
    #profileModal .profile-mobile-inline-input:focus-visible {
        outline: none !important;
        border-color: #9fcaff !important;
        background: rgba(255, 255, 255, 0.042) !important;
        box-shadow: none !important;
    }

    #profileModal .profile-mobile-inline-actions {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 10px;
    }

    #profileModal .profile-mobile-editor-btn {
        -webkit-appearance: none;
        appearance: none;
        min-height: 44px;
        border-radius: 14px;
        border: 1px solid rgba(255, 255, 255, 0.08);
        font-size: 14px;
        font-weight: 600;
        letter-spacing: 0.1px;
    }

    #profileModal .profile-mobile-editor-btn--ghost {
        background: rgba(255, 255, 255, 0.04);
        color: rgba(255, 255, 255, 0.92);
        box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
    }

    #profileModal .profile-mobile-editor-btn--primary {
        background: rgba(229, 235, 241, 0.94);
        color: #0f141a;
        border-color: rgba(255, 255, 255, 0.18);
        box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.46);
    }

    #profileModal .profile-mobile-quick-grid {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 12px;
    }

    #profileModal .profile-mobile-quick-card {
        position: relative;
        -webkit-appearance: none;
        appearance: none;
        min-height: 126px;
        display: flex;
        flex-direction: column;
        align-items: flex-start;
        gap: 0;
        padding: 14px;
        border-radius: 18px;
        background: rgba(20, 24, 30, 0.92);
        border: 1px solid rgba(255, 255, 255, 0.06);
        color: rgba(255, 255, 255, 0.94);
        text-align: left;
        box-shadow:
            inset 0 1px 0 rgba(255, 255, 255, 0.03),
            0 4px 10px rgba(0, 0, 0, 0.04);
    }

    #profileModal .profile-mobile-quick-icon {
        width: 38px;
        height: 38px;
        display: grid;
        place-items: center;
        margin-bottom: 22px;
        border-radius: 12px;
        background: rgba(20, 24, 30, 0.92);
        border: 1px solid rgba(255, 255, 255, 0.06);
        color: rgba(236, 241, 247, 0.84);
    }

    #profileModal .profile-mobile-quick-title {
        margin-bottom: 6px;
        font-size: 14px;
        font-weight: 600;
        line-height: 1.35;
    }

    #profileModal .profile-mobile-quick-desc {
        font-size: 12px;
        line-height: 1.46;
        color: rgba(227, 234, 242, 0.72);
    }

    #profileModal .profile-mobile-quick-arrow {
        position: absolute;
        top: 14px;
        right: 14px;
        color: rgba(212, 220, 228, 0.42);
        font-size: 16px;
    }

    #profileModal .profile-front.animate-in .profile-mobile-hero-avatar {
        animation: staggeredRise 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94) 0.1s backwards;
    }

    #profileModal .profile-front.animate-in .profile-mobile-hero-kicker {
        animation: staggeredRise 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94) 0.14s backwards;
    }

    #profileModal .profile-front.animate-in .profile-mobile-hero-name {
        animation: staggeredRise 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94) 0.19s backwards;
    }

    #profileModal .profile-front.animate-in .profile-mobile-hero-meta {
        animation: staggeredRise 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94) 0.24s backwards;
    }

    #profileModal .profile-front.animate-in .profile-mobile-hero-actions {
        animation: staggeredRise 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94) 0.29s backwards;
    }

    #profileModal .profile-front.animate-in .profile-mobile-card--essential .profile-mobile-section-head {
        animation: staggeredRise 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94) 0.34s backwards;
    }

    #profileModal .profile-front.animate-in .profile-mobile-card--essential .profile-mobile-info-row:nth-child(1) {
        animation: staggeredRise 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94) 0.39s backwards;
    }

    #profileModal .profile-front.animate-in .profile-mobile-card--essential .profile-mobile-info-row:nth-child(2) {
        animation: staggeredRise 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94) 0.44s backwards;
    }

    #profileModal .profile-front.animate-in .profile-mobile-card--essential .profile-mobile-info-row:nth-child(3) {
        animation: staggeredRise 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94) 0.49s backwards;
    }

    #profileModal .profile-front.animate-in .profile-mobile-card--quick .profile-mobile-section-head {
        animation: staggeredRise 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94) 0.54s backwards;
    }

    #profileModal .profile-front.animate-in .profile-mobile-card--quick .profile-mobile-quick-card:nth-child(1) {
        animation: staggeredRise 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94) 0.59s backwards;
    }

    #profileModal .profile-front.animate-in .profile-mobile-card--quick .profile-mobile-quick-card:nth-child(2) {
        animation: staggeredRise 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94) 0.64s backwards;
    }

    #profileModal .profile-front.animate-in .profile-mobile-card--quick .profile-mobile-quick-card:nth-child(3) {
        animation: staggeredRise 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94) 0.69s backwards;
    }

    #profileModal .profile-front.animate-in .profile-mobile-card--quick .profile-mobile-quick-card:nth-child(4) {
        animation: staggeredRise 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94) 0.74s backwards;
    }

    #profileModal .profile-back.animate-in .mobile-security-section:nth-child(1) .mobile-section-title {
        animation: staggeredRise 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94) 0.12s backwards;
    }

    #profileModal .profile-back.animate-in .mobile-security-section:nth-child(1) .input-group:nth-of-type(1) {
        animation: staggeredRise 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94) 0.17s backwards;
    }

    #profileModal .profile-back.animate-in .mobile-security-section:nth-child(1) .input-group:nth-of-type(2) {
        animation: staggeredRise 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94) 0.22s backwards;
    }

    #profileModal .profile-back.animate-in .mobile-security-section:nth-child(1) .security-mobile-primary-btn {
        animation: staggeredRise 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94) 0.27s backwards;
    }

    #profileModal .profile-back.animate-in .mobile-security-section:nth-child(2) .mobile-section-title {
        animation: staggeredRise 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94) 0.32s backwards;
    }

    #profileModal .profile-back.animate-in .mobile-security-section:nth-child(2) .mobile-section-desc {
        animation: staggeredRise 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94) 0.37s backwards;
    }

    #profileModal .profile-back.animate-in .mobile-security-section:nth-child(2) .input-group:nth-of-type(1) {
        animation: staggeredRise 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94) 0.42s backwards;
    }

    #profileModal .profile-back.animate-in .mobile-security-section:nth-child(2) .input-group:nth-of-type(2) {
        animation: staggeredRise 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94) 0.47s backwards;
    }

    #profileModal .profile-back.animate-in .mobile-security-section:nth-child(2) .security-mobile-primary-btn {
        animation: staggeredRise 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94) 0.52s backwards;
    }

    #profileModal .profile-back.animate-in .mobile-security-section:nth-child(3) .mobile-section-title {
        animation: staggeredRise 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94) 0.57s backwards;
    }

    #profileModal .profile-back.animate-in .mobile-security-section:nth-child(3) .mobile-section-desc {
        animation: staggeredRise 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94) 0.62s backwards;
    }

    #profileModal .profile-back.animate-in .mobile-security-section:nth-child(3) .security-mobile-danger-btn {
        animation: staggeredRise 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94) 0.67s backwards;
    }

    #profileModal .mobile-security-layout {
        display: block !important;
        padding: 0 0 12px !important;
    }

    #profileModal .mobile-security-section {
        background: rgba(16, 20, 25, 0.94) !important;
        border: 1px solid rgba(255, 255, 255, 0.06) !important;
        border-radius: 22px !important;
        padding: 18px 16px !important;
        margin-bottom: 14px !important;
        box-shadow:
            inset 0 1px 0 rgba(255, 255, 255, 0.035),
            0 6px 14px rgba(0, 0, 0, 0.05) !important;
    }

    #profileModal .mobile-section-title {
        margin-bottom: 14px !important;
        font-size: 15px !important;
        color: rgba(255, 255, 255, 0.96) !important;
    }

    #profileModal .mobile-section-title::before {
        width: 2px !important;
        height: 14px !important;
        background: rgba(255, 255, 255, 0.24) !important;
    }

    #profileModal .mobile-section-title.danger::before {
        background: rgba(193, 149, 149, 0.72) !important;
    }

    #profileModal .mobile-section-desc {
        margin-bottom: 14px !important;
        font-size: 12px !important;
        line-height: 1.5 !important;
        color: rgba(255, 255, 255, 0.48) !important;
    }

    #profileModal .mobile-security-layout .security-input,
    #profileModal .mobile-security-layout .security-input.glass-input {
        background: rgba(10, 14, 18, 0.88) !important;
        border: 1px solid rgba(255, 255, 255, 0.08) !important;
        border-radius: 14px !important;
        color: rgba(255, 255, 255, 0.96) !important;
        min-height: 46px !important;
        height: auto !important;
        padding: 10px 16px !important;
        box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03) !important;
    }

    #profileModal .mobile-security-layout .security-input:focus,
    #profileModal .mobile-security-layout .security-input.glass-input:focus {
        border-color: #9fcaff !important;
        background: rgba(255, 255, 255, 0.042) !important;
        box-shadow: none !important;
    }

    #profileModal .mobile-security-layout .security-mobile-code-btn {
        background: rgba(255, 255, 255, 0.04) !important;
        border: 1px solid rgba(255, 255, 255, 0.08) !important;
        border-radius: 14px !important;
        color: rgba(255, 255, 255, 0.9) !important;
        height: 46px !important;
        padding: 0 14px !important;
    }

    #profileModal .mobile-security-layout .security-mobile-primary-btn,
    #profileModal .mobile-security-layout .security-mobile-danger-btn {
        width: 100% !important;
        min-width: 0 !important;
        max-width: none !important;
        margin: 12px 0 0 !important;
        height: 46px !important;
        border-radius: 14px !important;
        padding: 0 16px !important;
        font-family: "SF Pro Display", "PingFang SC", "Helvetica Neue", sans-serif !important;
        font-weight: 600 !important;
        letter-spacing: 0.1px !important;
    }

    #profileModal .mobile-security-layout .security-mobile-primary-btn {
        background: rgba(229, 235, 241, 0.94) !important;
        border: 1px solid rgba(255, 255, 255, 0.18) !important;
        color: #0f141a !important;
        box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.46) !important;
    }

    #profileModal .mobile-security-layout .security-mobile-danger-btn {
        background: rgba(166, 48, 48, 0.34) !important;
        border: 1px solid rgba(223, 98, 98, 0.34) !important;
        color: #ffe1e1 !important;
        box-shadow:
            inset 0 1px 0 rgba(255, 255, 255, 0.05) !important,
            0 4px 10px rgba(72, 12, 12, 0.14) !important;
    }

}

/* =========================================
   Guestbook Page Dedicated Overrides
   Keep guestbook-only layout/color/skeleton rules in one source of truth.
   ========================================= */

body.guestbook-page .guestbook-main {
    max-width: 100% !important;
    width: 100% !important;
    padding: 0 16px calc(env(safe-area-inset-bottom, 0px) + 112px) !important;
    box-sizing: border-box !important;
    overflow-x: hidden !important;
}

body.guestbook-page .message-container {
    width: 100% !important;
}

body.guestbook-page .message-item {
    background: #182634;
    break-inside: avoid !important;
    -webkit-column-break-inside: avoid !important;
    page-break-inside: avoid !important;
    margin-bottom: 20px !important;
    padding: 22px 24px 18px !important;
    width: 100% !important;
}

body.guestbook-page .message-item .message-content {
    margin-bottom: 12px !important;
}

body.guestbook-page .message-actions-bar {
    grid-gap: 24px !important;
    padding-top: 10px !important;
    margin-bottom: 0 !important;
}

body.guestbook-page .message-item .action-btn,
body.guestbook-page .message-item .like-btn,
body.guestbook-page .message-item .comment-btn {
    min-height: 30px;
    padding: 4px 8px !important;
    line-height: 1 !important;
    box-sizing: border-box;
}

body.guestbook-page .message-actions-bar + .comment-section {
    margin-top: 10px !important;
}

body.guestbook-page .comment-section {
    padding: 8px 10px !important;
}

body.guestbook-page .comment-list {
    margin: 0 !important;
    padding: 6px 4px !important;
}

body.guestbook-page .comment-list:not(.collapsed) {
    max-height: none;
    overflow: visible;
}

body.guestbook-page .comment-item {
    display: block !important;
    margin-bottom: 6px !important;
    padding: 0 !important;
    border-bottom: 0 !important;
}

body.guestbook-page .comment-item:last-child {
    margin-bottom: 0 !important;
}

body.guestbook-page .comment-row {
    gap: 10px !important;
    padding: 6px 10px !important;
    transition:
        border-color 0.16s ease,
        box-shadow 0.16s ease,
        color 0.16s ease !important;
    transform: none !important;
}

body.guestbook-page .comment-header {
    margin-bottom: 2px !important;
}

body.guestbook-page .comment-like-btn {
    gap: 1px;
    padding: 2px 4px !important;
    line-height: 1 !important;
}

body.guestbook-page .comment-item--clickable:hover {
    background-color: transparent !important;
}

@media (max-width: 768px) {
    html:not([data-theme="light"]) body.guestbook-page .message-item.active-focus {
        transform: scale(1.02) translateY(-3px);
        background: rgba(24, 38, 52, 0.98) !important;
        border-color: rgba(148, 197, 253, 0.18) !important;
        box-shadow:
            0 14px 30px rgba(0, 0, 0, 0.34),
            0 24px 46px rgba(0, 0, 0, 0.28),
            inset 0 1px 0 rgba(255, 255, 255, 0.06) !important;
        filter: none;
    }
}

body.guestbook-page .message-item.comment-post-highlight {
    transition: background 0.5s ease;
    background: rgba(155, 93, 229, 0.15);
}

body.guestbook-page .message-item.guestbook-message-removing {
    transition: opacity 0.3s, transform 0.3s;
    opacity: 0;
    transform: scale(0.9);
}

@keyframes guestbookPageFadeOutDown {
    from {
        opacity: 1;
        transform: translateY(0);
    }

    to {
        opacity: 0;
        transform: translateY(20px);
    }
}

body.guestbook-page .page-exit {
    animation: guestbookPageFadeOutDown 0.3s ease-in forwards;
}

body.guestbook-page .visually-hidden-h1 {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

body.guestbook-page .guestbook-launcher {
    position: fixed;
    right: max(88px, calc(env(safe-area-inset-right, 0px) + 88px));
    bottom: calc(env(safe-area-inset-bottom, 0px) + 112px);
    z-index: 140;
    pointer-events: none;
    transition:
        opacity 220ms ease,
        transform 280ms cubic-bezier(0.22, 1, 0.36, 1);
}

body.guestbook-page .guestbook-launcher__button {
    --guestbook-launcher-glass-bg: rgba(15, 23, 42, 0.78);
    --guestbook-launcher-glass-border: rgba(226, 232, 240, 0.11);
    --guestbook-launcher-glass-filter: blur(20px) saturate(150%);
    --guestbook-launcher-glass-shadow:
        0 18px 38px rgba(0, 0, 0, 0.34),
        0 6px 14px rgba(15, 23, 42, 0.24),
        inset 0 0.5px 0 rgba(255, 255, 255, 0.045),
        inset 0 -14px 30px rgba(15, 23, 42, 0.18);
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 58px;
    height: 58px;
    min-height: 58px;
    padding: 0;
    border: 1px solid var(--guestbook-launcher-glass-border);
    border-top-color: rgba(226, 232, 240, 0.045);
    border-radius: 999px;
    background:
        linear-gradient(180deg, rgba(30, 41, 59, 0.68) 0%, rgba(15, 23, 42, 0.76) 100%),
        var(--guestbook-launcher-glass-bg);
    background-color: var(--guestbook-launcher-glass-bg);
    color: rgba(248, 250, 252, 0.96);
    box-shadow: var(--guestbook-launcher-glass-shadow);
    backdrop-filter: var(--guestbook-launcher-glass-filter);
    -webkit-backdrop-filter: var(--guestbook-launcher-glass-filter);
    cursor: pointer;
    pointer-events: auto;
    isolation: isolate;
    transition:
        transform 220ms cubic-bezier(0.22, 1, 0.36, 1),
        border-color 220ms ease,
        box-shadow 220ms ease,
        background-color 220ms ease;
}

body.guestbook-page .guestbook-launcher__button:focus-visible {
    outline: none;
    border-color: rgba(147, 197, 253, 0.26);
    box-shadow:
        0 0 0 3px rgba(147, 197, 253, 0.12),
        var(--guestbook-launcher-glass-shadow);
}

body.guestbook-page .guestbook-launcher__button::before {
    display: none;
}

body.guestbook-page .guestbook-launcher__button::after {
    display: none;
}

body.guestbook-page .guestbook-launcher__icon {
    width: 100%;
    height: 100%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: inherit;
    background: transparent;
    border: none;
    color: rgba(248, 250, 252, 0.98);
    box-shadow: none;
    transition: color 220ms ease;
}

body.guestbook-page .guestbook-launcher__icon i {
    font-size: 1.08rem;
    transform: translateX(0.5px) rotate(-8deg);
}

body.guestbook-page .guestbook-launcher__copy {
    display: none !important;
}

body.guestbook-page .guestbook-launcher__eyebrow {
    display: none !important;
}

body.guestbook-page .guestbook-launcher__title {
    display: none !important;
}

@media (hover: hover) and (pointer: fine) {
    body.guestbook-page .guestbook-launcher__button:hover {
        transform: translateY(-1px);
        border-color: rgba(191, 219, 254, 0.18);
        box-shadow:
            0 20px 42px rgba(0, 0, 0, 0.38),
            0 7px 16px rgba(15, 23, 42, 0.28),
            inset 0 0.5px 0 rgba(255, 255, 255, 0.06),
            inset 0 -14px 30px rgba(15, 23, 42, 0.16);
    }

    body.guestbook-page .guestbook-launcher__button:hover .guestbook-launcher__icon {
        color: rgba(255, 255, 255, 1);
    }
}

body.guestbook-page.guestbook-composer-open .guestbook-launcher,
body.guestbook-page.modal-active .guestbook-launcher,
body.guestbook-page.chat-widget-open .guestbook-launcher {
    opacity: 0;
    transform: translate3d(0, 14px, 0) scale(0.96);
    pointer-events: none;
}

@media (max-width: 768px) {
    body.guestbook-page .guestbook-launcher {
        right: max(17px, calc(env(safe-area-inset-right, 0px) + 17px));
        bottom: calc(env(safe-area-inset-bottom, 0px) + 100px);
    }

    body.guestbook-page .guestbook-launcher__button {
        width: 54px;
        height: 54px;
        min-height: 54px;
    }

    body.guestbook-page .guestbook-launcher__icon {
        width: 100%;
        height: 100%;
        border-radius: inherit;
    }
}

body.guestbook-page .message-item .author-name {
    color: rgba(241, 245, 249, 0.9) !important;
}

body.guestbook-page .message-item .message-time {
    color: rgba(203, 213, 225, 0.56) !important;
}

body.guestbook-page .message-item .message-content {
    color: rgba(241, 245, 249, 0.92) !important;
}

body.guestbook-page .message-item .action-btn,
body.guestbook-page .message-item .like-btn,
body.guestbook-page .message-item .comment-btn {
    color: rgba(226, 232, 240, 0.68) !important;
}

body.guestbook-page .message-item .action-btn:hover,
body.guestbook-page .message-item .like-btn:hover,
body.guestbook-page .message-item .comment-btn:hover {
    color: rgba(255, 255, 255, 0.92) !important;
}

body.guestbook-page .message-item .like-btn.active,
body.guestbook-page .message-item .like-btn.active:hover {
    color: #ef4444 !important;
}

body.guestbook-page .comment-item .comment-author {
    color: rgba(248, 250, 252, 0.94) !important;
    -webkit-text-fill-color: rgba(248, 250, 252, 0.94) !important;
    font-weight: 700 !important;
    opacity: 1 !important;
    text-shadow: 0 1px 10px rgba(2, 6, 23, 0.2);
}

body.guestbook-page .comment-item .comment-time {
    color: rgba(203, 213, 225, 0.72) !important;
    -webkit-text-fill-color: rgba(203, 213, 225, 0.72) !important;
    opacity: 1 !important;
}

body.guestbook-page .comment-item .comment-content {
    color: rgba(241, 245, 249, 0.9) !important;
    -webkit-text-fill-color: rgba(241, 245, 249, 0.9) !important;
    opacity: 1 !important;
}

body.guestbook-page .comment-count-group,
body.guestbook-page .comment-toggle-btn,
body.guestbook-page .add-comment-trigger-btn {
    color: rgba(226, 232, 240, 0.72) !important;
}

body.guestbook-page .comment-item--nested {
    border-left-color: rgba(148, 163, 184, 0.2) !important;
    border-radius: 14px 0 0 14px;
    transition:
        border-left-color 0.2s ease,
        background 0.2s ease;
}

body.guestbook-page .comment-item--nested.thread-highlight,
body.guestbook-page .comment-item--nested.comment-item--clickable:hover {
    border-left-color: rgba(96, 165, 250, 0.72) !important;
}

body.guestbook-page .comment-item--nested.comment-item--clickable:hover .comment-item--nested {
    border-left-color: rgba(148, 163, 184, 0.2) !important;
}

body.guestbook-page .comment-item--nested.comment-item--clickable:hover .comment-item--nested.thread-highlight,
body.guestbook-page .comment-item--nested.comment-item--clickable:hover .comment-item--nested.comment-item--clickable:hover {
    border-left-color: rgba(96, 165, 250, 0.72) !important;
}

body.guestbook-page .comment-item--nested .comment-row {
    background: linear-gradient(180deg, rgba(32, 40, 54, 0.72) 0%, rgba(19, 27, 39, 0.84) 100%) !important;
    border: 1px solid rgba(255, 255, 255, 0.04) !important;
    border-radius: 12px;
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.03),
        0 1px 2px rgba(2, 6, 23, 0.12);
}

body.guestbook-page .comment-item--nested.comment-item--clickable:hover {
    background: linear-gradient(90deg,
            rgba(96, 165, 250, 0.14) 0px,
            rgba(96, 165, 250, 0.06) 12px,
            rgba(255, 255, 255, 0) 40px);
}

body.guestbook-page .comment-item--nested .comment-main .comment-header .comment-author {
    color: rgba(248, 250, 252, 0.98) !important;
    -webkit-text-fill-color: rgba(248, 250, 252, 0.98) !important;
    font-weight: 700 !important;
    opacity: 1 !important;
    text-shadow: 0 1px 10px rgba(2, 6, 23, 0.24);
}

body.guestbook-page .comment-item--nested .comment-main .comment-content {
    color: rgba(241, 245, 249, 0.92) !important;
    -webkit-text-fill-color: rgba(241, 245, 249, 0.92) !important;
    opacity: 1 !important;
}

body.guestbook-page .comment-item--clickable:hover > .comment-row > .comment-main > .comment-header > .comment-author {
    color: rgba(147, 197, 253, 0.98) !important;
    -webkit-text-fill-color: rgba(147, 197, 253, 0.98) !important;
}

body.guestbook-page .comment-item--clickable:hover > .comment-row > .comment-main > .comment-content {
    color: rgba(248, 250, 252, 0.96) !important;
    -webkit-text-fill-color: rgba(248, 250, 252, 0.96) !important;
}

body.guestbook-page .comment-item--clickable:hover > .comment-row {
    background: rgba(255, 255, 255, 0.05) !important;
}

body.guestbook-page .comment-item--nested.comment-item--clickable:hover > .comment-row {
    background: linear-gradient(180deg, rgba(36, 47, 64, 0.9) 0%, rgba(21, 29, 42, 0.96) 100%) !important;
    border-color: rgba(96, 165, 250, 0.18) !important;
    box-shadow:
        0 12px 28px rgba(2, 6, 23, 0.26),
        inset 3px 0 0 rgba(96, 165, 250, 0.22),
        inset 0 1px 0 rgba(255, 255, 255, 0.05) !important;
    transform: none !important;
}

body.guestbook-page .comment-mention {
    color: #93c5fd !important;
    -webkit-text-fill-color: #93c5fd !important;
    font-weight: 700 !important;
    text-shadow: 0 1px 8px rgba(37, 99, 235, 0.16);
}

body.guestbook-page .comment-like-btn {
    color: rgba(226, 232, 240, 0.78) !important;
    -webkit-text-fill-color: rgba(226, 232, 240, 0.78) !important;
    opacity: 1 !important;
}

body.guestbook-page .comment-like-btn:hover {
    color: rgba(248, 250, 252, 0.92) !important;
    -webkit-text-fill-color: rgba(248, 250, 252, 0.92) !important;
}

body.guestbook-page .comment-like-btn i,
body.guestbook-page .comment-like-btn svg,
body.guestbook-page .comment-like-btn .like-count {
    color: inherit !important;
    fill: currentColor;
    stroke: currentColor;
    opacity: 1 !important;
}

body.guestbook-page .comment-like-btn.active,
body.guestbook-page .comment-like-btn.active i,
body.guestbook-page .comment-like-btn.active svg,
body.guestbook-page .comment-like-btn.active .like-count {
    color: #ef4444 !important;
    -webkit-text-fill-color: #ef4444 !important;
}

body.guestbook-page #notifBtn {
    width: 36px !important;
    height: 36px !important;
    background: rgba(15, 23, 42, 0.6) !important;
    backdrop-filter: blur(8px) !important;
    -webkit-backdrop-filter: blur(8px) !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    border-radius: 50% !important;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1) !important;
    color: rgba(255, 255, 255, 0.9) !important;
    transition: all 0.2s ease !important;
}

body.guestbook-page #notifBtn:hover {
    background: rgba(15, 23, 42, 0.8) !important;
    transform: scale(1.05) !important;
}

@keyframes guestbookSkeletonPulse {
    0% {
        opacity: 0.82;
    }

    50% {
        opacity: 1;
    }

    100% {
        opacity: 0.82;
    }
}

@keyframes guestbookSkeletonShimmer {
    0% {
        transform: translateX(-165%);
    }

    100% {
        transform: translateX(165%);
    }
}

body.guestbook-page .skeleton {
    position: relative;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.08);
    animation: guestbookSkeletonPulse 1.9s ease-in-out infinite;
    border-radius: 8px;
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.05),
        0 0 0 1px rgba(255, 255, 255, 0.02);
}

body.guestbook-page .skeleton::after {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background: linear-gradient(102deg,
            rgba(255, 255, 255, 0) 0%,
            rgba(255, 255, 255, 0) 28%,
            rgba(255, 255, 255, 0.14) 40%,
            rgba(255, 255, 255, 0.42) 50%,
            rgba(191, 219, 254, 0.24) 58%,
            rgba(255, 255, 255, 0.1) 66%,
            rgba(255, 255, 255, 0) 78%,
            rgba(255, 255, 255, 0) 100%);
    transform: translateX(-165%);
    animation: guestbookSkeletonShimmer 1.15s linear infinite;
    will-change: transform;
}

body.guestbook-page .skeleton-message-card {
    background: #182634;
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow:
        0 10px 24px rgba(0, 0, 0, 0.16),
        inset 0 1px 0 rgba(255, 255, 255, 0.04);
    border-radius: 16px;
    padding: 20px;
    margin-bottom: 20px;
    height: fit-content;
}

body.guestbook-page .skeleton-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}

body.guestbook-page .skeleton-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    flex-shrink: 0;
}

body.guestbook-page .skeleton-author {
    height: 16px;
    width: 100px;
}

body.guestbook-page .skeleton-time {
    height: 12px;
    width: 60px;
    margin-left: auto;
}

body.guestbook-page .skeleton-content {
    margin-bottom: 16px;
}

body.guestbook-page .skeleton-line {
    height: 14px;
    margin-bottom: 8px;
}

body.guestbook-page .skeleton-line-full {
    width: 100%;
}

body.guestbook-page .skeleton-line-long {
    width: 85%;
}

body.guestbook-page .skeleton-line-short {
    width: 50%;
}

body.guestbook-page .skeleton-actions {
    display: flex;
    gap: 16px;
    padding-top: 12px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

body.guestbook-page .skeleton-action-btn {
    height: 20px;
    width: 50px;
    border-radius: 10px;
}

body.guestbook-page #skeletonContainer {
    display: grid;
    gap: 20px;
    width: 100%;
}

body.guestbook-page #skeletonContainer.hidden {
    display: none !important;
}

@media (max-width: 1024px) {
    body.guestbook-page .guestbook-main {
        padding: 0 15px !important;
    }
}

@media (max-width: 768px) {
    body.guestbook-page * {
        -webkit-text-size-adjust: 100%;
    }

    body.guestbook-page .guestbook-main {
        padding-top: 100px !important;
    }

    body.guestbook-page textarea,
    body.guestbook-page input,
    body.guestbook-page select,
    body.guestbook-page input[type="text"],
    body.guestbook-page input[type="email"],
    body.guestbook-page input[type="password"] {
        font-size: 16px !important;
    }

    body.guestbook-page #skeletonContainer {
        grid-template-columns: 1fr;
    }
}

@media (min-width: 769px) and (max-width: 1024px) {
    body.guestbook-page #skeletonContainer {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 1025px) and (max-width: 1600px) {
    body.guestbook-page #skeletonContainer {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (min-width: 1601px) and (max-width: 2400px) {
    body.guestbook-page #skeletonContainer {
        grid-template-columns: repeat(4, 1fr);
    }
}

@media (min-width: 2401px) {
    body.guestbook-page #skeletonContainer {
        grid-template-columns: repeat(5, 1fr);
    }
}

.guestbook-message-container-initial {
    opacity: 0;
    transition: opacity 0.3s ease;
}

.guestbook-message-container-initial.guestbook-message-container-ready {
    opacity: 1;
}

.guestbook-scroll-sentinel {
    width: 100%;
    height: 10px;
    clear: both;
    background: transparent;
    pointer-events: none;
}

.guestbook-loading-indicator {
    width: 100%;
    clear: both;
    display: block;
    padding: 20px;
    text-align: center;
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.9rem;
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s, visibility 0.3s;
    pointer-events: none;
}

.guestbook-loading-indicator.is-visible {
    opacity: 1;
    visibility: visible;
}

#commentModal:not(.comment-modal-interactive) {
    pointer-events: none !important;
}

#commentModal:not(.comment-modal-interactive) .comment-composer-sheet,
#commentModal:not(.comment-modal-interactive) .comment-composer-sheet :is(button, a, input, textarea, select, label, [role="button"]) {
    pointer-events: none !important;
}

#commentModal.comment-modal-interactive .comment-composer-sheet {
    z-index: 4 !important;
}

.message-item .action-btn.is-processing,
.message-item .comment-like-btn.is-processing {
    opacity: 0.6;
    cursor: not-allowed;
}

.message-item .action-btn i,
.message-item .comment-like-btn i {
    transition: transform 0.2s ease;
}

.message-item .action-btn i.like-icon-bounce,
.message-item .comment-like-btn i.like-icon-bounce {
    transform: scale(1.2);
}

.like-btn i.guestbook-heart-liked,
.comment-like-btn i.guestbook-heart-liked,
.like-btn svg.guestbook-heart-liked,
.comment-like-btn svg.guestbook-heart-liked {
    color: #ff4757;
}

@keyframes guestbookHeartBounce {
    0%, 100% { transform: scale(1); }
    20% { transform: scale(1.3); }
    40% { transform: scale(1); }
    60% { transform: scale(1.2); }
    80% { transform: scale(1); }
}

@keyframes guestbookHeartPulse {
    0%, 100% { transform: scale(1); }
    15% { transform: scale(1.25); }
    30% { transform: scale(1); }
    45% { transform: scale(1.15); }
    60% { transform: scale(1); }
}

.like-btn i.guestbook-heart-bounce,
.comment-like-btn i.guestbook-heart-bounce,
.like-btn svg.guestbook-heart-bounce,
.comment-like-btn svg.guestbook-heart-bounce {
    animation: guestbookHeartBounce 1.2s ease-in-out;
}

.like-btn i.guestbook-heart-pulse,
.comment-like-btn i.guestbook-heart-pulse,
.like-btn svg.guestbook-heart-pulse,
.comment-like-btn svg.guestbook-heart-pulse {
    animation: guestbookHeartPulse 1s ease-in-out 3;
}

.guestbook-empty-state-hidden {
    display: none;
}

.guestbook-composer-preview-hidden {
    display: none !important;
}

/* =========================================
   Guestbook Page Light Theme
   ========================================= */

html[data-theme="light"] body.guestbook-page {
    --guestbook-light-card-bg: rgba(255, 255, 255, 0.88);
    --guestbook-light-card-bg-hover: rgba(255, 255, 255, 0.94);
    --guestbook-light-card-border: rgba(148, 163, 184, 0.18);
    --guestbook-light-card-border-strong: rgba(148, 163, 184, 0.26);
    --guestbook-light-pill-bg: rgba(248, 250, 252, 0.72);
    --guestbook-light-pill-bg-strong: rgba(250, 252, 255, 0.86);
    --guestbook-light-pill-border: rgba(148, 163, 184, 0.12);
    --guestbook-light-text: rgba(15, 23, 42, 0.92);
    --guestbook-light-subtle-text: rgba(71, 85, 105, 0.78);
    --guestbook-light-muted-text: rgba(100, 116, 139, 0.68);
    --guestbook-light-accent: #6b9ece;
    --guestbook-light-accent-soft: rgba(107, 158, 206, 0.08);
    --guestbook-light-success: #34cc68;
    --guestbook-light-success-strong: #22c55e;
    --guestbook-light-success-text: #0b2a18;
    --guestbook-light-shadow:
        0 18px 40px rgba(148, 163, 184, 0.18),
        inset 0 1px 0 rgba(255, 255, 255, 0.82);
    background: #f8fafc !important;
}

html.guestbook-document[data-theme="light"] {
    background: #f8fafc !important;
    background-color: #f8fafc !important;
    color-scheme: light;
}

html.guestbook-document[data-theme="light"] body,
html.guestbook-document[data-theme="light"] body.guestbook-page {
    background: #f8fafc !important;
    background-color: #f8fafc !important;
}

html[data-theme="light"] body.guestbook-page #ambientCanvas,
html[data-theme="light"] body.guestbook-page #starryCanvas {
    opacity: 0 !important;
}

html[data-theme="light"] body.guestbook-page.auth-sheet-open #ambientCanvas {
    opacity: 0 !important;
    transition: none !important;
}

html[data-theme="light"] body.guestbook-page.auth-sheet-open #starryCanvas {
    opacity: 0 !important;
    transition: none !important;
}

html[data-theme="light"] body.guestbook-page.auth-sheet-open::before,
html[data-theme="light"] body.guestbook-page.auth-sheet-open::after,
html:not([data-theme="dark"]) body.guestbook-page.auth-sheet-open::before,
html:not([data-theme="dark"]) body.guestbook-page.auth-sheet-open::after {
    content: none !important;
    display: none !important;
    background: transparent !important;
}

html[data-theme="light"] body.guestbook-page .guestbook-loading-state,
html[data-theme="light"] body.guestbook-page .guestbook-loading-indicator {
    color: var(--guestbook-light-subtle-text);
}

html[data-theme="light"] body.guestbook-page .guestbook-message-error {
    color: #dc2626;
}

html[data-theme="light"] body.guestbook-page .message-item {
    background: var(--guestbook-light-card-bg) !important;
    border: 1px solid var(--guestbook-light-card-border) !important;
    box-shadow: var(--guestbook-light-shadow) !important;
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
}

html[data-theme="light"] body.guestbook-page .message-item:hover {
    background: var(--guestbook-light-card-bg-hover) !important;
    border-color: var(--guestbook-light-card-border-strong) !important;
    box-shadow:
        0 24px 48px rgba(148, 163, 184, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.88) !important;
}

html[data-theme="light"] body.guestbook-page .message-item.comment-post-highlight {
    background: rgba(107, 158, 206, 0.1) !important;
}

@media (max-width: 768px) {
    html[data-theme="light"] body.guestbook-page .message-item:not(.active-focus):not(.comment-post-highlight) {
        background: rgba(242, 245, 249, 0.9) !important;
        border-color: rgba(148, 163, 184, 0.12) !important;
        box-shadow:
            0 10px 22px rgba(148, 163, 184, 0.09),
            inset 0 1px 0 rgba(255, 255, 255, 0.72) !important;
        filter: grayscale(0.04) saturate(0.98) brightness(0.998);
    }

    html[data-theme="light"] body.guestbook-page .message-item.active-focus {
        transform: scale(1.012) translateY(-2px);
        background: rgba(252, 253, 255, 0.94) !important;
        border-color: rgba(148, 163, 184, 0.16) !important;
        box-shadow:
            0 12px 24px rgba(148, 163, 184, 0.12),
            0 18px 32px rgba(15, 23, 42, 0.07),
            inset 0 1px 0 rgba(255, 255, 255, 0.86) !important;
        filter: none;
    }
}

html[data-theme="light"] body.guestbook-page .message-item .author-info i,
html[data-theme="light"] body.guestbook-page .message-item .author-avatar-placeholder {
    color: var(--guestbook-light-muted-text) !important;
}

html[data-theme="light"] body.guestbook-page .message-item .author-avatar {
    border-color: rgba(148, 163, 184, 0.24) !important;
}

html[data-theme="light"] body.guestbook-page .message-item .author-name {
    color: var(--guestbook-light-text) !important;
}

html[data-theme="light"] body.guestbook-page .message-item .message-time {
    color: var(--guestbook-light-muted-text) !important;
}

html[data-theme="light"] body.guestbook-page .message-item .message-content {
    color: rgba(30, 41, 59, 0.9) !important;
}

html[data-theme="light"] body.guestbook-page .message-image {
    background: linear-gradient(135deg, rgba(236, 242, 249, 0.98), rgba(225, 234, 244, 0.92));
    border: 1px solid rgba(148, 163, 184, 0.16);
}

html[data-theme="light"] body.guestbook-page .message-image::before {
    background: linear-gradient(110deg,
            rgba(255, 255, 255, 0) 0%,
            rgba(255, 255, 255, 0.45) 24%,
            rgba(191, 219, 254, 0.24) 46%,
            rgba(255, 255, 255, 0.38) 58%,
            rgba(255, 255, 255, 0) 100%);
}

html[data-theme="light"] body.guestbook-page .message-actions-bar {
    border-top-color: rgba(148, 163, 184, 0.16);
}

html[data-theme="light"] body.guestbook-page .message-item .action-btn,
html[data-theme="light"] body.guestbook-page .message-item .like-btn,
html[data-theme="light"] body.guestbook-page .message-item .comment-btn {
    color: var(--guestbook-light-subtle-text) !important;
}

html[data-theme="light"] body.guestbook-page .message-item .action-btn:hover,
html[data-theme="light"] body.guestbook-page .message-item .like-btn:hover,
html[data-theme="light"] body.guestbook-page .message-item .comment-btn:hover {
    color: rgba(15, 23, 42, 0.88) !important;
}

html[data-theme="light"] body.guestbook-page .message-item .like-btn.active,
html[data-theme="light"] body.guestbook-page .message-item .like-btn.active:hover {
    color: #ef4444 !important;
}

html[data-theme="light"] body.guestbook-page .comment-section {
    background: linear-gradient(180deg, rgba(248, 250, 252, 0.74), rgba(250, 252, 255, 0.66)) !important;
    border-color: var(--guestbook-light-pill-border) !important;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.76) !important;
}

html[data-theme="light"] body.guestbook-page .comment-count-group,
html[data-theme="light"] body.guestbook-page .comment-toggle-btn,
html[data-theme="light"] body.guestbook-page .add-comment-trigger-btn {
    color: var(--guestbook-light-subtle-text) !important;
}

html[data-theme="light"] body.guestbook-page .comment-list:not(.collapsed) {
    scrollbar-color: rgba(148, 163, 184, 0.42) transparent;
}

html[data-theme="light"] body.guestbook-page .comment-list:not(.collapsed)::-webkit-scrollbar-thumb {
    background-color: rgba(148, 163, 184, 0.42);
}

html[data-theme="light"] body.guestbook-page .comment-toggle-btn:hover {
    color: var(--guestbook-light-accent) !important;
    background: var(--guestbook-light-accent-soft) !important;
    border-radius: 999px;
}

html[data-theme="light"] body.guestbook-page .add-comment-trigger-btn {
    background: rgba(255, 255, 255, 0.78) !important;
    border-color: rgba(148, 163, 184, 0.16) !important;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7);
}

html[data-theme="light"] body.guestbook-page .add-comment-trigger-btn:hover {
    background: rgba(255, 255, 255, 0.94) !important;
    border-color: rgba(107, 158, 206, 0.22) !important;
    color: var(--guestbook-light-accent) !important;
    box-shadow: 0 10px 20px rgba(148, 163, 184, 0.12);
}

html[data-theme="light"] body.guestbook-page .comment-item .comment-author {
    color: var(--guestbook-light-text) !important;
    -webkit-text-fill-color: var(--guestbook-light-text) !important;
    text-shadow: none;
}

html[data-theme="light"] body.guestbook-page .comment-item .comment-time {
    color: var(--guestbook-light-muted-text) !important;
    -webkit-text-fill-color: var(--guestbook-light-muted-text) !important;
}

html[data-theme="light"] body.guestbook-page .comment-item .comment-content {
    color: rgba(30, 41, 59, 0.88) !important;
    -webkit-text-fill-color: rgba(30, 41, 59, 0.88) !important;
}

html[data-theme="light"] body.guestbook-page .comment-item--nested {
    border-left-color: rgba(148, 163, 184, 0.2) !important;
    border-radius: 14px 0 0 14px;
    transition:
        border-left-color 0.2s ease,
        background 0.2s ease;
}

html[data-theme="light"] body.guestbook-page .comment-item--nested.thread-highlight,
html[data-theme="light"] body.guestbook-page .comment-item--nested.comment-item--clickable:hover {
    border-left-color: rgba(107, 158, 206, 0.56) !important;
}

html[data-theme="light"] body.guestbook-page .comment-item--nested.comment-item--clickable:hover .comment-item--nested {
    border-left-color: rgba(148, 163, 184, 0.2) !important;
}

html[data-theme="light"] body.guestbook-page .comment-item--nested.comment-item--clickable:hover .comment-item--nested.thread-highlight,
html[data-theme="light"] body.guestbook-page .comment-item--nested.comment-item--clickable:hover .comment-item--nested.comment-item--clickable:hover {
    border-left-color: rgba(107, 158, 206, 0.56) !important;
}

html[data-theme="light"] body.guestbook-page .comment-item--nested .comment-row {
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.72) 0%, rgba(250, 251, 253, 0.84) 100%) !important;
    border: 1px solid rgba(148, 163, 184, 0.1) !important;
    border-radius: 12px;
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.76),
        0 1px 2px rgba(148, 163, 184, 0.04);
}

html[data-theme="light"] body.guestbook-page .comment-item--nested.comment-item--clickable:hover {
    background: linear-gradient(90deg,
            rgba(107, 158, 206, 0.08) 0px,
            rgba(107, 158, 206, 0.04) 12px,
            rgba(255, 255, 255, 0) 36px);
}

html[data-theme="light"] body.guestbook-page .comment-item--nested .comment-main .comment-header .comment-author {
    color: var(--guestbook-light-text) !important;
    -webkit-text-fill-color: var(--guestbook-light-text) !important;
    text-shadow: none;
}

html[data-theme="light"] body.guestbook-page .comment-item--nested .comment-main .comment-content {
    color: rgba(30, 41, 59, 0.88) !important;
    -webkit-text-fill-color: rgba(30, 41, 59, 0.88) !important;
}

html[data-theme="light"] body.guestbook-page .comment-item--clickable:hover > .comment-row {
    background: rgba(255, 255, 255, 0.8) !important;
}

html[data-theme="light"] body.guestbook-page .comment-item--nested.comment-item--clickable:hover > .comment-row {
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.9) 0%, rgba(250, 251, 253, 0.96) 100%) !important;
    border-color: rgba(107, 158, 206, 0.16) !important;
    box-shadow:
        0 10px 24px rgba(148, 163, 184, 0.12),
        inset 3px 0 0 rgba(107, 158, 206, 0.16),
        inset 0 1px 0 rgba(255, 255, 255, 0.88) !important;
    transform: none !important;
}

html[data-theme="light"] body.guestbook-page .comment-item--clickable:hover > .comment-row > .comment-main > .comment-header > .comment-author {
    color: #527fa8 !important;
    -webkit-text-fill-color: #527fa8 !important;
}

html[data-theme="light"] body.guestbook-page .comment-item--clickable:hover > .comment-row > .comment-main > .comment-content {
    color: rgba(15, 23, 42, 0.9) !important;
    -webkit-text-fill-color: rgba(15, 23, 42, 0.9) !important;
}

html[data-theme="light"] body.guestbook-page .comment-mention {
    color: #527fa8 !important;
    -webkit-text-fill-color: #527fa8 !important;
    text-shadow: none;
}

html[data-theme="light"] body.guestbook-page .comment-like-btn {
    color: var(--guestbook-light-subtle-text) !important;
    -webkit-text-fill-color: var(--guestbook-light-subtle-text) !important;
}

html[data-theme="light"] body.guestbook-page .comment-like-btn:hover {
    color: rgba(15, 23, 42, 0.84) !important;
    -webkit-text-fill-color: rgba(15, 23, 42, 0.84) !important;
}

html[data-theme="light"] body.guestbook-page .comment-like-btn.active,
html[data-theme="light"] body.guestbook-page .comment-like-btn.active i,
html[data-theme="light"] body.guestbook-page .comment-like-btn.active svg,
html[data-theme="light"] body.guestbook-page .comment-like-btn.active .like-count {
    color: #ef4444 !important;
    -webkit-text-fill-color: #ef4444 !important;
}

html[data-theme="light"] body.guestbook-page #notifBtn {
    background: rgba(255, 255, 255, 0.82) !important;
    border: 1px solid rgba(148, 163, 184, 0.16) !important;
    box-shadow: 0 10px 22px rgba(148, 163, 184, 0.18) !important;
    color: rgba(15, 23, 42, 0.84) !important;
}

html[data-theme="light"] body.guestbook-page #notifBtn:hover {
    background: rgba(255, 255, 255, 0.96) !important;
    transform: scale(1.05) !important;
}

html[data-theme="light"] body.guestbook-page .empty-state-large {
    color: var(--guestbook-light-muted-text);
}

html[data-theme="light"] body.guestbook-page .empty-state-large i {
    color: rgba(148, 163, 184, 0.54);
}

html[data-theme="light"] body.guestbook-page .empty-hint {
    color: var(--guestbook-light-subtle-text);
}

html[data-theme="light"] body.guestbook-page .guestbook-launcher__button {
    --guestbook-launcher-glass-bg: rgba(255, 255, 255, 0.76);
    --guestbook-launcher-glass-border: rgba(15, 23, 42, 0.065);
    --guestbook-launcher-glass-shadow:
        0 2px 8px rgba(15, 23, 42, 0.045),
        inset 0 0.5px 0 rgba(255, 255, 255, 0.34);
    border-color: var(--guestbook-launcher-glass-border);
    background: var(--guestbook-launcher-glass-bg);
    background-color: var(--guestbook-launcher-glass-bg);
    color: rgba(15, 23, 42, 0.88);
    box-shadow: var(--guestbook-launcher-glass-shadow);
}

html[data-theme="light"] body.guestbook-page .guestbook-launcher__button:focus-visible {
    border-color: rgba(107, 158, 206, 0.28);
    box-shadow:
        0 0 0 3px rgba(107, 158, 206, 0.12),
        var(--guestbook-launcher-glass-shadow);
}

html[data-theme="light"] body.guestbook-page .guestbook-launcher__icon {
    color: rgba(15, 23, 42, 0.9);
}

@media (hover: hover) and (pointer: fine) {
    html[data-theme="light"] body.guestbook-page .guestbook-launcher__button:hover {
        border-color: rgba(107, 158, 206, 0.22);
        box-shadow:
            0 3px 10px rgba(15, 23, 42, 0.07),
            inset 0 0.5px 0 rgba(255, 255, 255, 0.42);
    }

    html[data-theme="light"] body.guestbook-page .guestbook-launcher__button:hover .guestbook-launcher__icon {
        color: rgba(15, 23, 42, 1);
    }
}

html[data-theme="light"] body.guestbook-page .skeleton {
    background: rgba(226, 232, 240, 0.72);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.9),
        0 0 0 1px rgba(148, 163, 184, 0.06);
}

html[data-theme="light"] body.guestbook-page .skeleton::after {
    background: linear-gradient(102deg,
            rgba(255, 255, 255, 0) 0%,
            rgba(255, 255, 255, 0.1) 26%,
            rgba(255, 255, 255, 0.56) 46%,
            rgba(191, 219, 254, 0.22) 56%,
            rgba(255, 255, 255, 0.12) 72%,
            rgba(255, 255, 255, 0) 100%);
}

html[data-theme="light"] body.guestbook-page .skeleton-message-card {
    background: var(--guestbook-light-card-bg);
    border: 1px solid var(--guestbook-light-card-border);
    box-shadow: var(--guestbook-light-shadow);
}

html[data-theme="light"] body.guestbook-page .skeleton-actions {
    border-top-color: rgba(148, 163, 184, 0.16);
}

html[data-theme="light"] #guestbookModal,
html[data-theme="light"] #commentModal {
    background: var(--public-light-modal-backdrop) !important;
    backdrop-filter: var(--public-light-modal-backdrop-filter) !important;
    -webkit-backdrop-filter: var(--public-light-modal-backdrop-filter) !important;
    overscroll-behavior: contain !important;
    overscroll-behavior-y: contain !important;
}

html[data-theme="light"] #guestbookModal .guestbook-composer-sheet,
html[data-theme="light"] #commentModal .comment-composer-sheet {
    background: rgba(252, 253, 255, 0.96) !important;
    border: 1px solid rgba(148, 163, 184, 0.18) !important;
    box-shadow:
        0 28px 70px rgba(148, 163, 184, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.9) !important;
}

html[data-theme="light"] #guestbookModal .guestbook-composer-handle,
html[data-theme="light"] #commentModal .guestbook-composer-handle {
    background: rgba(107, 158, 206, 0.24);
}

html[data-theme="light"] #guestbookModal:focus-within .guestbook-composer-handle,
html[data-theme="light"] #guestbookModal.keyboard-docked .guestbook-composer-handle,
html[data-theme="light"] #commentModal:focus-within .guestbook-composer-handle {
    background: rgba(126, 184, 239, 0.82);
    box-shadow:
        0 0 0 1px rgba(107, 158, 206, 0.1),
        0 0 18px rgba(126, 184, 239, 0.2);
}

html[data-theme="light"] #guestbookModal.guestbook-submit-success .guestbook-composer-handle,
html[data-theme="light"] #guestbookModal.guestbook-submit-success:focus-within .guestbook-composer-handle,
html[data-theme="light"] #guestbookModal.guestbook-submit-success.keyboard-docked .guestbook-composer-handle {
    background: rgba(107, 158, 206, 0.24);
    box-shadow: none;
}

html[data-theme="light"] #guestbookModal .guestbook-composer-kicker,
html[data-theme="light"] #commentModal .guestbook-composer-kicker {
    color: rgba(100, 116, 139, 0.64);
}

html[data-theme="light"] #guestbookModal .guestbook-composer-title,
html[data-theme="light"] #commentModal .guestbook-composer-title {
    color: rgba(15, 23, 42, 0.92);
}

html[data-theme="light"] #guestbookModal .guestbook-composer-meta,
html[data-theme="light"] #commentModal .comment-composer-meta {
    color: rgba(71, 85, 105, 0.72);
}

html[data-theme="light"] #guestbookModal .guestbook-composer-more,
html[data-theme="light"] #guestbookModal .guestbook-composer-more:visited,
html[data-theme="light"] #commentModal .comment-composer-cancel,
html[data-theme="light"] #commentModal .comment-composer-cancel:visited {
    color: rgba(107, 158, 206, 0.96) !important;
}

html[data-theme="light"] #guestbookModal .guestbook-composer-more:hover,
html[data-theme="light"] #commentModal .comment-composer-cancel:hover,
html[data-theme="light"] #commentModal .comment-composer-cancel:focus-visible {
    color: rgba(82, 127, 168, 0.98) !important;
}

html[data-theme="light"] #guestbookModal .guestbook-composer-editor,
html[data-theme="light"] #commentModal .comment-composer-editor {
    border: 1px solid rgba(100, 116, 139, 0.24) !important;
    background: rgba(255, 255, 255, 0.96) !important;
    box-shadow: none !important;
}

html[data-theme="light"] #guestbookModal .guestbook-composer-editor:focus-within,
html[data-theme="light"] #commentModal .comment-composer-editor:focus-within {
    border-color: rgba(82, 127, 168, 0.58) !important;
    background: rgba(255, 255, 255, 0.99) !important;
    box-shadow: none !important;
}

html[data-theme="light"] #guestbookModal .guestbook-composer-empty-placeholder,
html[data-theme="light"] #commentModal .comment-composer-empty-placeholder {
    color: rgba(100, 116, 139, 0.68);
}

html[data-theme="light"] #guestbookModal #guestMessage,
html[data-theme="light"] #commentModal #commentContent {
    color: rgba(15, 23, 42, 0.92) !important;
    caret-color: rgba(15, 23, 42, 0.92) !important;
}

html[data-theme="light"] #guestbookModal .guestbook-composer-preview {
    border: 1px solid rgba(148, 163, 184, 0.16) !important;
    background: rgba(243, 247, 251, 0.94) !important;
}

html[data-theme="light"] #guestbookModal .guestbook-composer-preview img {
    background: rgba(255, 255, 255, 0.78);
}

html[data-theme="light"] #guestbookModal .guestbook-composer-preview-remove {
    background: rgba(255, 255, 255, 0.92);
    color: rgba(15, 23, 42, 0.84);
    box-shadow:
        0 10px 20px rgba(148, 163, 184, 0.16),
        inset 0 1px 0 rgba(255, 255, 255, 0.92);
}

html[data-theme="light"] #guestbookModal .guestbook-composer-preview-remove:hover,
html[data-theme="light"] #guestbookModal .guestbook-composer-preview-remove:focus-visible {
    background: rgba(255, 255, 255, 0.98);
    color: rgba(15, 23, 42, 0.96);
    box-shadow:
        0 12px 22px rgba(148, 163, 184, 0.18),
        inset 0 1px 0 rgba(255, 255, 255, 0.96);
}

html[data-theme="light"] #guestbookModal .guestbook-composer-actions,
html[data-theme="light"] #commentModal .comment-composer-actions {
    border-top-color: rgba(148, 163, 184, 0.14) !important;
}

html[data-theme="light"] #guestbookModal .guestbook-composer-upload {
    border-color: rgba(148, 163, 184, 0.16) !important;
    background: rgba(255, 255, 255, 0.78) !important;
    color: rgba(71, 85, 105, 0.82) !important;
}

html[data-theme="light"] #guestbookModal .guestbook-composer-upload-inline {
    background: rgba(255, 255, 255, 0.9) !important;
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.92),
        0 10px 20px rgba(148, 163, 184, 0.14);
}

html[data-theme="light"] #guestbookModal .guestbook-composer-upload.has-image {
    color: rgba(82, 127, 168, 0.98) !important;
    border-color: rgba(107, 158, 206, 0.28) !important;
    background: rgba(107, 158, 206, 0.1) !important;
}

html[data-theme="light"] #guestbookModal .guestbook-composer-upload:hover,
html[data-theme="light"] #guestbookModal .guestbook-composer-upload:focus-visible {
    border-color: rgba(107, 158, 206, 0.26) !important;
    background: rgba(255, 255, 255, 0.94) !important;
    color: rgba(15, 23, 42, 0.92) !important;
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.92),
        0 12px 24px rgba(148, 163, 184, 0.14);
}

html[data-theme="light"] #guestbookModal .guestbook-composer-upload.has-image:hover,
html[data-theme="light"] #guestbookModal .guestbook-composer-upload.has-image:focus-visible {
    border-color: rgba(107, 158, 206, 0.34) !important;
    background: rgba(107, 158, 206, 0.14) !important;
    color: rgba(82, 127, 168, 0.98) !important;
}

html[data-theme="light"] #guestbookModal .guestbook-submit-btn.guestbook-composer-send,
html[data-theme="light"] #commentModal .comment-composer-send {
    background: rgba(107, 158, 206, 0.96) !important;
    border: 1px solid rgba(82, 127, 168, 0.36) !important;
    color: #08131f !important;
    box-shadow: none !important;
    filter: none;
    transform: translateZ(0);
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
}

html[data-theme="light"] #guestbookModal .guestbook-submit-btn.guestbook-composer-send:hover,
html[data-theme="light"] #guestbookModal .guestbook-submit-btn.guestbook-composer-send:focus-visible,
html[data-theme="light"] #commentModal .comment-composer-send:hover,
html[data-theme="light"] #commentModal .comment-composer-send:focus-visible {
    transform: translate3d(0, -1px, 0) !important;
    background: rgba(112, 166, 216, 0.96) !important;
    border-color: rgba(82, 127, 168, 0.5) !important;
    box-shadow:
        inset 0 0 0 1px rgba(255, 255, 255, 0.14),
        inset 0 1px 0 rgba(255, 255, 255, 0.18) !important;
    filter: none;
}

html[data-theme="light"] #guestbookModal .guestbook-submit-btn.guestbook-composer-send.is-submitting {
    background: linear-gradient(135deg, rgba(203, 236, 216, 0.96), rgba(179, 226, 197, 0.96)) !important;
    color: rgba(11, 42, 24, 0.82) !important;
    box-shadow:
        0 14px 28px rgba(148, 163, 184, 0.16),
        inset 0 1px 0 rgba(255, 255, 255, 0.54) !important;
}

html[data-theme="light"] #guestbookModal .guestbook-submit-btn.guestbook-composer-send.is-success {
    background: linear-gradient(135deg, rgba(110, 226, 148, 0.98), rgba(63, 212, 113, 0.96)) !important;
    color: var(--guestbook-light-success-text) !important;
    box-shadow:
        0 18px 34px rgba(52, 204, 104, 0.24),
        inset 0 1px 0 rgba(255, 255, 255, 0.42) !important;
}

/* 20260424_PUBLIC_LIGHT_MODAL_BACKDROP_1 */
html[data-theme="light"] :is(.modal-overlay:not(.login-overlay), #guestbookModal, #commentModal, #profileModal),
html:not([data-theme="dark"]) :is(.modal-overlay:not(.login-overlay), #guestbookModal, #commentModal, #profileModal),
html[data-theme="light"] .login-overlay.active:not(.closing),
html:not([data-theme="dark"]) .login-overlay.active:not(.closing) {
    background: var(--public-light-modal-backdrop) !important;
    backdrop-filter: var(--public-light-modal-backdrop-filter) !important;
    -webkit-backdrop-filter: var(--public-light-modal-backdrop-filter) !important;
    overscroll-behavior: contain !important;
    overscroll-behavior-y: contain !important;
}

html[data-theme="light"] #loginModal.auth-sheet-overlay:not(.closing),
html[data-theme="light"] #loginModal.auth-sheet-overlay.active:not(.closing),
html[data-theme="light"] #loginModal.auth-sheet-overlay.login-overlay:not(.closing),
html[data-theme="light"] #loginModal.auth-sheet-overlay.login-overlay.active:not(.closing),
html:not([data-theme="dark"]) #loginModal.auth-sheet-overlay:not(.closing),
html:not([data-theme="dark"]) #loginModal.auth-sheet-overlay.active:not(.closing),
html:not([data-theme="dark"]) #loginModal.auth-sheet-overlay.login-overlay:not(.closing),
html:not([data-theme="dark"]) #loginModal.auth-sheet-overlay.login-overlay.active:not(.closing) {
    background: var(--public-light-modal-backdrop) !important;
    backdrop-filter: var(--public-light-modal-backdrop-filter) !important;
    -webkit-backdrop-filter: var(--public-light-modal-backdrop-filter) !important;
    overscroll-behavior: contain !important;
    overscroll-behavior-y: contain !important;
}

/* Keep guestbook timestamps visually stable after async scripts, fonts, and late styles settle. */
body.guestbook-page .message-item .message-header .message-time {
    flex: 0 0 auto;
    font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif !important;
    font-size: 0.82rem !important;
    line-height: 1.2 !important;
    font-weight: 500 !important;
    letter-spacing: 0 !important;
    font-variant-numeric: tabular-nums;
    font-feature-settings: "tnum" 1;
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
}
