<!doctype html>
<html lang="zh-CN">
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <title>@yield('title', 'SaaSShop 站点后台')</title>
    <link rel="stylesheet" href="/css/admin-base.css">
    <link rel="stylesheet" href="/css/site-admin.css">
</head>
<body>
<div class="layout layout-topnav">
    <aside class="sidebar">
        <h2 class="sidebar-brand">SaaSShop</h2>
        <div class="muted">站点后台 / Site Console</div>

        <div class="group-title">总览</div>
        <a class="sidebar-link" href="/site-admin">站点仪表盘</a>

        <div class="group-title">站点运营</div>
        <a class="sidebar-link" href="/site-admin/merchants">站点商家</a>
        <a class="sidebar-link" href="/site-admin/products">站点商品</a>
        <a class="sidebar-link" href="/site-admin/orders">站点订单</a>

        <div class="group-title">切换入口</div>
        <a class="sidebar-link" href="/admin">总台管理</a>
        <a class="sidebar-link" href="/merchant-admin">商家后台</a>
        <a class="sidebar-link" href="/">返回首页</a>
        <form class="sidebar-logout" method="post" action="/site-admin/logout">
            @csrf
            <button type="submit">退出登录</button>
        </form>
    </aside>
    <main class="content">
        <div class="top">
            <div>
                <h1 class="page-title">@yield('page_title', '站点后台')</h1>
                <div class="muted">当前登录：{{ session('admin_name') }}（{{ session('admin_email') }}） / 站点 ID：{{ session('admin_site_id') }}</div>
                <div class="badge badge-scope">当前作用域：站点管理员</div>
            </div>
        </div>
        @if(session('success'))
            <div class="flash">{{ session('success') }}</div>
        @endif
        @if(session('warning'))
            <div class="warning">{{ session('warning') }}</div>
        @endif
        @if($errors->any())
            <div class="error-box">
                <strong>提交失败：</strong>
                <ul class="ml-18">
                    @foreach($errors->all() as $error)
                        <li>{{ $error }}</li>
                    @endforeach
                </ul>
            </div>
        @endif
        @yield('content')
    </main>
</div>
</body>
</html>
