/* --- Variables or Design System --- */
:root {
    --gold: #D4AF37;
    --gold-dim: #b39023;
    --dark: #121212; /* Material Dark Background */
    --dark-card: #1E1E1E;
    --grey-text: #AAAAAA;
    --white: #FFFFFF;
    --nav-height: 44px;
    --tab-height: 56px;
    --safe-area-bottom: env(safe-area-inset-bottom, 20px);
    --tesla-blue: #3E6AE1;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

body {
    margin: 0;
    padding: 0;
    font-family: "Gotham", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; /* Tesla uses Gotham roughly */
    background-color: var(--dark);
    color: var(--white);
    -webkit-font-smoothing: antialiased;
    overflow: hidden; 
    user-select: none;
    -webkit-user-select: none;
}

#app {
    width: 100%;
    height: 100vh;
    max-width: 480px; 
    margin: 0 auto;
    position: relative;
    background: var(--dark);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* --- Layout Containers --- */
.page-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow-y: auto;
    overflow-x: hidden;
    background: var(--dark);
    padding-bottom: calc(var(--tab-height) + var(--safe-area-bottom)); 
    display: flex;
    flex-direction: column;
}

.page-container.no-tabbar {
    padding-bottom: var(--safe-area-bottom);
}

.page-container.fullscreen {
    padding-bottom: 0;
    z-index: 100;
}

/* --- Tesla Style Home Snap Scrolling --- */
.home-snap-container {
    padding-bottom: 0 !important; /* No padding for full screen */
    scroll-snap-type: y mandatory;
    scroll-behavior: smooth;
    height: 100%;
    overflow-y: auto;
}

.home-section {
    position: relative;
    width: 100%;
    height: 100vh; /* Full Viewport Height */
    scroll-snap-align: start;
    scroll-snap-stop: always;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: center;
    padding: 120px 24px 100px 24px;
}

/* Overlay for dimming background images slightly */
.home-section::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.3);
    z-index: 0;
    pointer-events: none;
    background: linear-gradient(to bottom, rgba(0,0,0,0.4) 0%, rgba(0,0,0,0.1) 40%, rgba(0,0,0,0.4) 100%);
}

.home-content {
    position: relative;
    z-index: 10;
    text-align: center;
    margin-top: 60px;
    animation: fadeUp 1s ease-out;
}
@keyframes fadeUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.main-title {
    font-size: 30px;
    font-weight: 700;
    margin: 0 0 8px 0;
    letter-spacing: 1px;
    text-shadow: 0 2px 10px rgba(0,0,0,0.5);
}

.sub-title {
    font-size: 16px;
    margin: 0;
    opacity: 0.9;
    font-weight: 500;
    text-shadow: 0 1px 4px rgba(0,0,0,0.5);
}

.section-title {
    font-size: 32px;
    font-weight: 600;
    margin: 0 0 12px 0;
    text-shadow: 0 2px 10px rgba(0,0,0,0.5);
}

.section-desc {
    font-size: 15px;
    opacity: 0.9;
    max-width: 300px;
    margin: 0 auto;
    line-height: 1.5;
    text-shadow: 0 1px 4px rgba(0,0,0,0.5);
}

.home-actions {
    position: relative;
    z-index: 10;
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 40px;
    animation: fadeIn 1.2s ease-out;
}
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.home-actions.two-row {
    flex-direction: row;
}

/* Tesla Buttons */
.tesla-btn {
    width: 100%;
    padding: 14px 0;
    border-radius: 4px; 
    font-size: 14px;
    font-weight: 600;
    border: none;
    cursor: pointer;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    backdrop-filter: blur(4px);
    transition: all 0.2s;
}
.tesla-btn:active {
    transform: scale(0.98);
}

.tesla-btn.primary {
    background: #fff;
    color: #000;
}

.tesla-btn.secondary {
    background: rgba(0, 0, 0, 0.6);
    color: #fff;
    backdrop-filter: blur(8px);
}

.tesla-btn.dark-blur {
    background: rgba(23, 26, 32, 0.8);
    color: #fff;
}

/* Home Header */
.home-fixed-header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 60px;
    z-index: 100;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 24px;
    /* background: linear-gradient(to bottom, rgba(0,0,0,0.6), transparent); */
}
.brand-logo {
    font-weight: 700;
    font-size: 18px;
    letter-spacing: 2px;
    text-shadow: 0 1px 4px rgba(0,0,0,0.5);
}
.brand-menu {
    font-size: 20px;
    text-shadow: 0 1px 4px rgba(0,0,0,0.5);
    cursor: pointer;
}

/* Badges */
.feature-badges {
    display: flex;
    gap: 12px;
    justify-content: center;
    margin-top: 16px;
}
.feature-badges span {
    background: rgba(255,255,255,0.15);
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    backdrop-filter: blur(4px);
}

