: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;
}

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

/* Base Styles */
html {
    background-color: #000;
    /* Pure black, no tinting */
    /* 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;
}

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;
    justify-content: center;
    align-items: center;
    width: 100%;
}

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

/* 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;
}

/* 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.05);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);

    /* 3D Border Effect: Top/Left lighter, Bottom/Right darker */
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-top: 1px solid rgba(255, 255, 255, 0.3);
    border-left: 1px solid rgba(255, 255, 255, 0.3);

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

    /* Multi-layer Shadows for Depth & Inner Glow */
    box-shadow:
        /* External Shadow (Depth) */
        0 20px 40px -10px rgba(0, 0, 0, 0.5),
        /* Inner Glow (Liquid Feel) */
        inset 0 1px 0 rgba(255, 255, 255, 0.2),
        inset 0 0 20px rgba(255, 255, 255, 0.02);

    transition: all 0.5s ease-out;
    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.22),
                transparent 40%);
        opacity: 0;
        transition: opacity 0.3s ease;
        pointer-events: none;
        mix-blend-mode: overlay;
    }

    .glass-box:hover::before {
        opacity: 1;
    }

    .glass-box:hover {
        background: rgba(255, 255, 255, 0.08);
        border-color: rgba(255, 255, 255, 0.3);
        transform: translateY(-6px);
        box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.7),
            0 12px 24px -8px rgba(0, 0, 0, 0.5);
    }
}

/* 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: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: rgba(0, 0, 0, 0.6);
    /* Darker background for less transparency - copied from login-overlay */
    backdrop-filter: blur(8px);
    /* Blur background to focus attention - copied from login-overlay */
    -webkit-backdrop-filter: blur(8px);
    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;
}

.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;
}

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

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

@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 body scroll when modal is open */
body.no-scroll {
    overflow: hidden;
    height: 100vh;
    touch-action: none;
    /* Disable default touch actions on body */
}

/* 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;
    }

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

    /* 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: 0.85rem !important;
        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: 30px !important;
        padding-top: 10px;
    }

    .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: 15px !important;
        border-radius: 16px !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: none;
    justify-content: center;
    align-items: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.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-envelope {
    font-size: 2.5rem;
    /* Adjusted for visual balance */
    margin-bottom: 10px;
    background: linear-gradient(135deg, #facc15, #f59e0b);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.modal-link-card .fa-weixin {
    font-size: 2.8rem;
    /* Slightly larger to match envelope weight */
    margin-bottom: 10px;
    color: #07c160;
}

.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;
    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;
}

/* 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: 1;
    animation: borderRotate 3s linear infinite;
    /* 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;
}

/* Message Item Card - 半透明卡片，hover变全白 */
.message-item {
    /* 半透明白色背景 */
    background: rgba(255, 255, 255, 0.75);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);

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

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

    /* 柔和阴影 */
    box-shadow:
        0 2px 8px rgba(0, 0, 0, 0.04),
        0 8px 24px rgba(0, 0, 0, 0.06);

    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    transform-origin: center;
}

.message-item:hover {
    background: rgba(255, 255, 255, 1);
    border-color: rgba(0, 0, 0, 0.08);
    transform: translateY(-2px);

    box-shadow:
        0 4px 12px rgba(0, 0, 0, 0.06),
        0 12px 32px rgba(0, 0, 0, 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(0, 0, 0, 0.35);
}

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

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

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

.message-image {
    margin: 15px 0;
    border-radius: 12px;
    overflow: hidden;
    background: rgba(0, 0, 0, 0.3);
    max-width: 100%;
}

.message-image img {
    width: 100%;
    height: auto;
    display: block;
    cursor: pointer;
    transition: transform 0.3s ease;
}

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

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

.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;
}

.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: 12px;
    transition: background 0.2s 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);
}

