<?php
declare(strict_types=1);
require __DIR__ . '/inc/settings.php';
$SITE = site_get(__DIR__ . '/data/site.json');
$COPY = str_replace('{brand}', (string)$SITE['brand_name'], (string)$SITE['copyright']);
$WELCOME = str_replace('{brand}', (string)$SITE['brand_name'], (string)$SITE['cs_welcome']);
$LOGO = (string)$SITE['logo'];
$SHAPE = (string)$SITE['logo_shape'] === 'square' ? 'square' : 'circle';
$RATIO = (float)$SITE['logo_ratio'];                 // 图的宽高比，方形≈1、横条>1、竖条<1
if ($RATIO < 0.2 || $RATIO > 5) { $RATIO = 1.0; }
$LOGOCLS  = 'logo-' . $SHAPE . ((string)$SITE['logo_sharp'] === '1' ? ' logo-sharp' : '');
$LOGOSTAT = 'style="--lr:' . rtrim(rtrim(number_format($RATIO, 3, '.', ''), '0'), '.') . '"';
function h(?string $s): string { return htmlspecialchars((string)$s, ENT_QUOTES, 'UTF-8'); }
?>
<!doctype html>
<html lang="zh-CN">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width,initial-scale=1,viewport-fit=cover">
<meta name="theme-color" content="#fdf5f2">
<link rel="icon" href="<?= h($LOGO) ?>">
<title><?= h($SITE['brand_name']) ?> - 客户端下载</title>
<link rel="stylesheet" href="css/style.css">
</head>
<body>

