/* Global styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    /* Business website style colors - background colors */
    --bg-primary: #ffffff;
    --bg-secondary: #f8fafc;
    --bg-tertiary: #f1f5f9;
    --bg-overlay: rgba(0, 0, 0, 0.4);
    --bg-overlay-dark: rgba(0, 0, 0, 0.6);
    --bg-overlay-light: rgba(0, 0, 0, 0.05);
    
    /* Business website style colors - primary colors (blue series) */
    --color-primary: #4169E1;
    --color-primary-light: #4FC3F7;
    --color-primary-lighter: #e0f2fe;
    --color-primary-lightest: #f0f9ff;
    --color-accent: #4169E1;
    --color-accent-light: #4FC3F7;
    
    /* Business website style colors - accent colors */
    --color-orange: #FF6B35;
    --color-orange-light: #ff8c42;
    --color-red: #ef4444;
    --color-red-light: #fef2f2;
    --color-green: #06d69a;
    --color-success: #06d69a;
    
    /* Business website style colors - text colors */
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --text-tertiary: #94a3b8;
    --text-quaternary: #475569;
    --text-white: #ffffff;
    
    /* Business website style colors - border colors */
    --border-color: #e2e8f0;
    --border-color-light: #cbd5e1;
    --border-color-primary: rgba(65, 105, 225, 0.2);
    --border-color-primary-hover: rgba(65, 105, 225, 0.4);
    
    /* Business website style colors - shadows */
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.08);
    --shadow-xl: 0 20px 60px rgba(0, 0, 0, 0.15);
    --shadow-primary: 0 4px 12px rgba(65, 105, 225, 0.3);
    --shadow-primary-hover: 0 6px 20px rgba(65, 105, 225, 0.4);
    --shadow-primary-light: 0 2px 8px rgba(65, 105, 225, 0.2);
    --shadow-glow: 0 0 0 3px rgba(65, 105, 225, 0.1);
    
    /* Business website style colors - gradients */
    --gradient-primary: linear-gradient(135deg, #4169E1 0%, #4FC3F7 100%);
    --gradient-primary-reverse: linear-gradient(135deg, #4FC3F7 0%, #4169E1 100%);
    --gradient-bg: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
    --gradient-bg-light: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    --gradient-bg-blue: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
    --gradient-orange-blue: linear-gradient(180deg, #4169E1 0%, #FF6B35 100%);
}

html {
    touch-action: manipulation;
    -ms-touch-action: manipulation;
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    user-select: none;
}

body {
    font-family: 'Noto Sans', sans-serif;
    background: var(--bg-secondary);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    position: relative;
    overflow-x: hidden;
    touch-action: manipulation;
    -ms-touch-action: manipulation;
    -webkit-touch-callout: none;
}

/* Allow text selection in input fields and textareas */
input, textarea, [contenteditable] {
    -webkit-user-select: text !important;
    user-select: text !important;
}

/* Business website style background - default (temple scene) */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
}

/* Dunhuang texture background - default (temple scene) */
body::after {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
}


#app {
    position: relative;
    z-index: 1;
    min-height: 100vh;
    isolation: isolate;
}

/* Header */
.header {
    padding: 1rem;
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-content {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-family: 'Noto Serif', serif;
    font-size: 1.5rem;
}

.header-actions {
    display: none;
    align-items: center;
    gap: 1rem;
}

/* Scene selection drawer - business website style */
.scene-options {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    padding: 1rem 0;
}

.scene-option {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1.5rem;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    box-shadow: var(--shadow-sm);
}

.scene-option:hover {
    background: var(--bg-secondary);
    border-color: var(--border-color-light);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.scene-option.active {
    background: var(--gradient-bg-blue);
    border-color: var(--color-primary);
    box-shadow: var(--shadow-primary-light);
}

.scene-option-icon {
    font-size: 2.5rem;
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--gradient-bg-light);
    border-radius: 12px;
    flex-shrink: 0;
    border: 1px solid var(--border-color);
    transition: all 0.3s;
}

.scene-option:hover .scene-option-icon {
    background: var(--gradient-bg);
    border-color: var(--border-color-light);
    transform: scale(1.05);
}

.scene-option.active .scene-option-icon {
    background: var(--gradient-primary);
    border-color: var(--color-primary);
    box-shadow: var(--shadow-primary-light);
}

.scene-option-content {
    flex: 1;
}

.scene-option-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
    letter-spacing: -0.01em;
}

.scene-option.active .scene-option-title {
    color: var(--color-primary);
}

.scene-option-desc {
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.6;
    margin: 0;
}

.scene-option.active .scene-option-desc {
    color: var(--text-quaternary);
}

.scene-option-check {
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--color-primary);
    font-size: 1.2rem;
    font-weight: bold;
    opacity: 0;
    transition: opacity 0.3s;
    background: var(--color-primary);
    border-radius: 50%;
    color: var(--text-white);
}

.scene-option.active .scene-option-check {
    opacity: 1;
}

