/* 引入通用样式 */ .container { display: flex; justify-content: center; align-items: center; min-height: 100vh; background-color: #f5f7fa; padding: 20rpx; } /* 卡片容器使用纵向布局 */ .cards-container { display: flex; flex-direction: column; /* 纵向排列卡片 */ gap: 15px; /* 卡片之间的间距 */ padding: 15px; box-sizing: border-box; } /* 投票卡片卡片样式 */ .voting-card { width: 100%; min-height: 400px; /* 卡片最小高度,可根据内容调整 */ background: #fff; border-radius: 10px; box-shadow: 0 2px 8px rgba(0,0,0,0.1); padding: 15px; box-sizing: border-box; } /* 卡片头部样式 */ .card-header { display: flex; justify-content: space-between; align-items: center; padding: 30rpx; } .user-info { display: flex; align-items: center; } .avatar { width: 80rpx; height: 80rpx; border-radius: 50%; margin-right: 20rpx; } .username { display: block; font-size: 32rpx; font-weight: 600; color: #333333; margin-bottom: 4rpx; } .user-status { display: block; font-size: 24rpx; color: #888888; } .vote-status { background-color: rgba(79, 70, 229, 0.1); color: #4F46E5; font-size: 24rpx; padding: 8rpx 16rpx; border-radius: 20rpx; } .divider { height: 2rpx; background-color: #f5f5f5; } /* 投票标题区域 */ .vote-title-section { padding: 0 30rpx 30rpx; } .vote-title { display: block; font-size: 36rpx; font-weight: 700; color: #333333; margin-bottom: 16rpx; } .vote-desc { font-size: 26rpx; color: #888888; } /* 选项区域样式 */ .options-container { padding: 0 30rpx 20rpx; } .option-item { position: relative; padding: 24rpx; border: 2rpx solid #f0f0f0; border-radius: 16rpx; margin-bottom: 20rpx; transition: all 0.3s; } .option-item.selected { border-color: #4F46E5; background-color: rgba(79, 70, 229, 0.05); } .option-item:hover { border-color: rgba(79, 70, 229, 0.3); background-color: rgba(79, 70, 229, 0.03); } .option-info { display: flex; align-items: center; margin-bottom: 16rpx; } .option-icon { width: 64rpx; height: 64rpx; border-radius: 12rpx; display: flex; justify-content: center; align-items: center; margin-right: 20rpx; } .bg-red { background-color: rgba(248, 113, 113, 0.1); color: #ef4444; } .bg-yellow { background-color: rgba(251, 191, 36, 0.1); color: #f59e0b; } .bg-green { background-color: rgba(34, 197, 94, 0.1); color: #10b981; } .option-details { flex: 1; } .option-name { display: block; font-size: 30rpx; font-weight: 600; color: #333333; margin-bottom: 4rpx; } .option-desc { font-size: 24rpx; color: #888888; } .option-percent { font-size: 28rpx; font-weight: 600; color: #333333; } /* 进度条样式 */ .progress-bar { height: 12rpx; background-color: #f0f0f0; border-radius: 6rpx; overflow: hidden; } .progress-value { height: 100%; background-color: #4F46E5; border-radius: 6rpx; transition: width 0.5s ease-out; } /* 选中指示器 */ .vote-indicator { position: absolute; top: 24rpx; right: 24rpx; color: #4F46E5; font-size: 36rpx; display: none; } .vote-indicator.show { display: block; } /* 投票统计信息 */ .vote-stats { display: flex; justify-content: space-between; padding: 0 30rpx 20rpx; } .stats-text { font-size: 24rpx; color: #888888; } /* 投票按钮 */ .vote-btn { width: calc(100% - 60rpx); margin: 0 30rpx 30rpx; padding: 24rpx 0; background-color: #4F46E5; color: #ffffff; border-radius: 16rpx; font-size: 30rpx; font-weight: 600; display: flex; justify-content: center; align-items: center; transition: all 0.3s; } .vote-btn .iconfont { margin-right: 12rpx; font-size: 32rpx; } .vote-btn::after { border: none; } .vote-btn:hover { background-color: rgba(79, 70, 229, 0.9); } .vote-btn:active { transform: scale(0.98); } /* 成功提示 */ .success-toast { position: fixed; top: 50rpx; left: 50%; transform: translateX(-50%); background-color: #10b981; color: #ffffff; padding: 16rpx 32rpx; border-radius: 8rpx; display: flex; align-items: center; box-shadow: 0 4rpx 12rpx rgba(0, 0, 0, 0.1); z-index: 999; opacity: 0; pointer-events: none; transition: opacity 0.3s; } .success-toast.show { opacity: 1; pointer-events: auto; } .success-toast .iconfont { margin-right: 12rpx; font-size: 32rpx; } .toast-text { font-size: 28rpx; }