<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>短信详情 - 短信转发接收端</title>
    <link rel="stylesheet" href="/static/css/style.css">
</head>
<body>
    <div class="container">
        <nav class="navbar">
            <div class="nav-brand">📱 短信转发接收端</div>
            <div class="nav-links">
                <a href="/">短信列表</a>
                <a href="/logs">接收日志</a>
                <a href="/statistics">统计信息</a>
                <a href="/logout">退出</a>
            </div>
        </nav>
        <main class="content">
            <div class="detail-container">
                <h2>📱 短信详情</h2>
                <a href="/" style="color: #667eea; text-decoration: none;">← 返回列表</a>

                <div class="detail-item" style="margin-top: 20px;">
                    <div class="detail-label">ID</div>
                    <div class="detail-value">{{.ID}}</div>
                </div>

                <div class="detail-item">
                    <div class="detail-label">发送方号码</div>
                    <div class="detail-value">{{.FromNumber}}</div>
                </div>

                <div class="detail-item">
                    <div class="detail-label">短信内容</div>
                    <div class="detail-value" style="white-space: pre-wrap;">{{.Content}}</div>
                </div>

                <div class="detail-item">
                    <div class="detail-label">原始时间戳</div>
                    <div class="detail-value">{{.Timestamp}}</div>
                </div>

                <div class="detail-item">
                    <div class="detail-label">本地时间</div>
                    <div class="detail-value">{{.TimestampStr}}</div>
                </div>

                <div class="detail-item">
                    <div class="detail-label">入库时间</div>
                    <div class="detail-value">{{.CreatedAt.Format "2006-01-02 15:04:05"}}</div>
                </div>

                <div class="detail-item">
                    <div class="detail-label">签名验证</div>
                    <div class="detail-value">
                        {{if .SignVerified.Valid}}
                            {{if .SignVerified.Bool}}
                            <span class="badge badge-success">已验证</span>
                            {{else}}
                            <span class="badge badge-danger">未验证</span>
                            {{end}}
                        {{else}}
                        <span class="badge badge-warning">未验证</span>
                        {{end}}
                    </div>
                </div>

                {{if .DeviceInfo.Valid}}
                <div class="detail-item">
                    <div class="detail-label">设备信息</div>
                    <div class="detail-value">{{.DeviceInfo.String}}</div>
                </div>
                {{end}}

                {{if .SIMInfo.Valid}}
                <div class="detail-item">
                    <div class="detail-label">SIM 卡信息</div>
                    <div class="detail-value">{{.SIMInfo.String}}</div>
                </div>
                {{end}}

                <div class="detail-item">
                    <div class="detail-label">IP 地址</div>
                    <div class="detail-value">{{.IPAddress}}</div>
                </div>
            </div>
        </main>
    </div>
</body>
</html>