/* Mobile optimization */
@media (max-width: 768px) {
    .scene-option {
        padding: 1rem;
        gap: 0.75rem;
    }
    
    .scene-option-icon {
        width: 50px;
        height: 50px;
        font-size: 2rem;
    }
    
    .scene-option-title {
        font-size: 1rem;
    }
    
    .scene-option-desc {
        font-size: 0.85rem;
    }
}

/* Temple scene styles (default, keep original styles) */
/* Use default Dunhuang style colors, no additional style overrides needed */

.user-stats {
    display: flex;
    gap: 1rem;
    font-size: 0.85rem;
}

.stat-item {
    color: var(--text-secondary);
}

.stat-item span {
    color: var(--color-accent);
    font-weight: 600;
}

/* Wish category pagination - bubble style, floating above cube container */
.categories-pagination {
    position: absolute;
    top: 0.5rem;
    left: 0;
    width: 100%;
    display: flex;
    background: transparent;
    z-index: 10;
    padding: 0.5rem;
    gap: 0.5rem;
    pointer-events: none; /* Allow clicks to pass through to background */
}

.categories-pagination-item {
    flex: 1;
    text-align: center;
    padding: 0.75rem 0.5rem;
    cursor: pointer;
    font-size: 0.8rem;
    line-height: 1.4;
    transition: all 0.3s ease;
    position: relative;
    user-select: none;
    pointer-events: auto; /* Restore click events */
    /* Remove click highlight effect */
    -webkit-tap-highlight-color: transparent;
    -webkit-touch-callout: none;
    outline: none;
    border-radius: 20px;
    /* Scene switch transition */
    transition: all 0.3s ease, background 0.3s ease, border-color 0.3s ease, color 0.3s ease;
}

.categories-pagination-item:hover {
    outline: none;
}

.categories-pagination-item:active {
    outline: none;
    -webkit-tap-highlight-color: transparent;
}

.btn-text {
    border: 1px solid;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9rem;
    outline: none;
    -webkit-tap-highlight-color: transparent;
    background: transparent;
    transition: all 0.3s;
}

.btn-text:focus {
    outline: none;
    background: transparent;
}

.btn-text:active {
    outline: none;
    background: transparent;
}

/* Main content */
.main-content {
    position: relative;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0;
    display: flex;
    flex-direction: column;
}

/* Background carousel - as background of main-content */
.categories-background-carousel {
    position: relative;
    width: 100%;
    min-height: 100vh;
    z-index: 1;
    overflow: hidden;
}

/* 3D cube container */
.categories-cube-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    transform-style: preserve-3d;
    transition: transform 0.8s ease-in-out;
    will-change: transform;
    z-index: 1; /* Ensure below pagination bar */
}

.category-bg-layer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    min-height: 90vh;
    background-size: 100% auto;
    background-position: center top;
    background-repeat: no-repeat;
    backface-visibility: hidden;
    opacity: 0;
    transition: opacity 0.8s ease-in-out;
    pointer-events: none;
}

.category-bg-layer.visible {
    opacity: 1;
}

.category-bg-video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    min-height: 90vh;
    object-fit: cover;
    object-position: center top;
    opacity: 0;
    pointer-events: none;
    z-index: 0;
    background-color: transparent;
    background: transparent;
    /* Prevent video fullscreen playback */
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    user-select: none;
    /* Ensure video plays within container, no popup */
    display: block;
    max-width: 100%;
    max-height: 100%;
}

.category-bg-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        180deg,
        rgba(255, 255, 255, 0.05) 0%,
        rgba(255, 255, 255, 0.1) 20%,
        rgba(255, 255, 255, 0.2) 40%,
        rgba(248, 250, 252, 0.4) 60%,
        rgba(241, 245, 249, 0.7) 75%,
        rgba(248, 250, 252, 0.85) 85%,
        rgba(255, 255, 255, 0.95) 100%
    );
    z-index: 1;
}

/* Wish area - Dunhuang style */
.wish-section {
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10;
    width: 100%;
    max-width: 450px;
    padding: 1.5rem 0.75rem;
    transition: opacity 0.5s ease-in-out;
}

.wish-section.rotating {
    opacity: 0.25;
}

.wish-card {
    border-radius: 8px;
    position: relative;
}

/* Simple top decorative line */
.wish-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 90px;
    height: 1px;
}

.wish-header {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.56rem;
    margin-bottom: 1.125rem;
}

.wish-icon {
    font-size: 1.5rem;
    opacity: 0.8;
}

.wish-section-close {
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.3s;
    z-index: 10;
}

.wish-title {
    font-family: 'Noto Serif', serif;
    font-size: 1.3rem;
    text-align: center;
    letter-spacing: 0.15em;
    margin: 0;
    font-weight: 600;
}

.wish-input-wrapper {
    margin-bottom: 0.375rem;
    position: relative;
}

/* Wish name and submit button wrapper */
.wish-name-submit-wrapper {
    display: flex;
    gap: 0.75rem;
    align-items: stretch;
}