/* 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.1);
    /* 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%;
    padding: 18px 22px;
    border-radius: 16px;
    background: rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(155, 93, 229, 0.3);
    color: white;
    font-size: 16px;
    outline: none;
    box-sizing: border-box;
    transition: all 0.3s ease;
    letter-spacing: 0.3px;
}

.glass-input::placeholder {
    color: rgba(255, 255, 255, 0.5);
}

.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;
    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-overlay.active {
    visibility: visible;
    opacity: 1;
}

/* Prevent background scroll when modal open - especially on mobile */
body.no-scroll {
    overflow: hidden !important;
    /* Removed position: fixed to prevent scroll jump and layout issues */
    width: 100% !important;
    height: 100% !important;
}

.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);
    touch-action: none;
    /* 完全禁止触摸手势 */
    user-select: none;
    /* Prevent text selection */
    -webkit-user-select: none;
    -webkit-touch-callout: none;
    /* Disable iOS callout */
}

.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(1.1);
    /* Stronger glowing frame effect */
    box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.9), 0 0 15px rgba(255, 255, 255, 0.7) !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: 0 20px;
        margin: 80px auto 20px;
    }

    /* 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: 0;
        /* Remove bottom margin */
        /* 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: 1px solid rgba(255, 255, 255, 0.08);
        /* 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 {
        /* Inherit global flex styles */
        padding: 12px 0;
        border-bottom: 1px solid rgba(255, 255, 255, 0.05);
        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 */
}

/* ========== 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;
}

/* 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: #6366f1 !important;
    /* Indigo 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);
    text-decoration: none !important;
    /* No underline */
    transform: translateY(-1px);
    /* Subtle lift */
}

/* @mention styling */
.comment-mention {
    color: #a78bfa;
    /* Soft purple */
    font-weight: 600;
    margin-right: 4px;
    background: rgba(167, 139, 250, 0.1);
    padding: 2px 6px;
    border-radius: 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 {
    transition: max-height 0.4s cubic-bezier(0.4, 0, 0.2, 1),
        opacity 0.4s ease;
    position: relative;
    overflow: hidden;
    /* 移除min-height避免抽搐 */
}

/* ONLY use flex when showing 'no comments' */
.comment-list:empty::before {
    content: '暂无评论';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: rgba(255, 255, 255, 0.5);
    font-size: 0.9rem;
    white-space: nowrap;
}

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

.comment-list.collapsed {
    max-height: 160px;
    /* 减小折叠高度 */
    overflow: 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;
    /* 允许内部滚动 */
    /* 自定义滚动条样式 */
    scrollbar-width: thin;
    scrollbar-color: rgba(0, 0, 0, 0.2) transparent;
}

.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 */

/* Initial State: Hidden and Offset (only when overlay is NOT active) */
.modal-overlay:not(.active) .modal-content>*:not(.window-controls):not(.modal-close),
.login-overlay:not(.active) .login-card .form-view>* {
    opacity: 0;
    transform: translateY(20px);
}

/* Add transition to all content elements */
.modal-content>*:not(.window-controls):not(.modal-close),
.login-card .form-view>* {
    transition: all 0.5s ease-out;
}

/* 确保按钮内的图标不干扰点击 */
button *,
.submit-btn *,
.upload-icon-btn *,
.login-submit-btn *,
.google-login-btn *,
.verify-code-btn *,
.view-more-btn * {
    pointer-events: none;
}

/* 激活状态的弹窗和内容 */
.login-overlay.active,
.modal-overlay.active {
    pointer-events: all !important;
}

.login-overlay.active .login-card,
.modal-overlay.active .modal-content {
    pointer-events: auto !important;
}

/* Active State: Visible and Reset */
.modal-overlay.active .modal-content>*:not(.window-controls):not(.modal-close),
.login-overlay.active .login-card .form-view>* {
    opacity: 1 !important;
    transform: translateY(0) !important;
    pointer-events: auto !important;
}

/* 全局确保所有按钮和链接始终可点击 - 最高优先级 */
button,
input[type="button"],
input[type="submit"],
input[type="reset"],
a,
label[for],
.submit-btn,
.upload-icon-btn,
.login-submit-btn,
.google-login-btn,
.verify-code-btn,
.mac-dot,
.switch-link,
.forgot-password-link,
.view-more-btn,
[onclick],
[type="submit"],
.modal-content button,
.modal-content a,
.modal-content .submit-btn,
.modal-content .upload-icon-btn,
.modal-content .view-more-btn,
.login-card button,
.login-card a,
.login-card .login-submit-btn,
.login-card .google-login-btn {
    pointer-events: auto !important;
    cursor: pointer !important;
}

/* Staggered Delays for Cascading Effect */
.modal-overlay.active .modal-content>*:nth-child(1),
.login-overlay.active .login-card .form-view>*:nth-child(1) {
    transition-delay: 0.1s;
}

.modal-overlay.active .modal-content>*:nth-child(2),
.login-overlay.active .login-card .form-view>*:nth-child(2) {
    transition-delay: 0.15s;
}

.modal-overlay.active .modal-content>*:nth-child(3),
.login-overlay.active .login-card .form-view>*:nth-child(3) {
    transition-delay: 0.2s;
}

.modal-overlay.active .modal-content>*:nth-child(4),
.login-overlay.active .login-card .form-view>*:nth-child(4) {
    transition-delay: 0.25s;
}

.modal-overlay.active .modal-content>*:nth-child(5),
.login-overlay.active .login-card .form-view>*:nth-child(5) {
    transition-delay: 0.3s;
}

.modal-overlay.active .modal-content>*:nth-child(n+6),
.login-overlay.active .login-card .form-view>*:nth-child(n+6) {
    transition-delay: 0.35s;
}

/* 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: 30px;
    right: 100px;
    /* 进一步向左移动，确保下拉菜单完全显示 */
    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: white !important;
    /* Full white since fa-user has no circular background */
}