<div class="shell">
  <header class="header">
    <div class="brand"><img class="brand-logo <?= $LOGOCLS ?>" <?= $LOGOSTAT ?> src="<?= h($LOGO) ?>" alt="Logo"><div><div class="brand-name"><?= h($SITE['brand_name']) ?></div><div class="brand-sub"><?= h($SITE['brand_sub']) ?></div></div></div>
    <nav class="nav"><a href="#top">首页</a><a href="#features">核心优势</a><a href="#features">产品服务</a><a href="#features">安全保障</a><a href="#footer">关于我们</a></nav>
    <a class="header-cta" href="download.php">立即下载</a><button class="menu" type="button" aria-label="菜单">☰</button>
  </header>

  <main class="hero" id="top">
    <section class="hero-left">
      <h1 class="hero-title"><?= h($SITE['hero_title']) ?></h1>
      <div class="hero-sub"><?= h($SITE['hero_sub']) ?></div>
      <div class="tagline"><span>携手共创</span><span>经济繁荣</span><span>互联互通</span><span>共赢未来</span></div>
      <div class="quick">
        <div class="quick-item"><div class="quick-icon"><svg viewBox="0 0 24 24"><path d="M12 3 4.5 6v5.8c0 4.7 3.2 7.7 7.5 9.2 4.3-1.5 7.5-4.5 7.5-9.2V6L12 3Z"/><path d="m8.5 12 2.2 2.2 4.8-5"/></svg></div><b>安全可靠</b><small>多重加密保障<br>资金安全</small></div>
        <div class="quick-item"><div class="quick-icon"><svg viewBox="0 0 24 24"><path d="M13 2 5.5 13H11l-1 9L18.5 11H13V2Z"/></svg></div><b>极速体验</b><small>流畅稳定运行<br>快速便捷</small></div>
        <div class="quick-item"><div class="quick-icon"><svg viewBox="0 0 24 24"><circle cx="12" cy="12" r="9"/><path d="M3 12h18M12 3c3 3.2 4.2 6.2 4.2 9S15 17.8 12 21c-3-3.2-4.2-6.2-4.2-9S9 6.2 12 3Z"/></svg></div><b>全球互通</b><small>连接亚洲市场<br>畅享全球机遇</small></div>
        <div class="quick-item"><div class="quick-icon"><svg viewBox="0 0 24 24"><path d="m12 3 8 4-8 4-8-4 8-4Z"/><path d="m4 12 8 4 8-4M4 17l8 4 8-4"/></svg></div><b>功能丰富</b><small>满足多样需求<br>持续创新升级</small></div>
      </div>
      <div class="actions">
        <a class="join" id="downloadBtn" href="download.php">
          <span class="tg"><svg viewBox="0 0 24 24" width="20" height="20" fill="none" stroke="currentColor" stroke-width="2.6" stroke-linecap="round" stroke-linejoin="round"><path d="M12 3.5v11.5m0 0 4.4-4.4M12 15l-4.4-4.4M4.2 19.6h15.6"/></svg></span>
          <span>立即下载</span></a>
        <button class="notice-open" id="csConsultBtn" type="button">💬 咨询在线客服 <span>›</span></button>
        <button class="notice-open" id="noticeBtn" type="button"><svg viewBox="0 0 24 24"><path d="M4 10v4h3l4 4V6L7 10H4Zm10.5-2.5a6 6 0 0 1 0 9l1.4 1.4a8 8 0 0 0 0-11.8l-1.4 1.4Zm2.9-2.8a10 10 0 0 1 0 14.6l1.4 1.4a12 12 0 0 0 0-17.4l-1.4 1.4Z"/></svg>查看最新公告 <span>›</span></button>
       <div class="compat">点击上方按钮下载最新客户端，安装遇到问题可咨询在线客服</div>
      </div>
    </section>
    <section class="hero-right" aria-hidden="true">
      <div class="globe"></div>
      <div class="skyline"><span class="tower" style="height:35%"></span><span class="tower" style="height:52%"></span><span class="tower" style="height:69%"></span><span class="tower" style="height:86%"></span><span class="tower" style="height:38%"></span><span class="tower" style="height:55%"></span><span class="tower" style="height:72%"></span><span class="tower" style="height:89%"></span><span class="tower" style="height:41%"></span><span class="tower" style="height:58%"></span><span class="tower" style="height:75%"></span><span class="tower" style="height:92%"></span><span class="tower" style="height:44%"></span><span class="tower" style="height:61%"></span><span class="tower" style="height:78%"></span><span class="tower" style="height:95%"></span><span class="tower" style="height:47%"></span><span class="tower" style="height:64%"></span></div>
      <img class="big-coin <?= $LOGOCLS ?>" <?= $LOGOSTAT ?> src="<?= h($LOGO) ?>" alt="">
      <img class="coin c1 <?= $LOGOCLS ?>" <?= $LOGOSTAT ?> src="<?= h($LOGO) ?>" alt=""><img class="coin c2 <?= $LOGOCLS ?>" <?= $LOGOSTAT ?> src="<?= h($LOGO) ?>" alt=""><img class="coin c3 <?= $LOGOCLS ?>" <?= $LOGOSTAT ?> src="<?= h($LOGO) ?>" alt="">
    </section>
  </main>

  <section class="section" id="features"><div class="panel why-panel">
    <h2 class="section-title"><span><?= h($SITE['why_title']) ?></span></h2>
    <div class="why-grid">
      <div class="why-item"><svg viewBox="0 0 24 24"><path d="M12 3 4.5 6v5.8c0 4.7 3.2 7.7 7.5 9.2 4.3-1.5 7.5-4.5 7.5-9.2V6L12 3Z"/><path d="m8.5 12 2.2 2.2 4.8-5"/></svg><b>安全保障</b><small>多层安全防护<br>保障信息安全</small></div>
      <div class="why-item"><svg viewBox="0 0 24 24"><path d="M13 2 5.5 13H11l-1 9L18.5 11H13V2Z"/></svg><b>极速体验</b><small>毫秒级响应<br>操作快人一步</small></div>
      <div class="why-item"><svg viewBox="0 0 24 24"><circle cx="12" cy="12" r="9"/><path d="M3 12h18M12 3c3 3.2 4.2 6.2 4.2 9S15 17.8 12 21c-3-3.2-4.2-6.2-4.2-9S9 6.2 12 3Z"/></svg><b>全球覆盖</b><small>覆盖亚洲市场<br>全球互联互通</small></div>
      <div class="why-item"><svg viewBox="0 0 24 24"><path d="M12 3v9h9"/><path d="M20.5 15.5a9 9 0 1 1-12-12"/></svg><b>专业服务</b><small>7×24小时支持<br>专业团队服务</small></div>
      <div class="why-item"><svg viewBox="0 0 24 24"><path d="m12 2 4 6 6 2-4 6 .5 6-6.5-3-6.5 3L6 16l-4-6 6-2 4-6Z"/></svg><b>稳定可靠</b><small>多重备份机制<br>系统稳定运行</small></div>
    </div>
  </div></section>

  <section class="section"><div class="panel notice-panel">
    <div class="notice-head"><svg viewBox="0 0 24 24"><path d="M12 22a2.3 2.3 0 0 0 2.2-1.6H9.8A2.3 2.3 0 0 0 12 22Zm7-6.4-1.7-2.2V9a5.3 5.3 0 0 0-4.1-5.1V3a1.2 1.2 0 1 0-2.4 0v.9A5.3 5.3 0 0 0 6.7 9v4.4L5 15.6V18h14v-2.4Z"/></svg>最新公告</div>
    <div class="notice-card"><div class="notice-title"><span id="noticeTitleText">民生大事官方正式上线公告</span> <span class="badge">最新</span></div><div class="notice-time">后台实时更新</div><div class="notice-text" id="noticeText">欢迎民生大事回归，民生大事官方服务已全面恢复，请各位家人及时进群核对信息。</div></div>
    <div class="notice-more"><button id="noticeMore" type="button">查看全部公告 ›</button></div>
  </div></section>