/* When name wrapper is hidden, button should take full width */
.wish-name-submit-wrapper.wish-name-hidden .wish-submit-btn {
    width: 100%;
}

/* Wish maker name input field */
.wish-name-wrapper {
    flex: 1;
    position: relative;
    margin-bottom: 0;
    display: flex;
    align-items: stretch;
}

.wish-name-input {
    width: 100%;
    border-radius: 4px;
    padding: 0.6375rem 0.75rem;
    font-size: 0.95rem;
    font-family: inherit;
    outline: none;
    height: 100%;
    box-sizing: border-box;
}

.wish-name-input:focus {
    border-color: var(--color-primary);
    box-shadow: var(--shadow-glow);
}

.wish-name-input::placeholder {
    color: var(--text-tertiary);
}

.wish-input-container {
    position: relative;
    display: block;
    background: transparent;
    border-radius: 0;
    padding: 0;
}

.wish-input {
    width: 100%;
    border-radius: 4px;
    padding: 0.75rem;
    font-size: 1rem;
    font-family: inherit;
    resize: vertical;
    position: relative;
    z-index: 2;
    min-height: 75px;
}

.wish-input:focus {
    outline: none;
}

/* Placeholder rotation container */
.wish-placeholder-rotator {
    position: absolute;
    top: 0.75rem;
    left: 0.75rem;
    right: 0.75rem;
    bottom: auto;
    pointer-events: none;
    z-index: 3;
    overflow: visible;
    display: block;
    user-select: none;
}

.placeholder-text {
    color: var(--text-secondary);
    font-size: 1rem;
    line-height: 1.5;
    white-space: normal;
    overflow: visible;
    word-wrap: break-word;
    word-break: break-all;
    cursor: pointer;
    pointer-events: auto;
    transition: opacity 0.3s ease, color 0.3s ease;
    display: block;
    opacity: 0.7;
}

.placeholder-text:hover {
    color: var(--color-primary);
    opacity: 1;
}

/* Wish input container */
.wish-input-container {
    animation: fadeIn 0.3s ease-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Buttons - business website style */
.btn-primary.wish-submit-btn {
    border: none;
    padding: 0.6375rem 1.5rem;
    border-radius: 4px;
    font-size: 1rem;
    font-family: 'Noto Serif', serif;
    cursor: pointer;
    width: auto;
    flex-shrink: 0;
    white-space: nowrap;
    letter-spacing: 0.1em;
    position: relative;
    outline: none;
    -webkit-tap-highlight-color: transparent;
    -webkit-focus-ring-color: transparent;
    display: block;
}

.btn-primary.wish-submit-btn:focus {
    outline: none;
    -webkit-tap-highlight-color: transparent;
}

.btn-primary.dunhuang-btn:hover {
    background: var(--gradient-primary-reverse);
    box-shadow: var(--shadow-primary-hover);
    transform: translateY(-1px);
}

.btn-primary.wish-submit-btn:active {
    transform: translateY(0);
    box-shadow: var(--shadow-primary);
    outline: none;
    -webkit-tap-highlight-color: transparent;
}

/* Button base styles */
.btn-primary {
    background: var(--gradient-primary);
    border: none;
    color: var(--text-white);
    padding: 0.85rem 2rem;
    border-radius: 4px;
    font-size: 1rem;
    font-weight: 600;
    font-family: 'Noto Serif', serif;
    cursor: pointer;
    box-shadow: var(--shadow-primary);
    letter-spacing: 0.1em;
}

.btn-primary:hover {
    background: var(--gradient-primary-reverse);
    box-shadow: var(--shadow-primary-hover);
    transform: translateY(-1px);
}

.btn-primary:active {
    transform: translateY(0);
    box-shadow: var(--shadow-primary);
}

.btn-inline {
    width: auto;
}

.btn-outline {
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 0.65rem 1.5rem;
    border-radius: 999px;
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-outline:hover {
    border-color: var(--color-primary);
    color: var(--color-primary);
    box-shadow: var(--shadow-glow);
}

.btn-outline:active {
    transform: translateY(0);
}

.btn-secondary {
    background: transparent;
    border: 1px solid var(--color-primary);
    color: var(--color-primary);
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: 500;
    margin-top: 1rem;
    cursor: pointer;
    transition: all 0.3s;
    width: 100%;
}

.btn-secondary:hover {
    background: rgba(6, 214, 160, 0.1);
    border-color: var(--color-success);
    box-shadow: var(--shadow-glow);
}

/* Check-in area - business website style */
.checkin-section {
    position: relative;
    z-index: 10;
    width: 100%;
    padding: 2rem 1rem;
    margin-bottom: 2rem;
    text-align: center;
    background: var(--gradient-bg);
    border-radius: 0;
}

.checkin-card {
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 2.5rem 2rem;
    text-align: center;
    box-shadow: var(--shadow-md);
    max-width: 600px;
    margin: 0 auto;
}

.btn-checkin {
    background: var(--gradient-primary);
    border: none;
    color: var(--text-white);
    padding: 1rem 2rem;
    border-radius: 12px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    box-shadow: var(--shadow-primary);
    margin-bottom: 1rem;
    width: 100%;
    letter-spacing: -0.01em;
}

.btn-checkin:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: var(--shadow-primary-hover);
    background: var(--gradient-primary-reverse);
}

.btn-checkin:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    background: var(--border-color-light);
    box-shadow: none;
}