#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: rgba(0, 0, 0, 0.6);
    /* Darkened background */
    backdrop-filter: blur(8px);
    /* Blur background to focus attention */
    -webkit-backdrop-filter: blur(8px);
    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: blur(8px) !important;
    -webkit-backdrop-filter: blur(8px) !important;
    background: rgba(0, 0, 0, 0.6) !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: rgba(0, 0, 0, 0.6);
    /* Match modal overlay */
    backdrop-filter: blur(8px);
    /* Match modal overlay */
    -webkit-backdrop-filter: blur(8px);
    z-index: 1999;
    /* 低于弹窗 (2000) 以免遮挡弹窗交互 */
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    pointer-events: none !important;
}

/* Trigger backdrop when dropdown is active */
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 - Unified with Modals */
    background: rgba(0, 0, 0, 0.1);
    /* 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.wide {
    width: 900px;
    max-width: 95vw;
    /* Keep wide class but don't allow it to reset */
}

.profile-avatar-section {
    position: relative;
    width: 140px;
    /* Enlarged from 120px */
    height: 140px;
    margin: 20px auto 24px;
    cursor: pointer;
    border-radius: 50%;
    overflow: hidden;
    /* Removed border */
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
    /* Enhanced shadow instead */
    transition: all 0.3s ease-out;
    flex-shrink: 0;
}

.profile-avatar-section:hover {
    transform: scale(1.05);
    /* Combined shadow: White glowing frame + Deep drop shadow */
    box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.9), 0 0 20px rgba(255, 255, 255, 0.6), 0 12px 32px rgba(0, 0, 0, 0.5) !important;
}

.profile-avatar-section img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.avatar-upload-hint {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(10px);
    padding: 8px;
    opacity: 0;
    transition: opacity 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    font-size: 13px;
    color: white;
}

.profile-avatar-section:hover .avatar-upload-hint {
    opacity: 1;
}