</div>

<footer class="footer" id="footer"><div class="footer-inner">
  <div><div class="footer-brand"><img class="<?= $LOGOCLS ?>" <?= $LOGOSTAT ?> src="<?= h($LOGO) ?>" alt=""><div><strong><?= h($SITE['brand_name']) ?></strong><small><?= h($SITE['brand_sub']) ?></small></div></div><div class="socials"><span>f</span><span>♥</span><span>↗</span><span>▶</span></div></div>
  <div class="footer-col"><h4>产品服务</h4><div>加入群聊</div><div>功能介绍</div><div>安全保障</div><div>帮助中心</div></div>
  <div class="footer-col"><h4>关于我们</h4><div><?= h($SITE['footer_about']) ?></div><div>联系我们</div><div>用户协议</div><div>隐私政策</div></div>
</div><div class="copyright"><?= h($COPY) ?></div></footer>

<button class="cs-fab" id="csFab" type="button" aria-label="在线客服">💬<span class="cs-badge" id="csBadge">0</span></button>
<section class="cs-panel" id="csPanel" aria-label="在线客服">
  <div class="cs-head"><img class="<?= $LOGOCLS ?>" <?= $LOGOSTAT ?> src="<?= h($LOGO) ?>" alt=""><div><strong><?= h($SITE['brand_name']) ?> 在线客服</strong><small id="csStatus">正在连接实时客服…</small></div><button class="cs-close" id="csClose" type="button">×</button></div>
  <div class="cs-messages" id="csMessages"><div class="cs-welcome" id="csWelcome"><?= nl2br(h($WELCOME)) ?></div><div class="cs-quick-replies" id="csQuickReplies"></div></div>
  <div id="csBottom">
    <div class="cs-blocked" id="csBlocked" style="display:none">当前会话已停止发送消息，如有疑问请联系管理员。</div>
    <div class="cs-compose" id="csCompose">
      <div class="cs-uploading" id="csUploading">正在上传文件，请稍候…</div>
      <div class="cs-emoji" id="csEmoji"></div>
      <div class="cs-tools"><button class="cs-tool" id="csEmojiBtn" type="button" title="表情">😊</button><button class="cs-tool" id="csFileBtn" type="button" title="图片/视频">📎</button><input id="csFileInput" type="file" accept="image/*,video/mp4,video/webm,video/quicktime" hidden></div>
      <div class="cs-input-row"><textarea class="cs-input" id="csInput" placeholder="请输入消息…"></textarea><button class="cs-send" id="csSend" type="button">发送</button></div>
    </div>
  </div>
</section>

<div class="modal" id="noticeModal" aria-hidden="true"><div class="modal-card" role="dialog" aria-modal="true" aria-labelledby="noticeTitle"><h2 id="noticeModalTitle">最新公告</h2><p class="modal-tip">请浏览公告内容，5 秒后可点击“已知晓”关闭。</p><div class="announcement" id="noticeBody">欢迎民生大事回归，民生大事官方服务已全面恢复，请各位家人及时进群核对信息。</div><button class="ack" id="ackNotice" type="button" disabled>已知晓（5秒）</button></div></div>
<script src="js/notice.js"></script>

<script src="js/chat.js"></script>

</body></html>