@model iyixiGames.Domain.DTOs.Sites.SiteResponse

@{
    ViewData["Title"] = "网站详情 - " + Model.Name;
}

<div class="container mt-4">
    <div class="d-flex justify-content-between align-items-center mb-3">
        <h1>@ViewData["Title"]</h1>
        <div>
            <a asp-action="Edit" asp-route-id="@Model.Id" class="btn btn-info me-2">编辑</a>
            <a asp-action="Index" class="btn btn-secondary">返回列表</a>
        </div>
    </div>

    <div class="card shadow-sm">
        <div class="card-body">
            <h4 class="card-title mb-4">基本信息</h4>
            <dl class="row">
                <dt class="col-sm-3">@Html.DisplayNameFor(model => model.Id)</dt>
                <dd class="col-sm-9">@Html.DisplayFor(model => model.Id)</dd>

                <dt class="col-sm-3">@Html.DisplayNameFor(model => model.Name)</dt>
                <dd class="col-sm-9">@Html.DisplayFor(model => model.Name)</dd>

                <dt class="col-sm-3">@Html.DisplayNameFor(model => model.Domain)</dt>
                <dd class="col-sm-9"><a href="@Model.Domain" target="_blank">@Html.DisplayFor(model => model.Domain)</a></dd>

                <dt class="col-sm-3">@Html.DisplayNameFor(model => model.OwnerUserId)</dt>
                <dd class="col-sm-9">@Html.DisplayFor(model => model.OwnerUserId)</dd>

                <dt class="col-sm-3">@Html.DisplayNameFor(model => model.Status)</dt>
                <dd class="col-sm-9">
                    <span class="badge @(Model.Status == "active" ? "bg-success" : (Model.Status == "inactive" ? "bg-secondary" : "bg-warning"))">
                        @Html.DisplayFor(model => model.Status)
                    </span>
                </dd>

                <dt class="col-sm-3">@Html.DisplayNameFor(model => model.CreatedAt)</dt>
                <dd class="col-sm-9">@Html.DisplayFor(model => model.CreatedAt)</dd>

                <dt class="col-sm-3">@Html.DisplayNameFor(model => model.UpdatedAt)</dt>
                <dd class="col-sm-9">@Html.DisplayFor(model => model.UpdatedAt)</dd>
            </dl>

            @if (Model.TeamMembers != null && Model.TeamMembers.Any())
            {
                <h4 class="card-title mt-4 mb-3">团队成员</h4>
                <ul class="list-group list-group-flush mb-4">
                    @foreach (var member in Model.TeamMembers)
                    {
                        <li class="list-group-item">
                            用户ID: <strong>@member.UserId</strong>, 角色: <span class="badge bg-primary">@member.Role</span>
                        </li>
                    }
                </ul>
            }

            @if (Model.Seo != null)
            {
                <h4 class="card-title mt-4 mb-3">SEO 信息</h4>
                <dl class="row">
                    <dt class="col-sm-3">描述</dt>
                    <dd class="col-sm-9">@Html.DisplayFor(model => model.Seo.Description)</dd>

                    <dt class="col-sm-3">关键词</dt>
                    <dd class="col-sm-9">@Html.DisplayFor(model => model.Seo.Keywords)</dd>
                </dl>
            }

            @if (Model.Analytics != null)
            {
                <h4 class="card-title mt-4 mb-3">分析数据</h4>
                <dl class="row">
                    <dt class="col-sm-3">日访问量</dt>
                    <dd class="col-sm-9">@Html.DisplayFor(model => model.Analytics.DailyVisitors)</dd>

                    <dt class="col-sm-3">热门游戏</dt>
                    <dd class="col-sm-9">@Html.DisplayFor(model => model.Analytics.PopularGames)</dd>
                </dl>
            }

            @if (Model.Settings != null)
            {
                <h4 class="card-title mt-4 mb-3">网站设置</h4>
                <dl class="row">
                    <dt class="col-sm-3">主题</dt>
                    <dd class="col-sm-9">@Html.DisplayFor(model => model.Settings.Theme)</dd>

                    <dt class="col-sm-3">语言</dt>
                    <dd class="col-sm-9">@Html.DisplayFor(model => model.Settings.Language)</dd>

                    <dt class="col-sm-3">启用广告</dt>
                    <dd class="col-sm-9">@(Model.Settings.AdEnabled ? "是" : "否")</dd>
                </dl>
            }
        </div>
    </div>
</div>