/* Nickname Section */
.profile-nickname-section {
    margin-bottom: 24px;
    min-height: 40px;
    width: 100%;
    max-width: 320px;
    position: relative;
    /* 与安全页面模块风格一致的容器 */
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 12px;
    padding: 18px;
    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;
    position: relative;
    overflow: hidden;
    flex-shrink: 0;
}

/* 昵称区块左侧装饰条 */
.profile-nickname-section::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    background: linear-gradient(180deg, rgba(168, 85, 247, 0.6), rgba(244, 114, 182, 0.6));
    border-radius: 12px 0 0 12px;
}

.profile-nickname-section: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);
}

.nickname-display {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    /* 编辑模式切换动画 */
    transition: opacity 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94),
        transform 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.nickname-display.hiding {
    opacity: 0;
    transform: translateY(-10px);
    pointer-events: none;
}

/* 显示模式进入动画 */
.nickname-display.showing {
    animation: displayModeRise 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94) backwards;
}

@keyframes displayModeRise {
    from {
        opacity: 0;
        transform: translateY(20px) scale(0.95);
    }

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

#profileModalNickname {
    font-size: 20px;
    font-weight: 600;
    color: white;
}

.edit-icon {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.4);
    cursor: pointer;
    transition: color 0.2s, transform 0.2s;
}

.edit-icon:hover {
    color: #007aff;
    transform: scale(1.1);
}

.nickname-edit {
    display: flex;
    flex-direction: column;
    gap: 12px;
    align-items: center;
    /* 编辑模式进入动画 */
    animation: editModeRise 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94) backwards;
}

@keyframes editModeRise {
    from {
        opacity: 0;
        transform: translateY(20px) scale(0.95);
    }

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

#nicknameInput {
    /* 与安全页面输入框风格一致 */
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 8px;
    padding: 10px 16px;
    color: white;
    text-align: center;
    width: 220px;
    font-size: 16px;
    transition: all 0.2s ease;
}

#nicknameInput:focus {
    outline: none;
    border-color: rgba(0, 122, 255, 0.6);
    background: rgba(0, 0, 0, 0.6);
    box-shadow: 0 0 0 3px rgba(0, 122, 255, 0.1),
        inset 0 1px 2px rgba(0, 0, 0, 0.3);
}

.edit-actions {
    display: flex;
    gap: 10px;
}

.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;
}

/* --- Mobile Overrides for Flip Container (Fix Truncation) --- */
@media (max-width: 768px) {
    .profile-flip-container {
        min-height: auto !important;
        height: auto !important;
        overflow: visible !important;
        /* Allow content to overflow naturally */
    }

    .profile-flip-inner {
        min-height: auto !important;
        height: auto !important;
        display: block !important;
    }

    .profile-view {
        position: relative !important;
        /* Stack naturally, no absolute positioning */
        height: auto !important;
        opacity: 1 !important;
        visibility: visible !important;
        transition: none !important;
        /* Remove transition to prevent glitches */
    }

    /* Manually manage visibility since we aren't using absolute positioning */
    .profile-front {
        display: block !important;
    }

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

    /* When flipped, hide front and show back */
    .profile-flip-inner.flipped .profile-front {
        display: none !important;
    }

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

/* 错落上升动画关键帧 */
@keyframes staggeredRise {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

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

/* 资料页面 - 文字内容错落上升动画 */
.profile-front.animate-in .modal-title {
    animation: staggeredRise 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94) 0.1s backwards;
}

.profile-front.animate-in .profile-avatar-section {
    animation: staggeredRise 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94) 0.15s backwards;
}

.profile-front.animate-in .profile-nickname-section {
    animation: staggeredRise 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94) 0.2s backwards;
}

.profile-front.animate-in .profile-email-section {
    animation: staggeredRise 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94) 0.25s backwards;
}