.home-footer-legal {
    position: absolute;
    bottom: 10px;
    width: 100%;
    text-align: center;
    font-size: 10px;
    color: rgba(255,255,255,0.6);
    z-index: 10;
}

/* --- Components: TabBar --- */
.tab-bar {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: calc(var(--tab-height) + var(--safe-area-bottom));
    background: rgba(30, 30, 30, 0.95);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-top: 0.5px solid rgba(255,255,255,0.1);
    display: flex;
    padding-bottom: var(--safe-area-bottom);
    z-index: 50;
}

.tab-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: var(--grey-text);
    font-size: 10px;
    gap: 4px;
    cursor: pointer;
}

.tab-item.active {
    color: var(--gold);
}

.tab-icon {
    width: 24px;
    height: 24px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

/* --- Components: NavBar --- */
.nav-bar {
    height: var(--nav-height);
    min-height: var(--nav-height);
    display: flex;
    align-items: center;
    justify-content: center;
    position: sticky;
    top: 0;
    background: var(--dark);
    z-index: 40;
    padding: 0 16px;
    border-bottom: 0.5px solid rgba(255,255,255,0.05);
    transition: all 0.3s;
}

/* Transparent NavBar Mode */
.nav-bar.nav-transparent {
    background: transparent;
    border-bottom: none;
    position: fixed; /* Overlay on top */
    width: 100%;
}
.nav-back-btn {
    background: none;
    border: none;
    padding: 8px;
    margin-left: -8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--gold);
}
.nav-back-btn.light-icon {
    color: #fff;
}

.nav-left, .nav-right {
    position: absolute;
    top: 0;
    height: 100%;
    display: flex;
    align-items: center;
    padding: 0 16px;
}
.nav-left { left: 0; }
.nav-right { right: 0; }

.nav-title {
    font-weight: 600;
    font-size: 17px;
}

/* --- Shared UI Elements --- */
.btn {
    border: none;
    padding: 14px 0;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    text-align: center;
    cursor: pointer;
    width: 100%;
    transition: transform 0.1s;
}
.btn:active { transform: scale(0.98); }

.btn-primary {
    background: linear-gradient(135deg, var(--gold), #B8860B);
    color: #000;
    box-shadow: 0 4px 12px rgba(212, 175, 55, 0.2);
}
.btn-outline {
    background: transparent;
    border: 1px solid var(--grey-text);
    color: var(--white);
}

.card {
    background: var(--dark-card);
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 16px;
}

/* --- Photo Grid --- */
.photo-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
}
.photo-slot {
    aspect-ratio: 1;
    background: #1A1A1A;
    border: 1px dashed #333;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    cursor: pointer;
}
.photo-slot.filled { border: none; background: #000; }

/* --- Transitions (App-like Route Slide) --- */
/* Slide Left (Push) */
.slide-left-enter-active, .slide-left-leave-active,
.slide-right-enter-active, .slide-right-leave-active {
    transition: all 0.35s cubic-bezier(0.165, 0.84, 0.44, 1);
}

.slide-left-enter-from { transform: translateX(100%); box-shadow: -5px 0 25px rgba(0,0,0,0.5); }
.slide-left-leave-to { transform: translateX(-30%); opacity: 0.8; filter: brightness(0.8); }

/* Slide Right (Pop/Back) */
.slide-right-enter-from { transform: translateX(-30%); opacity: 0.8; filter: brightness(0.8); }
.slide-right-leave-to { transform: translateX(100%); z-index: 101; box-shadow: -5px 0 25px rgba(0,0,0,0.5); }

/* Fade for tabs */
.fade-enter-active, .fade-leave-active { transition: opacity 0.2s ease; }
.fade-enter-from, .fade-leave-to { opacity: 0; }

/* Wrapper for transitions to work with absolute positioning */
.view-wrapper {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
}

/* --- Specific Views (Common) --- */
/* Hero Section */
.hero-video-container {
    height: 360px;
    width: 100%;
    position: relative;
    border-radius: 0 0 24px 24px;
    overflow: hidden;
    margin-bottom: 24px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.6);
}
.hero-video-placeholder {
    width: 100%; height: 100%; object-fit: cover;
}

/* Modal */
.modal-mask {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.6);
    z-index: 200;
    display: flex;
    justify-content: center;
    align-items: flex-end;
}
.modal-sheet {
    width: 100%;
    max-width: 480px;
    background: #242424;
    border-radius: 20px 20px 0 0;
    padding: 24px;
    animation: slideUp 0.3s cubic-bezier(0.25, 1, 0.5, 1);
}
@keyframes slideUp { from { transform: translateY(100%); } to { transform: translateY(0); } }

