import { Ionicons } from '@expo/vector-icons'
import { Block, Text } from '@share/components'
import { Stack, router } from 'expo-router'
import React from 'react'
import { ScrollView } from 'react-native'

export default function ServicePage() {
  const renderHeader = () => (
    <Block className="flex-row items-center justify-between px-[16px] py-[10px]">
      <Block
        className="ml-[-8px] size-[40px] items-center justify-center"
        opacity={0.7}
        onClick={() => router.back()}
      >
        <Ionicons color="#323232" name="chevron-back" size={24} />
      </Block>
      <Text className="text-[16px] font-[700] text-[#323232]">服务条款 / Terms of Service</Text>
      <Block className="w-[32px]" />
    </Block>
  )

  const renderSectionTitle = (children: React.ReactNode) => (
    <Text className="mt-[16px] text-[15px] font-[700] text-[#111827]">{children}</Text>
  )

  const renderParagraph = (children: React.ReactNode) => (
    <Text className="mt-[8px] text-[14px] leading-[22px] text-[#111827]">{children}</Text>
  )

  const renderBullet = (children: React.ReactNode) => (
    <Text className="mt-[6px] text-[14px] leading-[22px] text-[#111827]">• {children}</Text>
  )

  return (
    <Block className="flex-1 bg-[#fafafa]">
      <Stack.Screen options={{ headerShown: false }} />
      {renderHeader()}

      <ScrollView
        className="flex-1 px-[16px] pb-[24px]"
        contentContainerStyle={{ paddingBottom: 44 }}
        showsVerticalScrollIndicator={false}
      >
        {renderSectionTitle('1. 引言 / Introduction')}
        {renderParagraph(
          '欢迎使用 BOWONG AI (HK) LIMITED（以下简称“我们”或“本公司”）提供的服务。在使用我们的服务之前，请仔细阅读本服务条款。通过访问或使用我们的服务，您同意受本条款的约束。',
        )}
        {renderParagraph(
          'Welcome to the services provided by BOWONG AI (HK) LIMITED (hereinafter referred to as “we” or “our company”). Please read these Terms of Service carefully before using our services. By accessing or using our services, you agree to be bound by these terms.',
        )}

        {renderSectionTitle('2. 服务描述 / Service Description')}
        {renderSectionTitle('2.1 服务内容 / Service Content')}
        {renderParagraph('我们提供基于人工智能的设计和内容生成服务，包括但不限于：')}
        {renderParagraph('We provide AI-based design and content generation services, including but not limited to:')}
        {renderBullet('AI 驱动的设计工具和模板生成 / AI-powered design tools and template generation;')}
        {renderBullet('创意内容生成和编辑功能 / Creative content generation and editing features;')}
        {renderBullet('设计项目管理和协作工具 / Design project management and collaboration tools;')}
        {renderBullet('其他相关技术服务 / Other related technical services.')}

        {renderSectionTitle('2.2 服务变更 / Service Modifications')}
        {renderParagraph(
          '我们保留随时修改、暂停或终止任何服务的权利，恕不另行通知。我们不对因服务变更而可能导致的任何损失承担责任。',
        )}
        {renderParagraph(
          'We reserve the right to modify, suspend, or terminate any service at any time without prior notice. We shall not be liable for any losses that may result from service modifications.',
        )}

        {renderSectionTitle('3. 用户账户 / User Accounts')}
        {renderSectionTitle('3.1 账户注册 / Account Registration')}
        {renderParagraph('要使用我们的服务，您需要创建一个账户。注册时，您必须：')}
        {renderParagraph(
          'To use our services, you need to create an account. When registering, you must:',
        )}
        {renderBullet('提供真实、准确、完整的信息 / Provide true, accurate, and complete information;')}
        {renderBullet('维护并及时更新您的账户信息 / Maintain and promptly update your account information;')}
        {renderBullet('对您账户下的所有活动负责 / Be responsible for all activities under your account.')}

        {renderSectionTitle('3.2 账户安全 / Account Security')}
        {renderParagraph(
          '您有责任维护账户信息的机密性，包括您的密码。您同意对您账户下的所有活动负责，并立即通知我们任何未经授权的使用。',
        )}
        {renderParagraph(
          'You are responsible for maintaining the confidentiality of your account information, including your password. You agree to be responsible for all activities under your account and to immediately notify us of any unauthorized use.',
        )}

        {renderSectionTitle('4. 使用规范 / Acceptable Use')}
        {renderSectionTitle('4.1 合法使用 / Legal Use')}
        {renderParagraph(
          '您同意仅将我们的服务用于合法目的，并遵守所有适用的法律法规。',
        )}
        {renderParagraph(
          'You agree to use our services only for lawful purposes and in compliance with all applicable laws and regulations.',
        )}

        {renderSectionTitle('4.2 禁止行为 / Prohibited Activities')}
        {renderParagraph('您不得： / You shall not:')}
        {renderBullet('使用服务从事任何非法活动 / Use the service for any illegal activities;')}
        {renderBullet(
          '上传、发布或传输任何违法、有害、威胁、辱骂、骚扰、诽谤、粗俗、淫秽或其他令人反感的内容 / Upload, post, or transmit any illegal, harmful, threatening, abusive, harassing, defamatory, vulgar, obscene, or otherwise objectionable content;',
        )}
        {renderBullet('侵犯他人的知识产权或其他权利 / Infringe upon the intellectual property or other rights of others;')}
        {renderBullet('干扰或破坏服务的正常运行 / Interfere with or disrupt the normal operation of the service;')}
        {renderBullet(
          '尝试未经授权访问任何系统或网络 / Attempt to gain unauthorized access to any system or network;',
        )}
        {renderBullet('使用自动化工具或脚本滥用服务 / Abuse the service using automated tools or scripts.')}

        {renderSectionTitle('5. 知识产权 / Intellectual Property')}
        {renderSectionTitle('5.1 我们的权利 / Our Rights')}
        {renderParagraph(
          '服务及其所有内容，包括但不限于文本、图形、徽标、图标、图像、音频剪辑、数字下载、数据编译和软件，均为我们或我们的内容提供商的财产，受版权、商标和其他知识产权法保护。',
        )}
        {renderParagraph(
          'The service and all its content, including but not limited to text, graphics, logos, icons, images, audio clips, digital downloads, data compilations, and software, are the property of us or our content providers and are protected by copyright, trademark, and other intellectual property laws.',
        )}

        {renderSectionTitle('5.2 用户内容 / User Content')}
        {renderParagraph(
          '您保留对您上传或创建的内容的所有权利。通过使用我们的服务，您授予我们使用、复制、修改、分发和公开展示此类内容的非独占、全球性、免版税的许可，仅用于提供和改进我们的服务。',
        )}
        {renderParagraph(
          'You retain all rights to the content you upload or create. By using our services, you grant us a non-exclusive, worldwide, royalty-free license to use, copy, modify, distribute, and publicly display such content solely for the purpose of providing and improving our services.',
        )}

        {renderSectionTitle('6. 付费服务 / Paid Services')}
        {renderSectionTitle('6.1 订阅和付款 / Subscriptions and Payments')}
        {renderParagraph(
          '某些服务可能需要付费订阅。您同意按照我们网站上显示的价格支付所有费用。所有费用均以美元或其他指定货币支付，且不可退还，除非法律另有规定或我们另有说明。',
        )}
        {renderParagraph(
          'Certain services may require paid subscriptions. You agree to pay all fees as displayed on our website. All fees are payable in USD or other specified currency and are non-refundable unless otherwise stated by law or us.',
        )}

        {renderSectionTitle('6.2 自动续订 / Auto-Renewal')}
        {renderParagraph(
          '除非您取消订阅，否则订阅将自动续订。您可以在订阅设置中随时取消自动续订。',
        )}
        {renderParagraph(
          'Subscriptions will automatically renew unless you cancel them. You may cancel auto-renewal at any time in your subscription settings.',
        )}

        {renderSectionTitle('6.3 退款政策 / Refund Policy')}
        {renderParagraph(
          '除非法律另有规定或我们另有说明，所有付款均为最终付款且不可退还。如果您对服务不满意，请联系我们的客户支持。',
        )}
        {renderParagraph(
          'All payments are final and non-refundable unless otherwise required by law or stated by us. If you are dissatisfied with the service, please contact our customer support.',
        )}

        {renderSectionTitle('7. 隐私保护 / Privacy')}
        {renderParagraph(
          '我们非常重视您的隐私。有关我们如何收集、使用和保护您的信息，请参阅我们的隐私协议。',
        )}
        {renderParagraph(
          'We take your privacy seriously. Please refer to our Privacy Policy for information on how we collect, use, and protect your information.',
        )}

        {renderSectionTitle('8. 免责声明 / Disclaimer')}
        {renderSectionTitle('8.1 服务“按现状”提供 / Service “As Is”')}
        {renderParagraph(
          '服务按“现状”和“可用”的基础提供，不提供任何明示或暗示的保证，包括但不限于适销性、特定用途的适用性和非侵权性的保证。',
        )}
        {renderParagraph(
          'The service is provided on an “as is” and “as available” basis without any express or implied warranties, including but not limited to warranties of merchantability, fitness for a particular purpose, and non-infringement.',
        )}

        {renderSectionTitle('8.2 责任限制 / Limitation of Liability')}
        {renderParagraph(
          '在法律允许的最大范围内，我们不对任何间接、偶然、特殊、后果性或惩罚性损害承担责任，即使我们已被告知此类损害的可能性。',
        )}
        {renderParagraph(
          'To the maximum extent permitted by law, we shall not be liable for any indirect, incidental, special, consequential, or punitive damages, even if we have been advised of the possibility of such damages.',
        )}

        {renderSectionTitle('9. 服务终止 / Termination')}
        {renderSectionTitle('9.1 终止权利 / Termination Rights')}
        {renderParagraph(
          '我们保留随时终止或暂停您对服务的访问的权利，无论是否事先通知，原因包括但不限于违反本条款。',
        )}
        {renderParagraph(
          'We reserve the right to terminate or suspend your access to the service at any time, with or without prior notice, for reasons including but not limited to violation of these terms.',
        )}

        {renderSectionTitle('9.2 终止后果 / Consequences of Termination')}
        {renderParagraph(
          '服务终止后，您访问服务的权利将立即终止。本条款中在终止后仍然有效的条款将继续适用。',
        )}
        {renderParagraph(
          'Upon termination, your right to access the service will immediately cease. The provisions of these terms that by their nature should survive termination will continue to apply.',
        )}

        {renderSectionTitle('10. 条款修改 / Modifications to Terms')}
        {renderParagraph(
          '我们保留随时修改本条款的权利。重大变更将通过电子邮件或网站公告通知您。继续使用服务即表示您接受修改后的条款。',
        )}
        {renderParagraph(
          'We reserve the right to modify these terms at any time. Material changes will be notified to you via email or website notice. Continued use of the service constitutes your acceptance of the modified terms.',
        )}

        {renderSectionTitle('11. 适用法律 / Governing Law')}
        {renderParagraph(
          '本条款受香港特别行政区法律管辖，并按其解释。任何争议应提交香港特别行政区有管辖权的法院解决。',
        )}
        {renderParagraph(
          'These terms shall be governed by and construed in accordance with the laws of the Hong Kong Special Administrative Region. Any disputes shall be submitted to the competent courts of the Hong Kong Special Administrative Region.',
        )}

        {renderSectionTitle('12. 联系我们 / Contact Us')}
        {renderParagraph('如果您对本服务条款有任何疑问，请通过以下方式联系我们：')}
        {renderParagraph('If you have any questions regarding these Terms of Service, please contact us at:')}
        {renderParagraph('公司名称 / Company Name: BOWONG AI (HK) LIMITED')}
        {renderParagraph('客服邮箱 / Support Email: support@bowong.ai')}
        {renderParagraph(
          '通过使用我们的服务，您确认已阅读、理解并同意遵守本服务条款。',
        )}
        {renderParagraph(
          'By using our services, you acknowledge that you have read, understood, and agree to be bound by these Terms of Service.',
        )}
      </ScrollView>
    </Block>
  )
}