/* ===== CSS Reset & Base Styles ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    /* Colors */
    --color-white: #ffffff;
    --color-black: #030303;
    --color-text: #333333;
    --color-pink: #ff95f3;
    --color-bg-light: #f1f1f1;
    
    /* Spacing */
    --spacing-xs: 8px;
    --spacing-sm: 12px;
    --spacing-md: 16px;
    --spacing-lg: 20px;
    --spacing-xl: 24px;
    
    /* Border Radius */
    --radius-sm: 8px;
    --radius-md: 20px;
    --radius-lg: 22px;
    
    /* Shadows */
    --shadow-soft: 2px -2px 8px 0px rgba(0, 0, 0, 0.1);
}

body {
    font-family: 'Noto Sans JP', sans-serif;
    background-color: var(--color-white);
    color: var(--color-text);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
}

/* ===== Container ===== */
.container {
    max-width: 393px;
    min-height: 100vh;
    margin: 0 auto;
    position: relative;
    background-color: var(--color-white);
    padding-bottom: 180px; /* Space for fixed CTA */
}

/* ===== Header ===== */
.header {
    /* 减小上下边距 (32px/24px -> 12px/8px) */
    padding: 4px var(--spacing-lg) 4px;
    text-align: center;
    background-color: var(--color-white);
    position: relative; /* 取消固定定位 (sticky -> relative) */
    z-index: 100;
}

.logo {
    display: inline-block;
    /* 垂直居中 */
    line-height: 0;
}

.logo-image {
    height: 30px; /* 设置高度，宽度自动 */
    width: auto;
    display: block;
}

/* ===== Main Content ===== */
.main-content {
    padding: 0 var(--spacing-lg);
}

/* ===== Hero Section ===== */
.hero-section {
    margin-bottom: var(--spacing-xl);
    /* 恢复默认 margin-top，因为 Header 已经占位了 */
    padding-bottom: 12px; /* 增加底部内边距，拉开与 Logo 的距离 */
}

.phone-mockup {
    position: relative;
    width: 100%;
    max-width: 353px;
    margin: 0 auto;
    /* 允许高度自动适应图片 */
    height: auto; 
    display: flex;
    justify-content: center;
}

.phone-composite-image {
    width: 100%;
    height: auto;
    object-fit: contain;
    /* 移除阴影滤镜，避免双重阴影或不需要的背景效果 */
    /* filter: drop-shadow(0 10px 30px rgba(0, 0, 0, 0.15)); */
    display: block;
}

/* ===== Title Section ===== */
.title-section {
    margin-bottom: var(--spacing-lg);
    /* 移除 center 居中，改为默认左对齐，或者显式 left */
    text-align: left; 
    /* 如果你想让标题本身还是居中，而正文左对齐，可以分开设置 */
    /* 但为了和下方小标题对齐，整体左对齐可能更自然 */
    padding: 0 var(--spacing-xs); /* 增加一点内边距，和 features-section 保持一致 */
}

.app-title {
    /* 移除字体相关设置，保留间距和对齐 */
    margin-bottom: var(--spacing-sm);
    text-align: center;
    line-height: 0; /* 防止图片底部有额外空隙 */
}

.title-logo-image {
    height: 36px; /* 设置合适的 Logo 高度 */
    width: auto;
    display: inline-block;
}

.app-intro {
    font-size: 14px;
    color: var(--color-text);
    line-height: 1.6;
    text-align: left;
}

/* ===== Features Section ===== */
.features-section {
    margin-bottom: var(--spacing-xl);
    padding: 0 var(--spacing-xs);
}

.feature {
    margin-bottom: var(--spacing-xl);
}

.feature-title {
    font-size: 18px; /* 16px -> 18px */
    font-weight: 700;
    color: var(--color-pink); /* var(--color-text) -> var(--color-pink) */
    margin-bottom: var(--spacing-sm);
    display: flex;
    align-items: center;
    gap: 8px;
}

.feature-text {
    font-size: 14px;
    font-weight: 400;
    color: var(--color-text);
    line-height: 1.6;
    margin-bottom: var(--spacing-sm);
}

.feature-list {
    list-style: none;
    padding-left: 4px;
    margin-bottom: var(--spacing-sm);
}

.feature-list li {
    position: relative;
    padding-left: 18px;
    margin-bottom: 6px;
    font-size: 14px;
    color: var(--color-text);
    line-height: 1.5;
}

.feature-list li::before {
    content: "•";
    position: absolute;
    left: 4px;
    color: var(--color-pink);
    font-weight: bold;
}

/* ===== CTA Section (Fixed at Bottom) ===== */
.cta-section {
    position: fixed;
    /* 改用 top 定位，相对于屏幕顶部固定 */
    /* 100vh 是屏幕总高度，减去 160px 就是它应该在的位置 */
    /* 这样键盘弹起时，top 值不变，它就不会被顶上去 */
    top: calc(100vh - 160px);
    bottom: auto; 
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: 393px;
    height: 160px;
    z-index: 200;
}

.chat-bubble {
    position: absolute;
    left: 93px;
    top: 0;
    width: 280px;
    /* 固定气泡高度，防止随容器拉伸 (100% -> 130px) */
    height: 130px;
    z-index: 1;
}

.chat-bg {
    width: 100%;
    /* 强制背景图填满高度 */
    height: 100%; 
    display: block;
}

.cta-content {
    position: absolute;
    /* 调整水平位置：再向左移 (100px -> 95px) */
    left: 108px; 
    
    /* 调整垂直位置：再上移 (10px -> 6px) */
    top: 15px;   
    
    /* 保持宽度和高度 */
    width: 266px; 
    height: 100px; 
    
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 0 16px;
    
    z-index: 2;
}

