<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>调试错误 - CmsPro</title>
    <style>
        * { margin: 0; padding: 0; box-sizing: border-box; }
        body { font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; background: #f5f5f5; color: #333; padding: 20px; }
        .error-container { max-width: 960px; margin: 0 auto; background: #fff; border-radius: 8px; box-shadow: 0 2px 8px rgba(0,0,0,0.1); overflow: hidden; }
        .error-header { background: #dc3545; color: #fff; padding: 20px 24px; }
        .error-header h1 { font-size: 18px; font-weight: 600; margin-bottom: 4px; }
        .error-header .exception { font-size: 13px; opacity: 0.9; font-family: monospace; }
        .error-body { padding: 20px 24px; }
        .error-message { background: #fff5f5; border-left: 4px solid #dc3545; padding: 12px 16px; margin-bottom: 16px; font-family: monospace; font-size: 14px; word-break: break-all; }
        .error-location { font-family: monospace; font-size: 13px; color: #666; margin-bottom: 16px; }
        .trace-section h2 { font-size: 14px; font-weight: 600; margin-bottom: 8px; color: #555; }
        .trace-list { list-style: none; font-family: monospace; font-size: 12px; }
        .trace-list li { padding: 6px 0; border-bottom: 1px solid #f0f0f0; }
        .trace-list li:last-child { border-bottom: none; }
        .trace-file { color: #6f42c1; }
        .trace-line { color: #dc3545; }
        .trace-function { color: #28a745; }
        .badge { display: inline-block; background: #ffc107; color: #000; font-size: 11px; padding: 2px 8px; border-radius: 3px; font-weight: 600; margin-bottom: 12px; }
    </style>
</head>
<body>
    <div class="error-container">
        <div class="error-header">
            <h1>服务器内部错误</h1>
            <div class="exception">{{ $exception }}</div>
        </div>
        <div class="error-body">
            <div class="badge">DEBUG 模式</div>
            <div class="error-message">{{ $message }}</div>
            <div class="error-location">在 {{ $file }} 第 {{ $line }} 行</div>
            @if($trace->count() > 0)
            <div class="trace-section">
                <h2>调用堆栈</h2>
                <ul class="trace-list">
                    @foreach($trace as $i => $frame)
                    <li>
                        <span class="trace-file">{{ $frame['file'] }}</span>
                        <span class="trace-line">:{{ $frame['line'] }}</span>
                        &mdash; <span class="trace-function">{{ $frame['function'] }}</span>
                    </li>
                    @endforeach
                </ul>
            </div>
            @endif
        </div>
    </div>
</body>
</html>
