<?php
$currentHost = $_SERVER['HTTP_HOST'] ?? ($_SERVER['SERVER_NAME'] ?? '');
$scheme = (!empty($_SERVER['HTTPS']) && $_SERVER['HTTPS'] !== 'off') ? 'https' : 'http';
$baseUrl = $currentHost ? $scheme . '://' . $currentHost : '';
function h($value) { return htmlspecialchars((string)$value, ENT_QUOTES, 'UTF-8'); }
header('Content-Type: application/xml; charset=utf-8');
echo '<?xml version="1.0" encoding="UTF-8"?>';
?>
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
<?php foreach (['/', '/brand-trend/', '/short-video/', '/ai-fun/', '/music-acg/', '/creator/', '/contact/', '/street-diary/', '/ai-workshop/', '/style-stage/', '/youth-topic/'] as $path): ?>
  <url><loc><?php echo h($baseUrl . $path); ?></loc><lastmod><?php echo date('Y-m-d'); ?></lastmod><changefreq>daily</changefreq><priority><?php echo $path === '/' ? '1.0' : '0.8'; ?></priority></url>
<?php endforeach; ?>
</urlset>