.prompt-text {
    font-size: 14px;
    font-weight: 500;
    color: var(--color-pink);
    line-height: 1.4;
    text-align: center;
    margin-bottom: 12px;
}

.submit-btn {
    /* 修改宽度逻辑，与输入框对齐 */
    width: 100%; 
    max-width: 220px; /* 限制最大宽度 */
    height: 32px; /* 稍微增加高度增加点击区域 */
    padding: 0 16px;
    background-color: var(--color-black);
    color: var(--color-white);
    border: none;
    border-radius: var(--radius-lg);
    font-family: 'Noto Sans JP', sans-serif;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.submit-btn:hover {
    background-color: #1a1a1a;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.submit-btn:active {
    transform: translateY(0);
}

.submit-btn:disabled {
    background-color: #ccc;
    cursor: not-allowed;
    transform: none;
}

/* ===== Email Modal ===== */
.email-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10000;
    display: flex;
    align-items: center; /* 居中对齐 */
    justify-content: center;
}

.email-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    /* 遮罩层淡入动画 */
    animation: fadeIn 0.25s ease;
}

.email-modal-content {
    position: relative;
    background-color: white;
    /* 四周圆角 */
    border-radius: 20px;
    padding: 32px 24px;
    width: 90%;
    max-width: 400px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    /* 从底部向上滑到中间，使用 transform 性能更好 */
    animation: slideUpToCenter 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1;
    /* 使用 GPU 加速 */
    will-change: transform;
    transform: translateZ(0);
}

.email-modal-close {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 32px;
    height: 32px;
    border: none;
    background-color: transparent;
    color: #999;
    font-size: 28px;
    line-height: 1;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.email-modal-close:hover {
    color: #333;
    transform: rotate(90deg);
}

.email-modal-title {
    font-size: 18px;
    font-weight: 700;
    color: var(--color-text);
    text-align: center;
    margin-bottom: 24px;
}

.email-modal-input {
    width: 100%;
    height: 48px;
    padding: 0 16px;
    background-color: #f1f1f1;
    border: 2px solid transparent;
    border-radius: 12px;
    font-family: 'Noto Sans JP', sans-serif;
    font-size: 15px;
    font-weight: 500;
    color: var(--color-text);
    text-align: left;
    outline: none;
    transition: all 0.2s ease;
    margin-bottom: 16px;
}

.email-modal-input:focus {
    background-color: white;
    border-color: var(--color-pink);
}

.email-modal-submit {
    width: 100%;
    height: 48px;
    padding: 0 16px;
    background-color: var(--color-black);
    color: var(--color-white);
    border: none;
    border-radius: 12px;
    font-family: 'Noto Sans JP', sans-serif;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.email-modal-submit:hover {
    background-color: #1a1a1a;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.email-modal-submit:active {
    transform: translateY(0);
}

.email-modal-submit:disabled {
    background-color: #ccc;
    cursor: not-allowed;
    transform: none;
}

/* ===== Toast Notification ===== */
.toast-notification {
    position: fixed;
    top: 80px; /* 调整到屏幕上方，但在Header下方一点 */
    left: 50%;
    transform: translateX(-50%);
    background-color: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    z-index: 20000; /* 必须比Modal的10000高 */
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    text-align: center;
    max-width: 80%;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.toast-notification.show {
    opacity: 1;
    visibility: visible;
}

/* Success message (keep if needed for inline success, or use toast too) */
.success-message {
    text-align: center;
    padding: var(--spacing-sm);
    border-radius: var(--radius-sm);
    margin-top: var(--spacing-sm);
    animation: slideDown 0.3s ease;
    background-color: #e8f5e9;
    color: #2e7d32;
}

.success-message p {
    font-size: 14px;
    font-weight: 500;
}

/* Error message (Removed inline style, now using toast) */
.error-message {
    display: none; /* Hide inline error container */
}

/* ===== Mascot ===== */
.mascot {
    position: absolute;
    left: 0;
    /* 改用 top 定位，从容器顶部计算：160px(容器高) - 77px(吉祥物高) = 83px */
    top: 83px;
    width: 82px;
    height: 77px;
    z-index: 3;
    filter: drop-shadow(var(--shadow-soft));
    /* 关键：恢复裁剪，隐藏超出容器的部分 */
    overflow: hidden; 
}

.mascot-image {
    position: absolute;
    /* 关键：顶部和右侧对齐，这样溢出的左边和底边会被裁剪 */
    top: 0;
    right: 0;
    bottom: auto;
    left: auto;
    
    width: 97px !important;
    height: 85px !important;
    display: block;
    object-fit: contain;
    transform: none !important;
}

/* ===== Animations ===== */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

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

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideUpFromBottom {
    from {
        transform: translateY(100%) translateZ(0);
    }
    to {
        transform: translateY(0) translateZ(0);
    }
}

@keyframes slideUpToCenter {
    from {
        /* 从屏幕底部外开始 */
        transform: translateY(calc(50vh + 50%)) translateZ(0);
    }
    to {
        /* 最终停在屏幕中央 */
        transform: translateY(0) translateZ(0);
    }
}

/* ===== Responsive Design ===== */
@media (max-width: 393px) {
    .container {
        max-width: 100%;
    }
    
    .cta-section {
        max-width: 100%;
    }
}

@media (min-width: 394px) {
    .container {
        border-left: 1px solid #eee;
        border-right: 1px solid #eee;
    }
}

/* For larger screens */
@media (min-width: 768px) {
    body {
        background-color: #f5f5f5;
    }
    
    .container {
        box-shadow: 0 0 30px rgba(0, 0, 0, 0.1);
    }
}
