<!DOCTYPE html>
<html>

    <style>
        .card {
            background: white;
            border-radius: 12px;
            box-shadow: 0 4px 6px rgba(0,0,0,0.1);
            padding: 20px;
            margin: 15px;
        }
        .user-avatar {
            width: 100%;
            height: 100%;
            object-fit: cover;
            border-radius: 50%;
            border: 2px solid #fff;
            box-shadow: 0 2px 4px rgba(0,0,0,0.1);
            transition: transform 0.3s ease;
        }
        .user-profile {
            display: flex;
            align-items: center;
            gap: 20px;
            padding-bottom: 15px;
            border-bottom: 1px solid #eee;
        }

        .avatar-container {
            width: 80px;
            height: 80px;
            border-radius: 50%;
            overflow: hidden;
            flex-shrink: 0;
        }

        .user-info {
            display: flex;
            flex-direction: column;
            gap: 5px;
        }

        .nickname {
            font-size: 1.2em;
            font-weight: 500;
        }

        .coins {
            color: #666;
            font-size: 0.9em;
        }

        .transaction-list {
            list-style: none;
            padding: 0;
            margin: 15px 0 0;
        }

        .transaction-item {
            display: flex;
            justify-content: space-between;
            align-items: center;
            padding: 12px 0;
            border-bottom: 1px solid #f5f5f5;
        }

        .transaction-details {
            display: flex;
            flex-direction: column;
            gap: 3px;
        }

        .transaction-amount {
            font-weight: 500;
        }

        @media (max-width: 600px) {
            .card {
                margin: 10px;
                padding: 15px;
            }
            
            .user-profile {
                gap: 15px;
            }
        }
    </style>
</head>
<body>
    <div class="card">
        <!-- 用户信息区块 -->
        <div class="user-profile">
            <div class="avatar-container">
                <img src="{{avatar}}" class="user-avatar">
            </div>
            <div class="user-info">
                <span class="nickname">{{nickname}}</span>
                <span class="coins">🪙 当前金币：{{coins}}</span>
            </div>
        </div>

        <!-- 交易记录列表 -->
        <ul class="transaction-list">
            {{each logs.slice(0,10)}}
            <li class="transaction-item">
                <div class="transaction-details">
                    <div class="transaction-time">{{$value.date}}</div>
                    <div class="transaction-reason">{{$value.reason}}</div>
                </div>
                <div class="transaction-amount">
                    {{if $value.type=='add'}}<span style="color: rgb(50, 110, 50)" >+ {{$value.amount}}</span>{{else}}<span style="color: rgb(230, 56, 56);">-{{$value.amount}}</span>{{/if}}
                </div>
            </li>
            {{/each}}
        </div>
    </div>
</body>
</html>