.profile-front.animate-in .member-since-badge {
    animation: staggeredRise 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94) 0.3s backwards;
}

/* 安全页面 - 使用与资料页面相同的动画 */
.profile-back.animate-in .modal-title {
    animation: staggeredRise 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94) 0.1s backwards;
}


.profile-back.animate-in .security-menu {
    /* 不再对整个菜单容器动画，避免布局抖动 */
    opacity: 1;
}

.profile-back.animate-in .security-detail-panel {
    /* 不再对整个面板容器动画，避免布局抖动 */
    opacity: 1;
}

/* 为初次加载时的子元素添加动画 */
.profile-back.animate-in .security-menu .security-card:nth-child(1) {
    animation: staggeredRise 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94) 0.15s backwards;
}

.profile-back.animate-in .security-menu .security-card:nth-child(2) {
    animation: staggeredRise 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94) 0.2s backwards;
}

.profile-back.animate-in .security-menu .security-card:nth-child(3) {
    animation: staggeredRise 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94) 0.25s backwards;
}

/* Profile Tabs */
.profile-tabs {
    display: flex;
    justify-content: center;
    margin-bottom: 20px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    padding: 4px;
    width: fit-content;
    margin-left: auto;
    margin-right: auto;
}

.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 View Styles */
.security-item {
    /* 增强模块区分度 - 更明显的背景和边框 */
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 12px;
    padding: 18px;
    margin-bottom: 18px;
    text-align: left;
    /* 添加外阴影和内阴影，增强层次感 */
    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;
    position: relative;
    overflow: hidden;
    box-sizing: border-box;
    /* 确保 padding 不会撑大容器 */
}

/* 为每个模块添加左侧装饰条 */
.security-item::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    background: linear-gradient(180deg, rgba(168, 85, 247, 0.6), rgba(244, 114, 182, 0.6));
    border-radius: 12px 0 0 12px;
}

.security-item: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);
}

.security-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 14px;
    font-weight: 600;
    /* 恢复纯色 */
    color: #ffffff;
    margin-bottom: 8px;
    letter-spacing: 0.3px;
}

.security-desc {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.5);
    margin-bottom: 10px;
}

.security-input {
    width: 100%;
    box-sizing: border-box;
    /* 确保 padding 包含在宽度内 */
    background: transparent;
    border: 1px solid rgba(155, 93, 229, 0.3);
    border-radius: 8px;
    padding: 10px 12px;
    color: white;
    font-size: 13px;
    margin-bottom: 10px;
    transition: all 0.2s ease;
}

.security-input::placeholder {
    color: rgba(255, 255, 255, 0.4);
    text-shadow: none;
}

.security-input:focus {
    outline: none;
    border-color: rgba(155, 93, 229, 0.7);
    background: transparent !important;
    box-shadow: 0 0 0 3px rgba(155, 93, 229, 0.15);
}

.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);
}

.profile-email-section {
    margin: 0 0 24px 0;
    padding: 18px;
    width: 100%;
    max-width: 320px;
    /* 与安全页面模块风格一致 */
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 12px;
    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;
    position: relative;
    overflow: hidden;
    flex-shrink: 0;
}

/* 邮箱区块左侧装饰条 */
.profile-email-section::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    background: linear-gradient(180deg, rgba(168, 85, 247, 0.6), rgba(244, 114, 182, 0.6));
    border-radius: 12px 0 0 12px;
}

.profile-email-section: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);
}

.profile-email-section label {
    display: block;
    font-size: 12px;
    color: rgba(255, 255, 255, 0.6);
    margin-bottom: 8px;
}

.profile-email-display {
    font-size: 15px;
    color: rgba(255, 255, 255, 0.95);
    font-weight: 500;
}

