<?php
header('Content-Type: application/xml; charset=utf-8');
$host = $_SERVER['HTTP_HOST'] ?? '';
$https = (!empty($_SERVER['HTTPS']) && $_SERVER['HTTPS'] !== 'off') || (isset($_SERVER['SERVER_PORT']) && $_SERVER['SERVER_PORT'] == 443);
$scheme = $https ? 'https' : 'http';
$base = $scheme . '://' . $host;
$ns = 'http://www.sitemaps' . '.org/schemas/sitemap/0.9';
$paths = array('/', '/brand-trend/', '/short-video/', '/ai-play/', '/music-acg/', '/creator-arena/', '/contact/', '/street-diary/', '/ai-workshop/', '/personal-show/', '/young-topics/');
echo '<?xml version="1.0" encoding="UTF-8"?>' . "\n";
?>
<urlset xmlns="<?php echo htmlspecialchars($ns, ENT_XML1, 'UTF-8'); ?>">
<?php foreach ($paths as $path): ?>
  <url>
    <loc><?php echo htmlspecialchars($base . $path, ENT_XML1, 'UTF-8'); ?></loc>
    <lastmod><?php echo date('Y-m-d'); ?></lastmod>
    <changefreq><?php echo $path === '/' ? 'daily' : 'weekly'; ?></changefreq>
    <priority><?php echo $path === '/' ? '1.0' : '0.8'; ?></priority>
  </url>
<?php endforeach; ?>
</urlset>