.checkin-icon {
    font-size: 1.5rem;
}

.checkin-hint {
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-weight: 500;
}

/* Active wishes list (home page) - business website style */
.active-wishes-section {
    position: relative;
    z-index: 10;
    width: 100%;
    padding: 2rem 1rem 0;
    margin-bottom: auto;
    background: var(--gradient-bg);
}

.active-wishes-list {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    max-width: 1200px;
    margin: 0 auto;
}

.active-wish-item {
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 1.75rem;
    padding-right: 200px;
    min-height: 200px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

.active-wish-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: var(--gradient-primary);
    opacity: 0;
    transition: opacity 0.3s;
}

.active-wish-item:hover {
    border-color: var(--border-color-light);
    box-shadow: var(--shadow-lg);
    transform: translateY(-4px);
}

.active-wish-item:hover::before {
    opacity: 1;
}

.active-wish-content-wrapper {
    position: relative;
    z-index: 2;
    max-width: calc(100% - 200px);
}

.active-wish-content {
    color: var(--text-primary);
    font-size: 1rem;
    line-height: 1.7;
    margin-bottom: 0.75rem;
    word-break: break-word;
    font-weight: 500;
}

.active-wish-time {
    color: var(--text-secondary);
    font-size: 0.875rem;
    margin-bottom: 1rem;
    font-weight: 500;
}

/* Success cases - business website style */
.success-section {
    position: relative;
    z-index: 10;
    width: 100%;
    padding: 2rem 1rem;
    background: var(--gradient-bg);
    border-radius: 0;
}

.section-subtitle {
    font-family: 'Noto Sans', sans-serif;
    font-size: 1.5rem;
    font-weight: 600;
    background: linear-gradient(90deg, #4169E1 0%, #FF6B35 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    margin: 0 auto 2rem;
    text-align: center;
    letter-spacing: -0.02em;
}

.success-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
    max-width: 1200px;
    margin: 0 auto;
}

.success-item {
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1.75rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: var(--shadow-sm);
    position: relative;
    overflow: hidden;
}

.success-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: var(--gradient-orange-blue);
    opacity: 0;
    transition: opacity 0.3s;
}

.success-item:hover {
    border-color: var(--border-color-light);
    box-shadow: var(--shadow-lg);
    transform: translateY(-4px);
}

.success-item:hover::before {
    opacity: 1;
}

.success-user {
    color: var(--color-primary);
    font-size: 0.875rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.success-wish {
    color: var(--text-primary);
    margin-bottom: 0.75rem;
    line-height: 1.7;
    font-size: 0.95rem;
}

.success-time {
    color: var(--text-secondary);
    font-size: 0.8125rem;
    font-weight: 500;
}

/* Success item flip animation */
.success-item.flip-out {
    animation: flipOut 0.3s ease-in forwards;
}

.success-item.flip-in {
    animation: flipIn 0.3s ease-out forwards;
}

@keyframes flipOut {
    0% {
        transform: perspective(1000px) rotateY(0deg);
        opacity: 1;
    }
    100% {
        transform: perspective(1000px) rotateY(-90deg);
        opacity: 0;
    }
}

@keyframes flipIn {
    0% {
        transform: perspective(1000px) rotateY(90deg);
        opacity: 0;
    }
    100% {
        transform: perspective(1000px) rotateY(0deg);
        opacity: 1;
    }
}

/* Adjust success-list to center single item */
.success-list.single-item {
    display: flex;
    justify-content: center;
    align-items: center;
    grid-template-columns: none;
    max-width: 600px;
    margin: 0 auto;
}

/* Drawer */
.drawer {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1000;
    display: none;
    isolation: isolate;
}

.drawer.active {
    display: block;
}

.drawer-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--bg-overlay);
    backdrop-filter: blur(8px);
    transition: opacity 0.3s ease;
}