/* 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.1);
}

.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;
    font-size: 14px;
    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;
    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;
}


.profile-email-section label {
    display: block;
    font-size: 12px;
    color: rgba(255, 255, 255, 0.6);
    margin-bottom: 8px;
}

.profile-email-display {
    font-size: 15px;
    color: rgba(255, 255, 255, 0.95);
    font-weight: 500;
}

/* 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.1);
}

.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;
    font-size: 14px;
    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,
.modal-content textarea,
.login-card input,
.login-card textarea,
.nickname-edit input,
.security-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,
.modal-content input::placeholder,
.modal-content textarea::placeholder,
.login-card input::placeholder {
    color: rgba(255, 255, 255, 0.5) !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;
}

/* 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) *,
#comingSoonModal:not(.active) * {
    pointer-events: none !important;
}

/* Prevent profile avatar section from triggering when modal is closed */
#profileModal:not(.active) .profile-avatar-section,
#profileModal:not(.active) .profile-avatar-section * {
    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-duration: 0.5s !important;
    transition-timing-function: ease-out !important;
    /* Match modal content animation (0.5s ease-out) */
    transform: translateZ(0);
    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) translateZ(0) !important;
    /* Match submit-btn lift */
    text-shadow: 0 4px 12px rgba(244, 114, 182, 0.4) !important;
    background: transparent !important;
    box-shadow: none !important;
    transition-delay: 0s !important;
    /* Instant hover response */
}

.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;
}

/* Mobile Scroll Highlight Effect - 白色卡片版 */
@media (max-width: 768px) {
    .message-item {
        transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
        /* 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 */
    }

    .message-item.active-focus {
        /* 优雅的抬起效果 */
        transform: scale(1.02) translateY(-3px);

        /* 完全不透明 */
        background: rgba(255, 255, 255, 1) !important;

        /* 紫色边框 */
        border-color: rgba(139, 92, 246, 0.3) !important;

        /* 更深的阴影 */
        box-shadow:
            0 8px 16px rgba(0, 0, 0, 0.08),
            0 20px 40px rgba(0, 0, 0, 0.12),
            0 0 0 1px rgba(139, 92, 246, 0.2) !important;

        z-index: 10;
    }
}

/* 强制禁止移动端页面缩放 */
html,
body {
    touch-action: pan-y !important;
    -ms-touch-action: pan-y !important;
}

/* 图片预览模态框也禁止缩放，避免触发页面缩放 */
.image-modal,
.image-modal * {
    touch-action: none !important;
}

/* 修复输入框获得焦点时模态框被输入法遮挡的问题 */
@media (max-width: 768px) {

    /* Fix all modal overlays on mobile */
    .modal-overlay.active,
    .login-overlay.active {
        align-items: flex-start !important;
        padding-top: 20px !important;
        overflow-y: auto !important;
        -webkit-overflow-scrolling: touch !important;
    }

    /* Ensure modal content is scrollable and fits viewport */
    .modal-content,
    .login-card {
        max-height: calc(100vh - 40px) !important;
        overflow-y: auto !important;
        -webkit-overflow-scrolling: touch !important;
        margin-top: 0 !important;
        position: relative !important;
    }

    .guestbook-content {
        margin-top: 0 !important;
        max-height: calc(100vh - 40px) !important;
        overflow-y: auto !important;
    }

    /* 防止背景滚动，但不使用position:fixed避免背景跟随上移 */
    body.modal-active {
        overflow: hidden !important;
        /* 移除 position: fixed，它会导致背景跟随弹窗上移 */
    }
}

/* 强制修复iOS输入法导致的背景上移问题 */
html,
body {
    position: relative !important;
    min-height: 100vh !important;
    overflow-x: hidden !important;
}

/* 确保background-blobs完全固定 */
.background-blobs {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    z-index: -1 !important;
    pointer-events: none !important;
    /* 使用transform: translateZ(0)创建新的stacking context */
    transform: translateZ(0) !important;
    will-change: auto !important;
}

/* blob使用fixed相对于viewport */
.background-blobs .blob {
    position: fixed !important;
}