<?php
$id = $_SERVER['REDIRECT_BLOCK_ID'] ?? uniqid('block_', true);
$ua = str_replace(["\r", "\n", "\t"], ' ', $_SERVER['HTTP_USER_AGENT'] ?? '(none)');
$ip = filter_var($_SERVER['REMOTE_ADDR'] ?? '0.0.0.0', FILTER_VALIDATE_IP) ?: '(invalid)';
$time = date('c');
@file_put_contents(__DIR__.'/var/blocked.log', "{$time}\t{$ip}\t{$id}\t{$ua}\n", FILE_APPEND | LOCK_EX);
?>
<!doctype html><html lang="ko"><head>
<meta charset="utf-8"><title>접근 거부</title>
<meta name="robots" content="noindex"><meta name="viewport" content="width=device-width,initial-scale=1">
<style>body{margin:0;display:grid;place-items:center;min-height:100vh;background:#faf7f2;font-family:system-ui,-apple-system,"Noto Sans KR",sans-serif;color:#222}.card{max-width:520px;background:#fff;border:1px solid #eee;border-radius:16px;padding:28px;box-shadow:0 10px 24px rgba(0,0,0,.06);text-align:center}h1{margin:0 0 8px;font-size:22px}.small{color:#666;font-size:13px;margin-top:14px}code{background:#f0f0f0;padding:2px 6px;border-radius:6px}</style>
</head><body><div class="card">
  <h1>접근이 거부되었습니다</h1>
  <p>관리자에게 연락하세요.</p>
  <p class="small">요청 ID: <code><?=htmlspecialchars($id)?></code></p>
</div></body></html>