.drawer-content {
    position: absolute;
    top: 0;
    right: 0;
    width: 90%;
    max-width: 500px;
    height: 100%;
    background: var(--bg-primary);
    box-shadow: -8px 0 32px rgba(0, 0, 0, 0.12);
    display: flex;
    flex-direction: column;
    transform: translateX(100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.drawer.active .drawer-content {
    transform: translateX(0);
}

.drawer-header {
    padding: 1.75rem 1.5rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--gradient-bg);
}

.drawer-header h2 {
    font-family: 'Noto Sans', sans-serif;
    font-size: 1.5rem;
    font-weight: 600;
    background: linear-gradient(90deg, #4169E1 0%, #FF6B35 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    letter-spacing: -0.02em;
    margin: 0;
}

.drawer-close {
    background: var(--bg-tertiary);
    border: none;
    color: var(--text-secondary);
    font-size: 1.5rem;
    cursor: pointer;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    transition: all 0.2s;
    line-height: 1;
}

.drawer-close:hover {
    background: var(--border-color);
    color: var(--text-primary);
    transform: scale(1.05);
}

.drawer-body {
    flex: 1;
    overflow-y: auto;
    padding: 1.5rem;
    background: var(--bg-primary);
}

.wish-filter {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}

.filter-btn {
    flex: 1;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    padding: 0.5rem;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s;
    font-size: 0.9rem;
}

.filter-btn.active {
    background: var(--color-primary);
    color: var(--bg-primary);
    border-color: var(--color-primary);
}

.wish-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

/* Modal - business website style */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 2000;
    display: none;
    align-items: center;
    justify-content: center;
    isolation: isolate;
}

.modal.active {
    display: flex;
}

.modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--bg-overlay);
    backdrop-filter: blur(8px);
    transition: opacity 0.3s ease;
}

.modal-content {
    position: relative;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    width: 90%;
    max-width: 400px;
    box-shadow: var(--shadow-xl);
    animation: modalSlideIn 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-20px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.modal-header {
    padding: 1.75rem 1.5rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--gradient-bg);
    border-radius: 16px 16px 0 0;
}

.modal-header h2 {
    font-family: 'Noto Sans', sans-serif;
    font-size: 1.3rem;
    font-weight: 600;
    background: linear-gradient(90deg, #4169E1 0%, #FF6B35 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    letter-spacing: -0.02em;
    margin: 0;
}

.modal-close {
    background: var(--bg-tertiary);
    border: none;
    color: var(--text-secondary);
    font-size: 1.5rem;
    cursor: pointer;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    transition: all 0.2s;
    line-height: 1;
}

.modal-close:hover {
    background: var(--border-color);
    color: var(--text-primary);
    transform: scale(1.05);
}

.modal-body {
    padding: 1.5rem;
    background: var(--bg-primary);
}

.auth-form {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.form-group {
    display: flex;
    flex-direction: column;
}

.form-group label {
    color: var(--text-primary);
    font-size: 0.875rem;
    font-weight: 500;
}

.form-input {
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 0.75rem 1rem;
    color: var(--text-primary);
    font-size: 1rem;
    font-family: inherit;
    transition: all 0.2s;
}

.form-input:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: var(--shadow-glow);
}

.form-input::placeholder {
    color: var(--text-tertiary);
}

.btn-block {
    width: 100%;
}

/* Loading animation */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--bg-overlay-dark);
    backdrop-filter: blur(4px);
    z-index: 3000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.loading-content {
    text-align: center;
}

