/* 给未来写信页面样式 */

        /* 未来信件页面优化样式 */
        .future-letter-page {
            background: linear-gradient(135deg, #fdfbfb 0%, #f0f4f8 100%);
            min-height: 100vh;
            padding: 0 0 2rem 0;
            font-family: 'Noto Sans SC', sans-serif;
        }
        
        .future-letter-page main {
            margin-top: 0;
        }
        
        .future-letter-page header {
            margin-bottom: 0;
        }
        
        .letter-header {
            text-align: center;
            margin: 0;
            padding: 3rem 1rem 2rem;
            background: rgba(255, 255, 255, 0.95);
            border-radius: 0;
            box-shadow: 0 2px 10px rgba(0,0,0,0.05);
        }
        
        .letter-header h1 {
            font-size: 2.2rem;
            color: #667eea;
            margin-bottom: 0.8rem;
            text-shadow: 1px 1px 2px rgba(0,0,0,0.05);
            font-weight: 700;
        }
        
        .letter-header p {
            color: #666;
            font-size: 1rem;
            margin-bottom: 0;
        }
        
        .letter-container {
            max-width: 1200px;
            margin: 2rem auto;
            padding: 0 1.5rem;
            display: grid;
            grid-template-columns: 1.1fr 0.9fr;
            gap: 2.5rem;
            align-items: start;
        }
        
        @media (max-width: 992px) {
            .letter-container {
                grid-template-columns: 1fr;
                margin: 1.5rem auto;
                gap: 1.5rem;
                padding: 0 1rem;
            }
        }
        
        .letter-form {
            background: white;
            padding: 2.5rem;
            border-radius: 12px;
            box-shadow: 0 6px 20px rgba(0,0,0,0.08);
            border: 1px solid #f0f0f0;
        }
        
        .letter-form-section {
            order: 1;
        }
        
        .letter-preview {
            order: 2;
        }
        
        @media (max-width: 992px) {
            .letter-form-section,
            .letter-preview {
                order: initial;
            }
        }
        
        .form-group {
            margin-bottom: 1.8rem;
        }
        
        .form-group label {
            display: block;
            margin-bottom: 0.6rem;
            color: #444;
            font-weight: 500;
            font-size: 0.95rem;
        }
        
        .form-group input,
        .form-group textarea {
            width: 100%;
            padding: 0.9rem 1.2rem;
            border: 1px solid #e1e5e9;
            border-radius: 8px;
            font-size: 1rem;
            transition: all 0.2s ease;
            background: white;
            box-sizing: border-box;
        }
        
        .form-group input:focus,
        .form-group textarea:focus {
            outline: none;
            border-color: #667eea;
            background: white;
            box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
        }
        
        .form-group textarea {
            resize: vertical;
            min-height: 180px;
            font-family: inherit;
            line-height: 1.6;
        }
        
        .form-actions {
            margin-top: 2.5rem;
            text-align: center;
        }
        
        /* 优化表单行布局 */
        .form-row {
            gap: 1.2rem !important;
        }
        
        /* 优化模板选择器 */
        .template-selector {
            gap: 0.8rem !important;
        }
        
        /* 优化按钮样式 */
        .btn {
            display: inline-block;
            padding: 0.9rem 2.5rem;
            border: none;
            border-radius: 28px;
            font-size: 1.05rem;
            font-weight: 500;
            cursor: pointer;
            transition: all 0.3s ease;
            text-decoration: none;
            display: inline-flex;
            align-items: center;
            gap: 0.5rem;
        }
        
        .btn-primary {
            background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
            color: white;
        }
        
        .btn-primary:hover {
            transform: translateY(-2px);
            box-shadow: 0 6px 16px rgba(102, 126, 234, 0.4);
        }
        
        /* 信件预览区域 */
        .letter-preview {
            background: linear-gradient(135deg, #fdfbfb 0%, #ebedee 100%);
            padding: 1.5rem;
            border-radius: 15px;
            box-shadow: 0 10px 30px rgba(0,0,0,0.1);
            position: relative;
        }
        
        .preview-header {
            text-align: center;
            margin-bottom: 2rem;
            padding-bottom: 1rem;
            border-bottom: 1px solid #e0e0e0;
        }
        
        .preview-header h3 {
            color: #667eea;
            font-size: 1.5rem;
            margin-bottom: 0.5rem;
        }
        
        .preview-date {
            color: #666;
            font-style: italic;
            font-size: 0.9rem;
        }
        
        /* 真实信件样式 */
        .preview-content {
            background: #fffef0;
            padding: 2.5rem 2rem 2rem;
            border-radius: 5px;
            min-height: 300px;
            box-shadow: 0 2px 10px rgba(0,0,0,0.05);
            position: relative;
            overflow: hidden;
            font-family: 'Noto Serif SC', serif;
        }
        
        /* 信纸纹理 */
        .preview-content::before {
            content: '';
            position: absolute;
            top: 0;
            left: 0;
            right: 0;
            bottom: 0;
            background-image: 
                repeating-linear-gradient(
                    transparent,
                    transparent 29px,
                    rgba(102, 126, 234, 0.1) 29px,
                    rgba(102, 126, 234, 0.1) 30px
                );
            pointer-events: none;
            z-index: 0;
        }
        
        /* 信封封口效果 */
        .preview-content::after {
            content: '';
            position: absolute;
            top: 0;
            left: 0;
            right: 0;
            height: 30px;
            background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
            opacity: 0.1;
        }
        
        /* 邮票 */
        .preview-content .stamp {
            position: absolute;
            top: 10px;
            right: 10px;
            width: 50px;
            height: 50px;
            background: linear-gradient(135deg, #ff6b6b 0%, #ee5a24 100%);
            transform: rotate(15deg);
            border: 1px solid #d63031;
            box-shadow: 0 2px 5px rgba(0,0,0,0.2);
        }
        
        .preview-content .stamp::before {
            content: '';
            position: absolute;
            top: 50%;
            left: 50%;
            transform: translate(-50%, -50%);
            width: 30px;
            height: 30px;
            background: rgba(255,255,255,0.3);
            border-radius: 50%;
        }
        
        /* 信件内容容器 */
        .preview-content-inner {
            position: relative;
            z-index: 1;
        }
        
        .preview-content h4 {
            color: #333;
            margin-bottom: 1.5rem;
            font-size: 1.2rem;
            font-weight: 600;
        }
        
        .preview-content p {
            color: #555;
            line-height: 2;
            white-space: pre-wrap;
            font-size: 1rem;
            text-align: justify;
        }
        
        /* 字数统计 */
        .word-count {
            text-align: right;
            color: #666;
            font-size: 0.9rem;
            margin-top: 0.5rem;
        }
        
        .word-count .warning {
            color: #ff4444;
            font-weight: 600;
        }
        
        /* 表单验证样式 */
        .form-group {
            position: relative;
        }
        
        .error-message {
            color: #e74c3c;
            font-size: 0.8rem;
            margin-top: 0.3rem;
            display: none;
        }

        .error-message.show {
            display: block;
        }

        .form-group.error input,
        .form-group.error textarea {
            border-color: #e74c3c;
            background-color: #fff8f8;
        }

        .form-group.success input,
        .form-group.success textarea {
            border-color: #2ecc71;
            background-color: #f6fff9;
        }

        /* 蜜罐字段：对正常用户不可见，用于拦截机器人 */
        .hp-field {
            position: absolute !important;
            left: -9999px !important;
            top: auto !important;
            width: 1px !important;
            height: 1px !important;
            overflow: hidden !important;
        }

        /* 成功提示内的链接 */
        .alert a {
            color: inherit;
            text-decoration: underline;
            font-weight: 600;
        }
        
        /* 提示信息 */
        .alert {
            padding: 1rem;
            border-radius: 10px;
            margin-bottom: 1.5rem;
            display: flex;
            align-items: center;
            gap: 0.5rem;
        }
        
        .alert-success {
            background: #d4edda;
            color: #155724;
            border: 1px solid #c3e6cb;
        }
        
        .alert-error {
            background: #f8d7da;
            color: #721c24;
            border: 1px solid #f5c6cb;
        }
        
        /* 信件提示 */
        .letter-tips {
            background: white;
            padding: 1.5rem;
            border-radius: 15px;
            box-shadow: 0 10px 30px rgba(0,0,0,0.1);
            margin-top: 1.5rem;
        }
        
        .letter-tips h3 {
            color: #667eea;
            margin-bottom: 1rem;
            font-size: 1.2rem;
        }
        
        .letter-tips ul {
            list-style: none;
            padding: 0;
        }
        
        .letter-tips li {
            padding: 0.5rem 0;
            color: #666;
            display: flex;
            align-items: flex-start;
            gap: 0.5rem;
        }
        
        .letter-tips li i {
            color: #667eea;
            margin-top: 0.3rem;
            flex-shrink: 0;
        }
        
        /* 全选功能 */
        .select-all {
            margin-right: 0.5rem;
        }
        
        /* AI优化按钮样式 */
        .optimize-btn {
            position: absolute;
            right: 10px;
            bottom: 10px;
            background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
            color: white;
            border: none;
            border-radius: 50%;
            width: 36px;
            height: 36px;
            cursor: pointer;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 16px;
            box-shadow: 0 2px 10px rgba(102, 126, 234, 0.3);
            transition: all 0.3s ease;
            z-index: 10;
        }

        .optimize-btn:hover {
            transform: translateY(-2px);
            box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
            transform: scale(1.1);
        }

        .optimize-btn i {
            font-size: 14px;
        }

        /* 优化提示样式 */
        .optimize-tip {
            position: absolute;
            right: 50px;
            bottom: 8px;
            background: white;
            border: 1px solid #e1e5e9;
            border-radius: 8px;
            box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
            padding: 12px;
            font-size: 14px;
            color: #333;
            z-index: 15;
            display: none;
            transition: all 0.3s ease;
            max-width: 250px;
        }

        /* 无内容提示样式 */
        .no-content-tip {
            background: #fff5f5;
            border-color: #ffe5e5;
            color: #ff4444;
        }

        /* 确认提示样式 */
        .confirm-tip {
            background: white;
            border-color: #e1e5e9;
        }

        /* 提示内容样式 */
        .tip-content {
            text-align: center;
        }

        .tip-content p {
            margin: 8px 0;
            color: #333;
            font-size: 14px;
        }

        /* 提示操作按钮样式 */
        .tip-actions {
            display: flex;
            gap: 10px;
            justify-content: center;
            margin-top: 12px;
        }

        .tip-btn {
            padding: 6px 16px;
            border: none;
            border-radius: 15px;
            cursor: pointer;
            font-size: 13px;
            font-weight: 500;
            transition: all 0.3s ease;
        }

        .confirm-btn {
            background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
            color: white;
        }

        .confirm-btn:hover {
            transform: translateY(-1px);
            box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
        }

        .cancel-btn {
            background: #f0f0f0;
            color: #666;
        }

        .cancel-btn:hover {
            background: #e0e0e0;
            transform: translateY(-1px);
        }

        /* 提示显示动画 */
        .optimize-tip.show {
            display: block;
            animation: fadeIn 0.3s ease;
        }

        @keyframes fadeIn {
            from {
                opacity: 0;
                transform: translateY(5px);
            }
            to {
                opacity: 1;
                transform: translateY(0);
            }
        }

        /* 提示箭头 */
        .optimize-tip::after {
            content: '';
            position: absolute;
            right: -8px;
            bottom: 12px;
            width: 0;
            height: 0;
            border-top: 8px solid transparent;
            border-bottom: 8px solid transparent;
            border-left: 8px solid white;
        }

        .no-content-tip::after {
            border-left-color: #fff5f5;
        }

        /* 加载状态 */
        .loading-overlay {
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background: rgba(255, 255, 255, 0.8);
            display: flex;
            align-items: center;
            justify-content: center;
            z-index: 2000;
            display: none;
        }

        .loading-overlay.show {
            display: flex;
        }

        .loading-content {
            text-align: center;
            background: white;
            padding: 2rem;
            border-radius: 10px;
            box-shadow: 0 10px 30px rgba(0,0,0,0.1);
        }

        .loading-spinner {
            border: 4px solid #f3f3f3;
            border-top: 4px solid #667eea;
            border-radius: 50%;
            width: 40px;
            height: 40px;
            animation: spin 1s linear infinite;
            margin: 0 auto 1rem;
        }

        @keyframes spin {
            0% { transform: rotate(0deg); }
            100% { transform: rotate(360deg); }
        }

        /* 响应式调整 */
        @media (max-width: 768px) {
            /* 页面整体适配 */
            .future-letter-page {
                padding: 0;
            }
            
            /* 页面标题适配 */
            .letter-header {
                margin: 1.5rem 0;
                padding: 1.5rem 1rem;
            }
            
            .letter-header h1 {
                font-size: 1.8rem;
                margin-bottom: 0.8rem;
            }
            
            .letter-header p {
                font-size: 0.9rem;
            }
            
            /* 容器适配 */
            .letter-container {
                padding: 0 0.8rem;
                gap: 1.5rem;
            }
            
            /* 表单和预览区域适配 */
            .letter-form,
            .letter-preview {
                padding: 1.5rem 1.2rem;
            }
            
            /* 表单元素适配 */
            .form-row {
                grid-template-columns: 1fr !important;
                gap: 1rem !important;
            }
            
            .form-group {
                margin-bottom: 1.2rem !important;
            }
            
            .form-group label {
                font-size: 0.9rem;
                margin-bottom: 0.4rem;
            }
            
            /* 所有输入框和文本域样式 */
            .form-group input,
            .form-group textarea {
                width: 100% !important;
                box-sizing: border-box !important;
                padding: 0.7rem 0.9rem;
                font-size: 0.95rem !important;
                border: 2px solid #e1e5e9 !important;
                border-radius: 8px !important;
                background-color: white !important;
            }
            
            /* 针对date和time输入类型的专门样式 */
            .form-group input[type="date"],
            .form-group input[type="time"] {
                -webkit-appearance: auto !important;
                -moz-appearance: auto !important;
                appearance: auto !important;
                min-height: 44px !important;
                padding: 0.7rem 0.8rem !important;
                font-size: 0.9rem !important;
            }
            
            /* 针对iOS设备的专门修复 */
            @media only screen and (max-width: 768px) {
                /* 确保所有表单元素在移动端正确显示 */
                .form-row {
                    grid-template-columns: 1fr !important;
                    gap: 1.5rem !important;
                }
                
                /* 优化日期和时间输入框在移动端的显示 */
                .form-group input[type="date"],
                .form-group input[type="time"] {
                    min-height: 46px !important;
                    font-size: 0.9rem !important;
                    padding: 0.8rem !important;
                }
            }
            
            /* 信件内容文本域适配 */
            #content {
                min-height: 120px;
                font-size: 0.95rem;
            }
            
            /* AI优化按钮适配 */
            .optimize-btn {
                width: 32px;
                height: 32px;
                font-size: 14px;
            }
            
            /* 表单提交按钮适配 */
            .form-actions {
                margin-top: 1.5rem !important;
            }
            
            .btn {
                padding: 0.8rem 2rem;
                font-size: 0.95rem;
            }
            
            /* 信件预览区域适配 */
            .letter-preview {
                margin-top: 0;
            }
            
            .preview-header h3 {
                font-size: 1.3rem;
                margin-bottom: 0.6rem;
            }
            
            .preview-content {
                padding: 1.5rem;
                min-height: 180px;
            }
            
            /* 信件提示区域适配 */
            .letter-tips {
                margin: 1.5rem 0.8rem;
                padding: 1.2rem;
            }
            
            .letter-tips h3 {
                font-size: 1.1rem;
                margin-bottom: 0.8rem;
            }
            
            .letter-tips li {
                font-size: 0.9rem;
                padding: 0.4rem 0;
            }
        }
    </style>

/* 信件模板按钮 */
                            .template-btn {
                                background: #f0f4f8;
                                border: 1px solid #e1e5e9;
                                border-radius: 8px;
                                padding: 0.8rem;
                                cursor: pointer;
                                transition: all 0.3s ease;
                                font-size: 0.9rem;
                                display: flex;
                                flex-direction: column;
                                align-items: center;
                                gap: 0.5rem;
                            }
                            .template-btn:hover {
                                background: #e8eff8;
                                border-color: #667eea;
                                transform: translateY(-2px);
                                box-shadow: 0 4px 8px rgba(102, 126, 234, 0.1);
                            }
                            .template-btn i {
                                color: #667eea;
                                font-size: 1.2rem;
                            }

/* 写信小贴士悬停与响应式 */
            .letter-tips > div > div:hover {
                transform: translateY(-4px);
                box-shadow: 0 5px 15px rgba(0,0,0,0.1);
                border-color: #dee2e6;
            }
            
            /* 响应式调整 */
            @media (max-width: 768px) {
                .letter-tips {
                    margin: 1.5rem auto !important;
                    padding: 0 1rem !important;
                }
                
                .letter-tips > div {
                    padding: 2rem 1.2rem !important;
                }
                
                .letter-tips h3 {
                    font-size: 1.6rem !important;
                    margin-bottom: 1.5rem !important;
                }
                
                .letter-tips > div > div {
                    padding: 1.5rem !important;
                }
            }
