/* 重置和基础样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    line-height: 1.6;
    color: #333;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px 0;
}

.container {
    max-width: 600px;
    margin: 0 auto;
    background: white;
    border-radius: 16px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

/* 头部样式 */
.header {
    background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
    color: white;
    padding: 40px 30px;
    text-align: center;
}

.header h1 {
    font-size: 2.5rem;
    margin-bottom: 10px;
    font-weight: 700;
}

.subtitle {
    font-size: 1.1rem;
    opacity: 0.9;
}

/* 产品区域 */
.product-section {
    padding: 30px;
    border-bottom: 1px solid #e5e7eb;
}

.product-card {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 20px;
    background: #f9fafb;
    border-radius: 12px;
    border: 1px solid #e5e7eb;
}

.product-image {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.product-icon {
    width: 40px;
    height: 40px;
    color: white;
}

.product-info h3 {
    font-size: 1.4rem;
    margin-bottom: 8px;
    color: #1f2937;
}

.product-description {
    color: #6b7280;
    margin-bottom: 10px;
}

.price {
    font-size: 1.8rem;
    font-weight: 700;
    color: #059669;
}

/* 支付区域 */
.payment-section {
    padding: 30px;
}

.payment-section h2 {
    font-size: 1.6rem;
    margin-bottom: 25px;
    color: #1f2937;
}

/* 订单摘要 */
.order-summary {
    background: #f9fafb;
    padding: 20px;
    border-radius: 12px;
    margin-bottom: 30px;
    border: 1px solid #e5e7eb;
}

.summary-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid #e5e7eb;
}

.summary-row:last-child {
    border-bottom: none;
}

.summary-row.total {
    font-size: 1.2rem;
    font-weight: 700;
    color: #1f2937;
    padding-top: 15px;
    border-top: 2px solid #d1d5db;
    margin-top: 10px;
}

/* 表单样式 */
.form-group {
    margin-bottom: 25px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #374151;
}

.form-group input[type="email"] {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #d1d5db;
    border-radius: 8px;
    font-size: 1rem;
    transition: all 0.2s ease;
    background: white;
}

.form-group input[type="email"]:focus {
    outline: none;
    border-color: #4f46e5;
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

/* Flow 组件容器样式 */
#flow-container {
    min-height: 120px;
    padding: 20px;
    border-radius: 12px;
    background: white;
    transition: all 0.2s ease;
}

.loading-message {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    padding: 40px;
    color: #6b7280;
}

.loading-spinner-inline {
    border: 2px solid #f3f4f6;
    border-top: 2px solid #4f46e5;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    animation: spin 1s linear infinite;
    margin-bottom: 10px;
}

/* 支付按钮 */
.pay-button {
    width: 100%;
    background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
    color: white;
    border: none;
    padding: 16px 32px;
    border-radius: 12px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 56px;
}

.pay-button:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(79, 70, 229, 0.3);
}

.pay-button:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

.pay-button .button-text {
    transition: opacity 0.2s ease;
}

.pay-button.loading .button-text {
    opacity: 0;
}

/* 加载动画 */
.loading-spinner {
    border: 2px solid transparent;
    border-top: 2px solid #ffffff;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    animation: spin 1s linear infinite;
    position: absolute;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* 支付状态样式 */
.payment-status {
    padding: 15px;
    margin: 20px 0;
    border-radius: 8px;
    font-weight: 500;
    text-align: center;
}

.payment-status.success {
    background: #d1fae5;
    color: #065f46;
    border: 1px solid #a7f3d0;
}

.payment-status.error {
    background: #fee2e2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

.payment-status.loading {
    background: #dbeafe;
    color: #1e40af;
    border: 1px solid #93c5fd;
}

/* 消息样式 */
.messages {
    padding: 0 30px 30px;
}

.message {
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 15px;
    font-weight: 500;
}

.message.success {
    background: #d1fae5;
    color: #065f46;
    border: 1px solid #a7f3d0;
}

.message.error {
    background: #fee2e2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

.message.info {
    background: #dbeafe;
    color: #1e40af;
    border: 1px solid #93c5fd;
}

/* 更多选项区域 */
.more-options {
    padding: 30px;
    background: #f9fafb;
    border-top: 1px solid #e5e7eb;
}

.more-options h2 {
    font-size: 1.6rem;
    margin-bottom: 25px;
    color: #1f2937;
    text-align: center;
}

.options-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    max-width: 800px;
    margin: 0 auto;
}

.option-card {
    background: white;
    padding: 25px 20px;
    border-radius: 12px;
    border: 2px solid #e5e7eb;
    text-align: center;
    text-decoration: none;
    color: inherit;
    transition: all 0.2s ease;
    display: block;
}

.option-card:hover:not(.disabled) {
    border-color: #4f46e5;
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(79, 70, 229, 0.1);
}

.option-card.disabled {
    opacity: 0.6;
    cursor: not-allowed;
    background: #f3f4f6;
}

.option-icon {
    font-size: 2.5rem;
    margin-bottom: 15px;
}

.option-card h3 {
    font-size: 1.2rem;
    margin-bottom: 10px;
    color: #1f2937;
}

.option-card p {
    color: #6b7280;
    font-size: 0.9rem;
    line-height: 1.4;
    margin: 0;
}

/* 页脚 */
.footer {
    background: #f9fafb;
    padding: 20px 30px;
    text-align: center;
    color: #6b7280;
    font-size: 0.9rem;
    border-top: 1px solid #e5e7eb;
}

.footer p {
    margin-bottom: 5px;
}

/* 响应式设计 */
@media (max-width: 768px) {
    body {
        padding: 10px;
    }
    
    .container {
        border-radius: 12px;
    }
    
    .header {
        padding: 30px 20px;
    }
    
    .header h1 {
        font-size: 2rem;
    }
    
    .product-section,
    .payment-section {
        padding: 20px;
    }
    
    .product-card {
        flex-direction: column;
        text-align: center;
    }
    
    .product-image {
        margin: 0 auto;
    }
}