/* 全局样式重置 */ view, text, button, input { margin: 0; padding: 0; box-sizing: border-box; } /* 主容器 */ .container { padding: 20rpx; background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); min-height: 100vh; font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif; } /* 顶部标题栏 */ .header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 30rpx; padding: 10rpx 0; } .title { font-size: 36rpx; font-weight: bold; color: white; text-shadow: 0 2rpx 4rpx rgba(0,0,0,0.1); letter-spacing: 1rpx; } .header-actions { display: flex; gap: 15rpx; } .refresh-btn, .history-btn, .logs-btn { background: rgba(255,255,255,0.2); color: white; font-size: 28rpx; padding: 8rpx 24rpx; border-radius: 20rpx; border: 1px solid rgba(255,255,255,0.3); backdrop-filter: blur(10rpx); transition: all 0.3s ease; } .refresh-btn:hover, .history-btn:hover, .logs-btn:hover { background: rgba(255,255,255,0.3); transform: translateY(-2rpx); box-shadow: 0 4rpx 8rpx rgba(0,0,0,0.1); } .refresh-btn[loading] { opacity: 0.8; pointer-events: none; } /* 设备信息卡片 */ .device-info { background: rgba(255,255,255,0.95); border-radius: 24rpx; padding: 30rpx; margin-bottom: 30rpx; box-shadow: 0 8rpx 24rpx rgba(0,0,0,0.1); backdrop-filter: blur(10rpx); animation: slideUp 0.5s ease; } .device-header { display: flex; align-items: center; gap: 15rpx; margin-bottom: 15rpx; } .device-icon { font-size: 40rpx; } .device-name { font-size: 32rpx; font-weight: 600; color: #333; } .device-status { display: flex; align-items: center; gap: 10rpx; } .status-indicator { width: 12rpx; height: 12rpx; border-radius: 50%; animation: pulse 2s infinite; } .status-indicator.connected { background: #07c160; } .status-text { font-size: 24rpx; color: #666; } .connection-time { font-size: 20rpx; color: #999; margin-left: auto; } /* 数据网格 */ .data-grid { margin-top: 20rpx; display: grid; grid-template-columns: 1fr 1fr; gap: 15rpx; margin-bottom: 30rpx; } /* 数据卡片 */ .data-card { background: rgba(255,255,255,0.95); border-radius: 16rpx; padding: 20rpx; text-align: center; box-shadow: 0 4rpx 12rpx rgba(0,0,0,0.1); transition: all 0.3s ease; backdrop-filter: blur(10rpx); position: relative; overflow: hidden; min-height: 180rpx; display: flex; flex-direction: column; justify-content: space-between; } .data-card::before { content: ''; position: absolute; top: 0; left: 0; width: 100%; height: 4rpx; background: linear-gradient(90deg, #667eea, #764ba2); transform: scaleX(0); transition: transform 0.3s ease; } .data-card:hover { transform: translateY(-6rpx); box-shadow: 0 16rpx 40rpx rgba(0,0,0,0.15); } .data-card:hover::before { transform: scaleX(1); } .data-card:active { transform: translateY(0); } /* 卡片头部 */ .card-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20rpx; } .label { font-size: 24rpx; color: #666; font-weight: 500; text-transform: uppercase; letter-spacing: 1rpx; } .status-icon { font-size: 16rpx; transition: all 0.3s ease; } .status-icon.normal { color: #07c160; } .status-icon.warning { color: #ff9800; animation: pulse 1s infinite; } /* 数据值 */ .value { font-size: 40rpx; font-weight: bold; color: #333; transition: all 0.3s ease; margin-bottom: 10rpx; } .data-card:hover .value { color: #667eea; transform: scale(1.05); } .unit { font-size: 20rpx; color: #999; position: absolute; top: 35rpx; right: 35rpx; } /* 控制按钮区域 */ .control-area { display: flex; flex-direction: column; gap: 20rpx; margin-bottom: 30rpx; } .action-btn { display: flex; align-items: center; justify-content: center; gap: 15rpx; padding: 24rpx; border-radius: 16rpx; font-size: 32rpx; font-weight: 600; transition: all 0.3s ease; box-shadow: 0 6rpx 16rpx rgba(0,0,0,0.1); } .action-btn .btn-icon { font-size: 36rpx; } .action-btn .btn-text { font-size: 30rpx; } .bluetooth-btn { background: linear-gradient(135deg, #07c160 0%, #00b45a 100%); color: white; box-shadow: 0 6rpx 16rpx rgba(7,193,96,0.3); } .bluetooth-btn:hover { transform: translateY(-3rpx); box-shadow: 0 10rpx 24rpx rgba(7,193,96,0.4); } .wifi-btn { background: linear-gradient(135deg, #007aff 0%, #0066cc 100%); color: white; box-shadow: 0 6rpx 16rpx rgba(0,122,255,0.3); } .wifi-btn:hover { transform: translateY(-3rpx); box-shadow: 0 10rpx 24rpx rgba(0,122,255,0.4); } .disconnect-btn { background: linear-gradient(135deg, #ff6b6b 0%, #ee5a52 100%); color: white; box-shadow: 0 6rpx 16rpx rgba(255,107,107,0.3); } .disconnect-btn:hover { transform: translateY(-3rpx); box-shadow: 0 10rpx 24rpx rgba(255,107,107,0.4); } .action-btn[disabled] { background: #f0f0f0 !important; color: #999 !important; box-shadow: none !important; transform: none !important; opacity: 0.6; } /* 模态框 */ .modal { position: fixed; top: 0; left: 0; right: 0; bottom: 0; background: rgba(0,0,0,0.5); display: flex; align-items: center; justify-content: center; z-index: 9999; backdrop-filter: blur(10rpx); animation: fadeIn 0.3s ease; } .modal-inner { background: white; border-radius: 24rpx; padding: 40rpx; width: 85%; max-width: 500rpx; box-shadow: 0 16rpx 60rpx rgba(0,0,0,0.3); animation: slideUp 0.4s ease; position: relative; } .history-modal { max-height: 80vh; overflow: hidden; display: flex; flex-direction: column; } .modal-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 30rpx; } .modal-title { font-size: 32rpx; font-weight: bold; color: #333; } .modal-close { font-size: 40rpx; color: #999; background: none; border: none; padding: 0; width: 50rpx; height: 50rpx; display: flex; align-items: center; justify-content: center; border-radius: 50%; transition: all 0.3s ease; } .modal-close:hover { background: #f0f0f0; color: #333; } .modal-content { margin-bottom: 30rpx; } .input-group { margin-bottom: 25rpx; } .input-label { display: block; font-size: 24rpx; color: #666; margin-bottom: 10rpx; font-weight: 500; } .input-group input { width: 100%; padding: 24rpx; font-size: 28rpx; border-radius: 12rpx; border: 1px solid #e0e0e0; transition: all 0.3s ease; background: #f9f9f9; } .input-group input:focus { outline: none; border-color: #667eea; box-shadow: 0 0 0 3rpx rgba(102,126,234,0.1); background: white; } .modal-buttons { display: flex; gap: 20rpx; margin-top: 40rpx; } .modal-btn { flex: 1; padding: 20rpx; font-size: 28rpx; border-radius: 12rpx; transition: all 0.3s ease; font-weight: 500; } .modal-btn.cancel { background: #f0f0f0; color: #333; } .modal-btn.cancel:hover { background: #e0e0e0; transform: translateY(-2rpx); } .modal-btn.confirm { background: #667eea; color: white; box-shadow: 0 4rpx 12rpx rgba(102,126,234,0.3); } .modal-btn.confirm:hover { background: #5a6fdd; transform: translateY(-2rpx); box-shadow: 0 6rpx 16rpx rgba(102,126,234,0.4); } /* 历史记录列表 */ .history-list { max-height: 500rpx; overflow-y: auto; margin-top: 20rpx; } .history-item { display: flex; justify-content: space-between; align-items: center; padding: 20rpx; border-bottom: 1px solid #f0f0f0; transition: all 0.3s ease; } .history-item:hover { background: #f9f9f9; border-radius: 8rpx; } .history-time { font-size: 24rpx; color: #666; font-weight: 500; } .history-value { font-size: 22rpx; color: #999; } .empty-history { text-align: center; padding: 60rpx 20rpx; color: #999; } .empty-text { font-size: 24rpx; } /* 动画 */ @keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } } @keyframes slideUp { from { opacity: 0; transform: translateY(50rpx); } to { opacity: 1; transform: translateY(0); } } @keyframes pulse { 0% { transform: scale(1); opacity: 1; } 50% { transform: scale(1.2); opacity: 0.7; } 100% { transform: scale(1); opacity: 1; } } /* 响应式设计 */ @media (max-width: 414px) { .data-grid { grid-template-columns: 1fr 1fr; gap: 12rpx; } .data-card { padding: 16rpx; min-height: 160rpx; } .value { font-size: 32rpx; } .action-btn { padding: 20rpx; } .modal-inner { width: 90%; padding: 30rpx; } } /* 滚动条样式 */ .history-list::-webkit-scrollbar { width: 6rpx; } .history-list::-webkit-scrollbar-track { background: #f1f1f1; border-radius: 3rpx; } .history-list::-webkit-scrollbar-thumb { background: #c1c1c1; border-radius: 3rpx; } .history-list::-webkit-scrollbar-thumb:hover { background: #a8a8a8; }