.sku-option {
    display: flex; justify-content: space-between; align-items: center;
    padding: 16px;
    margin-bottom: 12px;
    border: 1px solid #333;
    border-radius: 12px;
    background: #2A2A2A;
    transition: all 0.2s;
}
.sku-option.selected {
    border-color: var(--gold);
    background: rgba(212, 175, 55, 0.1);
}
.sku-info h4 { margin: 0 0 4px 0; font-size: 16px; }
.sku-info p { margin: 0; font-size: 12px; color: var(--grey-text); }
.sku-price { font-size: 18px; font-weight: bold; color: var(--gold); }

.coupon-input-wrap {
    display: flex;
    background: #111;
    border-radius: 8px;
    padding: 4px;
    margin: 20px 0;
    border: 1px solid #333;
}
.coupon-input {
    flex: 1;
    background: transparent;
    border: none;
    color: #fff;
    padding: 0 12px;
    outline: none;
}
.coupon-btn {
    background: #333;
    color: #fff;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
}

/* Memorial Detail Styles */
.anti-download-layer {
    position: absolute; top:0; left:0; width:100%; height:100%;
    z-index: 10;
    background: transparent;
}
.tribute-btn {
    background: rgba(255,255,255,0.1);
    border: none;
    border-radius: 8px;
    padding: 12px;
    color: #fff;
    display: flex;
    align-items: center;
    gap: 8px;
}
.comments-section {
    margin-top: 20px;
}
.comment-item {
    margin-bottom: 16px;
}

/* --- Typography Updates for Minimalist Feel --- */
h1, h2, h3 {
    letter-spacing: -0.5px;
}

/* --- Gallery View (Memorial List) --- */
.gallery-container {
    padding: 0 16px 20px 16px;
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.gallery-card {
    position: relative;
    width: 100%;
    height: 480px; /* Tall, immersive card */
    border-radius: 20px;
    overflow: hidden;
    /* Neumorphism or clean shadow */
    box-shadow: 0 20px 40px rgba(0,0,0,0.5);
    cursor: pointer;
    transition: transform 0.3s;
}

.gallery-card:active {
    transform: scale(0.98);
}

.gallery-bg {
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    transition: transform 0.5s;
}
.gallery-card:hover .gallery-bg {
    transform: scale(1.05);
}

.gallery-overlay {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    padding: 24px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    background: linear-gradient(to bottom, rgba(0,0,0,0.2), rgba(0,0,0,0) 30%, rgba(0,0,0,0.9) 100%);
}

.gallery-status {
    align-self: flex-start;
    background: rgba(255,255,255,0.2);
    backdrop-filter: blur(10px);
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.gallery-content {
    animation: fadeUp 0.5s ease-out;
}

.gallery-title {
    font-size: 28px;
    font-weight: 700;
    margin: 0 0 8px 0;
}

.gallery-desc {
    font-size: 14px;
    opacity: 0.8;
    margin: 0 0 16px 0;
    font-style: italic;
    font-family: serif;
}

.gallery-stats span {
    font-size: 12px;
    opacity: 0.9;
    color: var(--gold);
}

.gallery-add-btn {
    border: 1px dashed #333;
    color: #666;
    border-radius: 12px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    cursor: pointer;
}

/* --- Mine View Minimalist --- */
.tesla-stat-box {
    background: #1A1A1A;
    border-radius: 12px;
    padding: 20px;
    text-align: left;
}
.stat-num {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 4px;
    color: var(--white);
}
.stat-label {
    font-size: 12px;
    color: #666;
    text-transform: uppercase;
}

.tesla-menu-list {
    border-top: 1px solid #222;
}

.menu-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 0;
    border-bottom: 1px solid #222;
    font-size: 15px;
    color: #ddd;
    cursor: pointer;
}
.menu-item .arrow {
    color: #444;
}

/* --- Global Overrides for Less "Depressing" Dark Mode --- */
/* Slightly lighter dark background for better contrast and airiness */
#app, .page-container {
    background: #0d0d0d; /* Pitch black to Rich Black */
}

/* 蜡烛/花朵上浮动画 */
@keyframes float-up-fade {
    0% { transform: translateY(0) scale(0.5); opacity: 0; }
    10% { transform: translateY(-20px) scale(1.2); opacity: 1; }
    100% { transform: translateY(-150px) scale(1); opacity: 0; }
}

.floating-item {
    position: absolute;
    pointer-events: none;
    animation: float-up-fade 2s ease-out forwards;
    z-index: 9999;
    font-size: 32px;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.5));
}

/* 分享海报动画 */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}
@keyframes slideUp {
    from { transform: translateY(50px) scale(0.9); opacity: 0; }
    to { transform: translateY(0) scale(1); opacity: 1; }
}