.loading-spinner {
    width: 60px;
    height: 60px;
    border: 4px solid var(--border-color);
    border-top-color: var(--color-primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 1rem;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.loading-text {
    color: var(--text-white);
    font-size: 1rem;
    font-weight: 500;
}

/* Check-in animation */
.checkin-animation {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 2500;
    pointer-events: none;
}

.incense-stick {
    width: 8px;
    height: 100px;
    background: linear-gradient(to bottom, #8B4513, #654321);
    margin: 0 auto;
    position: relative;
    animation: incenseBurn 2s ease-out;
}

.incense-stick::before {
    content: '';
    position: absolute;
    top: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 20px;
    height: 20px;
    background: radial-gradient(circle, #ff6b35, #ff8c42);
    border-radius: 50%;
    animation: flame 0.5s ease-in-out infinite alternate;
}

@keyframes flame {
    0% { transform: translateX(-50%) scale(1); }
    100% { transform: translateX(-50%) scale(1.2); }
}

.smoke {
    position: absolute;
    top: -30px;
    left: 50%;
    transform: translateX(-50%);
    width: 4px;
    height: 4px;
    background: rgba(255, 255, 255, 0.6);
    border-radius: 50%;
    animation: smokeRise 2s ease-out;
}

.smoke::before,
.smoke::after {
    content: '';
    position: absolute;
    width: 6px;
    height: 6px;
    background: rgba(255, 255, 255, 0.4);
    border-radius: 50%;
    animation: smokeRise 2s ease-out 0.2s;
}

.smoke::before {
    left: -10px;
}

.smoke::after {
    left: 10px;
}

@keyframes smokeRise {
    0% {
        opacity: 1;
        transform: translateX(-50%) translateY(0) scale(1);
    }
    100% {
        opacity: 0;
        transform: translateX(-50%) translateY(-100px) scale(2);
    }
}

@keyframes incenseBurn {
    0% {
        opacity: 0;
        transform: scale(0.5);
    }
    50% {
        opacity: 1;
        transform: scale(1);
    }
    100% {
        opacity: 0;
        transform: scale(0.5);
    }
}

/* Animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Responsive design */
@media (max-width: 768px) {
    .main-content {
        padding: 1rem;
    }

    .section-title {
        font-size: 1.5rem;
    }

    .wish-card {
        padding: 1.5rem;
    }

    .main-content {
        padding: 0;
    }
    
    .wish-section {
        padding: 0 0.75rem 1.125rem;
    }
    
    .active-wishes-section {
        padding: 1.5rem 1rem 0;
    }

    .success-list {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.75rem;
    }
    
    .success-item {
        padding: 1rem;
    }
    
    .active-wish-item {
        padding: 1.25rem;
        padding-right: 150px;
        min-height: 150px;
        background-size: auto, auto 150px !important;
    }
    
    .active-wish-content-wrapper {
        max-width: calc(100% - 150px);
    }

    .drawer-content {
        width: 100%;
    }

    .user-stats {
        font-size: 0.75rem;
        gap: 0.5rem;
    }
}

@media (max-width: 480px) {
    .header-content {
        flex-wrap: wrap;
        gap: 0.5rem;
    }

    .logo {
        font-size: 1.2rem;
    }

    .user-stats {
        order: 3;
        width: 100%;
        justify-content: space-around;
    }
}

/* Toast notification */
.toast-container {
    position: fixed;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    width: min(420px, 90vw);
    z-index: 10000;
    pointer-events: none;
}

.toast {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.9rem 1.5rem;
    border-radius: 999px;
    background: var(--bg-overlay-dark);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
    color: var(--text-white);
    backdrop-filter: blur(10px);
    opacity: 0;
    transform: translateY(20px);
    transition: transform 0.3s ease, opacity 0.3s ease;
    z-index: 10000;
    position: relative;
}

.toast.show {
    opacity: 1;
    transform: translateY(0);
}

.toast-icon {
    font-size: 1.1rem;
}

.toast-message {
    flex: 1;
    font-size: 0.95rem;
}

.toast-success {
    border-color: rgba(6, 214, 160, 0.4);
    box-shadow: 0 10px 30px rgba(6, 214, 160, 0.25);
}

.toast-error {
    border-color: rgba(255, 99, 99, 0.5);
    box-shadow: 0 10px 30px rgba(255, 99, 99, 0.25);
}

.toast-warning {
    border-color: rgba(255, 215, 0, 0.5);
    box-shadow: 0 10px 30px rgba(255, 215, 0, 0.25);
}

.toast-info {
    border-color: rgba(108, 193, 255, 0.4);
    box-shadow: 0 10px 30px rgba(108, 193, 255, 0.25);
}

/* Confirm dialog */
/* Confirm dialog - business website style */
.confirm-dialog {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2100;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.confirm-dialog.active {
    opacity: 1;
    pointer-events: auto;
}

.confirm-overlay {
    position: absolute;
    inset: 0;
    background: var(--bg-overlay);
    backdrop-filter: blur(8px);
    transition: opacity 0.3s ease;
}

.confirm-card {
    position: relative;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 2rem;
    width: min(380px, 90vw);
    box-shadow: var(--shadow-xl);
    transform: translateY(20px) scale(0.95);
    opacity: 0;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.3s ease;
    z-index: 1;
}

.confirm-dialog.active .confirm-card {
    transform: translateY(0) scale(1);
    opacity: 1;
}

.confirm-icon {
    font-size: 2.5rem;
    text-align: center;
    margin-bottom: 0.75rem;
}

.confirm-message {
    color: var(--text-primary);
    text-align: center;
    font-size: 1rem;
    line-height: 1.6;
    margin-bottom: 1.5rem;
    font-weight: 500;
}

.confirm-actions {
    display: flex;
    justify-content: center;
    gap: 0.75rem;
}

.confirm-actions .btn-primary {
    width: auto;
    min-width: 120px;
    border-radius: 12px;
    background: var(--gradient-primary);
    border: none;
    color: var(--text-white);
    font-weight: 600;
}

.confirm-actions .btn-primary:hover {
    box-shadow: var(--shadow-primary);
    transform: translateY(-1px);
}

.confirm-actions .btn-outline {
    background: var(--bg-primary);
    border-color: var(--border-color);
    color: var(--text-secondary);
}

.confirm-actions .btn-outline:hover {
    border-color: var(--border-color-light);
    color: var(--text-primary);
    background: var(--bg-secondary);
}

/* Wish card modal */
.wish-card-modal {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2200;
    opacity: 0;
    pointer-events: none;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.wish-card-modal.active {
    opacity: 1;
    pointer-events: auto;
}

.wish-card-overlay {
    position: absolute;
    inset: 0;
    background: var(--bg-overlay-dark);
    backdrop-filter: blur(8px);
    transition: opacity 0.3s ease;
}

.wish-card-container {
    position: relative;
    z-index: 1;
    width: min(500px, 90vw);
    max-height: 90vh;
    transform: translateY(20px) scale(0.95);
    opacity: 0;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.3s ease;
    margin: auto;
    padding: 1rem;
    box-sizing: border-box;
}

.wish-card-modal.active .wish-card-container {
    transform: translateY(0) scale(1);
    opacity: 1;
}

.wish-card-modal .wish-card {
    position: relative;
    background: var(--bg-primary);
    border-radius: 20px;
    overflow: hidden;
    box-shadow: var(--shadow-xl);
    width: 100%;
    min-height: 300px; /* Reduce minimum height, let content determine actual height */
    display: flex;
    flex-direction: column;
    height: auto;
    padding: 0;
}

.wish-card-close-btn {
    position: absolute;
    top: 1rem;
    right: 1rem;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: transparent;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 10;
    transition: all 0.3s ease;
    color: var(--text-primary);
    font-size: 1.5rem;
    font-weight: 300;
    line-height: 1;
    padding: 0;
}

.wish-card-close-btn:hover {
    transform: scale(1.1);
    color: var(--color-red);
}

.wish-card-background {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    height: 100%;
    background-size: 100% auto;
    background-position: center top;
    background-repeat: no-repeat;
    opacity: 0.3;
    z-index: 0;
}

.wish-card-background::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(to bottom, transparent 0%, rgba(255, 255, 255, 0.1) 50%, rgba(255, 255, 255, 0.8) 100%);
}

.wish-card-content {
    position: relative; /* Change to relative positioning, let content expand height */
    z-index: 1;
    padding: 2.5rem 2.5rem 1.5rem;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    gap: 1.5rem;
    min-height: auto; /* Remove fixed minimum height, let content decide */
    max-height: 70vh;
    overflow-y: auto; /* Show scrollbar when content overflows */
    overflow-x: hidden; /* Hide horizontal scrollbar */
}

.wish-card-time {
    font-size: 0.9rem;
    color: var(--text-secondary);
    font-weight: 500;
    opacity: 0.8;
    letter-spacing: 0.5px;
}

.wish-card-text {
    font-size: 1.4rem;
    color: var(--text-primary);
    line-height: 3.5rem; /* Increase line height, make spacing between text and lines larger */
    font-weight: 400; /* Handwritten fonts usually don't need to be too bold */
    flex: 1;
    word-break: break-word;
    letter-spacing: 0.5px; /* Handwritten style slightly increase letter spacing */
    /* Handwritten style font */
    font-family: 'Patrick Hand', 'Segoe UI', 'Helvetica', Arial, sans-serif;
    /* Add horizontal line effect - each line of text corresponds to a horizontal line, line at bottom of each line */
    background-image: repeating-linear-gradient(
        transparent,
        transparent calc(3.5rem - 1px),
        rgba(200, 200, 200, 0.5) calc(3.5rem - 1px),
        rgba(200, 200, 200, 0.5) 3.5rem
    );
    background-position: 0 0; /* Start from top */
    padding-top: 0.5rem; /* Top padding, let first line of text be above line */
    padding-bottom: 3.5rem; /* Bottom padding, leave space for signature, ensure signature is above line */
    min-height: auto; /* Remove fixed minimum height, let content determine height */
    position: relative; /* Prepare for signature positioning */
    display: flex;
    flex-direction: column;
}

/* Wish text content */
.wish-card-text-content {
    flex: 1;
    font-size: inherit;
    color: inherit;
    line-height: inherit;
    font-weight: inherit;
    letter-spacing: inherit;
    font-family: inherit;
    word-break: break-word;
}

/* Wish maker signature - bottom right corner, above line */
.wish-card-signature {
    margin-top: auto;
    text-align: right;
    padding-top: 0; /* Remove top padding, align signature directly to the line */
    padding-right: 0.5rem;
    position: relative;
    z-index: 1; /* Ensure signature is above the line */
}

.wish-card-name {
    font-size: 1.2rem;
    color: var(--text-primary);
    font-weight: 400;
    letter-spacing: 1px;
    line-height: 3.5rem; /* Use same line height as text, ensure signature is on the line */
    /* Handwritten style font */
    font-family: 'Patrick Hand', 'Segoe UI', 'Helvetica', Arial, sans-serif;
}

.wish-card-actions {
    position: relative;
    z-index: 2;
    padding: 1.5rem 2rem 2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-shrink: 0;
}

.wish-card-action-btn {
    flex: 1;
    padding: 0.875rem 1.5rem;
    border-radius: 12px;
    font-weight: 600;
    font-size: 1rem;
    transition: all 0.3s ease;
    cursor: pointer;
}

.wish-card-action-btn.btn-primary {
    background: var(--gradient-primary);
    border: none;
    color: var(--text-white);
}

.wish-card-action-btn.btn-primary:hover {
    box-shadow: var(--shadow-primary);
    transform: translateY(-2px);
}

.wish-card-action-btn.btn-outline {
    background: var(--bg-primary);
    border: 2px solid var(--border-color);
    color: var(--text-primary);
}

.wish-card-action-btn.btn-outline:hover {
    border-color: var(--color-primary);
    color: var(--color-primary);
    background: var(--color-primary-lightest);
}

/* Wish card delivery information area */
.wish-card-delivery-info {
    position: relative;
    z-index: 2;
    padding: 1.5rem 2.5rem 0;
    flex-shrink: 0;
}

.delivery-info-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.delivery-info-step {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.delivery-info-step .form-group {
    flex-direction: row;
    align-items: flex-start;
}

.delivery-info-step .form-group:last-child {
    margin-bottom: 0;
}

.delivery-info-step .form-label {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 0;
    white-space: nowrap;
    margin-right: 0.5rem;
    padding-top: 0.75rem; /* Align with input field's padding-top */
    line-height: 1.5;
}

.delivery-input-wrapper {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
    max-width: 100%;
    width: 100%;
}

.delivery-info-step .delivery-input {
    width: 100%;
    max-width: 100%;
    padding: 0.75rem 1rem;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 0.9375rem;
    color: var(--text-primary);
    transition: all 0.2s ease;
    box-sizing: border-box;
    -webkit-appearance: none;
    appearance: none;
    min-width: 0;
}

.delivery-info-step .delivery-input:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.delivery-info-step .delivery-input.input-error {
    border-color: var(--color-red, #ef4444);
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1);
}

.delivery-info-step .delivery-input.input-error:focus {
    border-color: var(--color-red, #ef4444);
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1);
}

.delivery-info-step .form-error {
    display: none;
    font-size: 0.75rem;
    color: var(--color-red, #ef4444);
    margin-top: 0.25rem;
    line-height: 1.4;
}

.delivery-info-step .delivery-input::placeholder {
    color: var(--text-tertiary);
}

.delivery-info-step .form-hint {
    font-size: 0.75rem;
    color: var(--text-tertiary);
    margin-top: 0.25rem;
    margin-bottom: 0;
}

/* Responsive design - wish card */
@media (max-width: 768px) {
    .wish-card-modal {
        align-items: flex-start;
        padding-top: 2rem;
        padding-bottom: 2rem;
    }
    
    .wish-card-container {
        width: min(420px, 90vw);
        max-height: calc(100vh - 4rem);
        padding: 0.5rem;
    }
    
    .wish-card-content {
        padding: 2rem 2rem 1.5rem;
        gap: 1.25rem;
    }
    
    .wish-card-text {
        font-size: 1.25rem;
        line-height: 3.0rem; /* Increase line height, make spacing between text and lines larger */
        background-image: repeating-linear-gradient(
            transparent,
            transparent calc(3.0rem - 1px),
            rgba(200, 200, 200, 0.5) calc(3.0rem - 1px),
            rgba(200, 200, 200, 0.5) 3.0rem
        );
        padding-bottom: 3.0rem; /* Leave space for signature */
    }
    
    .wish-card-name {
        font-size: 1.1rem;
        line-height: 3.0rem; /* Use same line height as text, ensure signature is on line */
    }
    
    .wish-card-time {
        font-size: 0.85rem;
    }
    
    .wish-card-actions {
        padding: 1rem 1.5rem 1.5rem;
        flex-direction: column;
        align-items: stretch;
    }
    
    .wish-card-action-btn {
        width: 100%;
    }
    
    .wish-card-delivery-info {
        padding: 1.25rem 2rem;
    }
}

@media (max-width: 480px) {
    .wish-card-modal {
        padding-top: 1rem;
        padding-bottom: 1rem;
    }
    
    .wish-card-container {
        width: 95vw;
        max-height: calc(100vh - 2rem);
        padding: 0.5rem;
    }
    
    .wish-card {
        min-height: 250px; /* Reduce minimum height, let content determine actual height */
    }
    
    .wish-card-content {
        padding: 3.5rem 1.5rem 1.5rem;
        gap: 1rem;
    }
    
    .wish-card-text {
        font-size: 1.15rem;
        line-height: 2.7rem; /* Increase line height, make spacing between text and lines larger */
        background-image: repeating-linear-gradient(
            transparent,
            transparent calc(2.7rem - 1px),
            rgba(200, 200, 200, 0.5) calc(2.7rem - 1px),
            rgba(200, 200, 200, 0.5) 2.7rem
        );
        padding-bottom: 2.7rem; /* Leave space for signature */
    }
    
    .wish-card-time {
        font-size: 0.8rem;
    }
    
    .wish-card-name {
        font-size: 1rem;
        line-height: 2.7rem; /* Use same line height as text, ensure signature is on the line */
    }
    
    .wish-card-close-btn {
        width: 36px;
        height: 36px;
        top: 0.75rem;
        right: 0.75rem;
        font-size: 1.3rem;
    }
    
    .wish-card-delivery-info {
        padding: 1rem 1.5rem;
    }
    
    .delivery-input-wrapper {
        max-width: 100%;
        width: 100%;
        min-width: 0;
    }
    
    .delivery-info-step .delivery-input {
        font-size: 0.875rem;
        padding: 0.625rem 0.875rem;
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
        min-width: 0;
    }
}
